Writing an application in LabVIEW 7.0 that must run under XP, NT, and Win2000. Multiple application windows are open at the same time, and the operator would find it useful to move to a specific application window (make it the front-most window and activate it (so it has keyboard focus)) by using a dedicated function key (e.g., F2=App A, F3=App B, etc.). My code captures the function keypress event is the main event loop of each application (executable) (this is necessary because we don't know which application has keyboard focus at the moment). The value of the function key is translated into a message to the application that is desired to bring front-most and activated. A message is sent over a TCP/IP connection to that application so it can make itself the front-most window, and activate its front panel.
I have tried various methods for doing this. There is a WinUtil.llb library that NI supplies, that contains a VI called "Move Window To Top.vi". It has a Boolean flag input that allow you to choose to activate the window or not. I've also tried to use the VI property node, with the properties (front panel window -> IsFrontmost set to TRUE, and the property front panel window -> state set to STANDARD.
If I run as from a VI, I can get my code to work under XP, NT, and Win2000. When I compile my code, it works well under XP and NT. Under Win2000, the front panel specified is brought forward, but not activated. So, it doesn't have keyboard focus, and an additional mouse click it needed to give the front panel the active state.
Does anyone know how to activate a window programmatically (in an executable) from Win2000?
-Steph