LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Having issues with setting the "Active Window"

Hello List,

 

I've got a LV installation that runs three LV created EXE's simultaneously. In the "top level" application, the user enters a product model number (by way of a PS2 barcode scanner) to be tested, and that application looks at our network to see if there is a test recipe for the product. If there is, it hides and moves itself to the bottom and maximizes and moves to the top EXE number two. On EXE number two, the user is supposed to scan the product serial number. But on occasion, EXE number two is not the active window, even though it is the frontmost and maximized, so the scan from the barcode reader doesn't go into the field. (Looking at the Taskbar at the bottom of the screen, the task for the frontmost & maximized EXE is not "depressed")  A simple mouse click anywhere on the window will make it active, but the users don't have a mouse (or keyboard) (I am able to "remote in" from another computer using a product line "PC Anywhere). I have tried using the "mouse_event" from user32.dll in a "Call Library Function Node", but that doesn't seam to work reliably.

So my first question is, will the "mouse_event" from user32.dll even fire if my computer doesn't have a mouse plugged in?

And, if not, does anyone have any better ideas?

 

Thanks in advance,

Mike

0 Kudos
Message 1 of 3
(2,080 Views)

@wd8ivl wrote:

So my first question is, will the "mouse_event" from user32.dll even fire if my computer doesn't have a mouse plugged in?


I'm guessing that it would, because Windows has a cursor even if there's no mouse plugged in, but I haven't tried it.

 

As for the second question, you could try what I posted here, although you'll probably want to clean up the code - http://lavag.org/topic/12751-how-do-you-make-your-application-window-frontmost/?p=76308


___________________
Try to take over the world!
0 Kudos
Message 2 of 3
(2,044 Views)

Tst,

 

Thanks for the info.  I guess I thought the cursor was there because a keyboard was plugged in (and in my case because my barcode scanner is a keyboard wedge type), but never noticed whether or not there was a mouse pointer without a mouse plugged in.

 

I'll have to get your post from the Lava board when I get home tonight.  The IT police here at work have it blocked.

 

Mike

0 Kudos
Message 3 of 3
(2,009 Views)