LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I detect if LabVIEW is the active (frontmost) Windows application?

I need a way to figure out in LabVIEW 6.1 if LabVIEW is the "active" application in Windows. More specifically, I need to know if a user has switched to some other application besides LabVIEW. This needs to work on an EXE as well as VIs.
0 Kudos
Message 1 of 4
(3,761 Views)
One possibility is the FP.IsFrontmost property of VIs. If you check whether it's false for all the open VIs.
Message 2 of 4
(3,761 Views)
That can work, but in my application I have nearly 800 VIs in memory, so opening a reference to all of them and checking the property for each one over and over is quite inefficient.
0 Kudos
Message 3 of 4
(3,761 Views)

I also ran into this issue. The previous post can be solved easily by the new event structures, but I need to check if a panel is the frontmost in windows as well.

 

The FP.Is frontmost property returns if a panel is the frontmost Vi within Labview but not if Labview is the frontmost window in windows.

 

I ran into this as I am making some stuff to use the scollwheel.

 

As an example I have added two Vi's. Just load & run these, as long as Labview is active this works. But I would like to have something that switches the lights off when I select another Windows application.

 

I (think I) cannot use the USER32.dll API as I reconstruct a reference to the 'owner vi' using a control reference.

 

Anyone has some experience with this??

 

 

 

 

---

25+ years long fan of LabVIEW. Move to Emerson looks to be for the better! See the last posts in subscription model thread.
Download All
0 Kudos
Message 4 of 4
(3,380 Views)