LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Launching LabVIEW executable from cmd without giving it the windows focus.

Hi,

 

I'm launching a LabVIEW application from a script in cygwin. I don't want the application to be shown to the user and neither lose the windows focus of the active windows when the application is lauched. How can this be done?

 

Thanks,

 

Michel

0 Kudos
Message 1 of 9
(3,086 Views)
0 Kudos
Message 2 of 9
(3,079 Views)

Hi Adnan,

 

I already had the code you are refering in your response. The thing is that the cygwin script is making multiple calls to my LabVIEW application. So if the user is working on something else during these calls he is loosing the focus of the window is working on. Is there a way to avoid that?

 

Thanks,

 

Michel

0 Kudos
Message 3 of 9
(3,046 Views)

Michel-

  

Is your code calling SubVIs?  If this is the case, you will need to include the code referenced on the forum above in each SubVI.  This is due to the fact that your script will execute these other VIs and they will not run hidden.

 

If this is not the case, can you post your code for us to take a look at?  Perhaps there is something in your code requiring it to be in view.

 

-Mike S

Regards,

Mike S
NI AE
0 Kudos
Message 4 of 9
(3,030 Views)

Hi,

 

Here is a very simple application, this is the smallest application you can have to do what I want. If you compile this VI into an executable and add the HideRootWindow=True and you run it on your computer you will always see the root windows in the task bar for a fraction of second and then it disappears.

 

So let say I'm working in microsoft word and my cygwin script is running in the background, I'm loosing the microsoft word application focus when the cygwin script is calling the labview executable. I want to get rid of that behavior.

 

Answers to your previous questions:

1. Yes I'm calling subVIs but not as user interface.

2. The cygwin script is launching a labview executable.

3. Nothing is requiring to be in view as shown in the attached example.

 

Thanks for your help,

 

Michel

0 Kudos
Message 5 of 9
(3,020 Views)
I looked at your VI.  Have you tried setting the 'Activate' to FALSE.  It is TRUE by default which sets it to the active window when called.
0 Kudos
Message 6 of 9
(3,015 Views)

Doesn't work either. This time I had the windows explorer window opened in the LabVIEW executable folder. I've double clicked on the executable and I losed the focus on the windows explorer window.

 

Michel

0 Kudos
Message 7 of 9
(3,009 Views)
I use that when I open a VI from my UI VI, and the UI VI keeps focus.  But it's different calling it from a script.  I don't know anything about cygwin, but is it possible to build and call your VI as a DLL?  That would not change the focus.
0 Kudos
Message 8 of 9
(3,006 Views)

I'll have to wait until the cygwin guru come back from vacation and I will ask him if he can call a dll.

 

Thanks for the help.

 

Michel

0 Kudos
Message 9 of 9
(3,002 Views)