LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating windows events in another executable.

I have used the function call LaunchExecutableEx( "fileName", LE_SHOWMINIMIZED, exeHandle ).

Q1. Once the executable is running, does LabWindows/CVI provide a mechanism for restoring the application?
Q2. Do I need to use Windows SDK and if so is there an example I can refer to?
0 Kudos
Message 1 of 2
(2,929 Views)
Hi Damien,
I assume you're refering to the fact that the LaunchExecutable returns to the CVI program straight away, but doesn't give you a handle to it so you can programatically restore / maximise it?
I've attached an example on how this can be done useing the Windows SDK functions.
The EnumWindows function takes the current list of windows that the operating system can see, and continuously calls the EnumWindowsProc function at the bottom of the code.
This checks against the process ID to make sure that they match up.
I cheated and used some globals, but you could always tidy this later (the EnumWindowsProc takes a parameter that can be passed so you could update a variable that way)
If it matches, then I set a found flag, and use this to actually perform the restore.

If the project doesn't open, I've only used one .c file, so just start a new project with that in.

Thanks

Sacha Emery
National Instruments (UK)
// it takes almost no time to rate an answer Smiley Wink
Message 2 of 2
(2,916 Views)