LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Active window property/method?

I understand this is specified in the help file, I want to know if there is another property, method or workaround that will indicate if the front panel is currently active (when VI is set to floating).
Message Edited by CAC10268 on 12-23-2009 08:36 AM
0 Kudos
Message 11 of 18
(1,849 Views)

In the Event structure, you have the Event Sources = <Application> & Event = VI Activation. It provides the event on which VI is activated.

Perhaps you have a place in your framework to use it.

0 Kudos
Message 12 of 18
(1,832 Views)
This method works, but only generates an event when the VI is activated and not when its deactivated. If there was an event that would detect when a VI is deactivated, this method would work.
Message Edited by CAC10268 on 12-23-2009 10:28 AM
0 Kudos
Message 13 of 18
(1,826 Views)

Depend of your application but can't you consider the VI is deactivated if an other VI is activated?

Perhaps I am wrong but 2 windows can not be activated at the same time. 

 

Place a supervisor in an other place as in your concerned VIs and manage the event... Keep the last activated VI in memory to know at any time which VI was the last called and consider it's the activated. You could also applicate a filter between different opened VI.

Message 14 of 18
(1,821 Views)
That's a good suggestion...I will try that and let u know if it works well.
0 Kudos
Message 15 of 18
(1,818 Views)
If you are not adversed to using the operating system then on Windows you can use the Windows API to find out if a floating window (or any window for that matter) is active. See attached example. Note that the floating window VI must be running first.
Download All
Message 16 of 18
(1,803 Views)

smercurio_fc  can u post a version 8, or an image?

 

0 Kudos
Message 17 of 18
(1,793 Views)

A screenshot won't do much good without seeing how the CLFNs are configured, so attached are the 2 example VIs back-saved to 8.0. Note: I know that in 8.2 there is a bug with the CLFN that will not allow you to connect the error cluster from one CLFN to another. I don't know if the problem exists in 8.0.

 

Also note that as an example, there's some missing error handling, such as checking for the window handle being zero.

Download All
0 Kudos
Message 18 of 18
(1,771 Views)