LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

an inexplicable problem using LaunchExetable() in cvi 6

As the definition of LaunchExetable() ,it can luanch a .exe file and show it in 6 modes , but I can not use it to control the behavior of my application . Here attach the application , when use the "LE_HIDE" mode,it can not hide the loaded window , and more ,when minimizing the loaded window , the tip info can be found but can not show the tray icon on the task bar .How to resolve the problem ? Please help !

David
0 Kudos
Message 1 of 4
(3,003 Views)
Continued the question ,if the launched application is iconed ,how to active and show it to the foreground in another process? I mean not show it by double click at the tray area but by operate a control in another program . How to get its running state ? Thanks.

David
0 Kudos
Message 2 of 4
(3,003 Views)
I have resolved the problem . In fact ,it needs to use Windows SDK "CreateProcess()" to launch a executable module , the syntax is as that :
CreateProcess("myfile.exe","myfile MINIMIZE",NULL,NULL,FALSE,CREATE_DEFAULT_ERROR_MODE|DETACHED_PROCESS,NULL,"the directory of myfile",&si,&piProcess),the key is that must specify the launched process's path .then the icon displays normal .the module being called can interpret the imported parameter by comparing argv(in the entry point of main),then determine how to display the panel.In this syntax , I specified "MINIMIZE" as a key character ,then it will display itself in iconized form .

Here , I find another problem :when call the windows API ,"GetWindowInfo()",the compiler can not recognize the function , although
I can find it in winuser.h . Comparing cvi's include file with VC's ,it is different , e.g.,in the CVI's include file , the function ,GetWindowInfo, is defined as :BOOL WINAPI GetWindowInfo(IN HWND hwnd,OUT PWINDOWINFO pwi),but in VC's include file , definition is as :
BOOL WINAPI GetWindowInfo(HWND hwnd,PWINDOWINFO pwi).I do not know if it is a bug resulted in the compiling fail .

David
0 Kudos
Message 3 of 4
(3,003 Views)
David,
You can expect some differences on the VC SDK and the CVI SDK. The Windows SDK was not designed to work with a regular C compiler, it uses C++ in some of the header files and definitions. What we did with the CVI SDK is to modify some of the header files to make it possible to be used by an ANSI C compiler.

I recomend that you stay with the format of the function found in the CVI's version of the SDK, this should compile and avoid some possible problems with C++ definitions.

Hope this helps.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 4 of 4
(3,003 Views)