LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI to stay on top of Excel and any other applications

Solved!
Go to solution

How do I keep my main VI on top of all other windows, i.e. Excel? This simple concept seems to escape me. The Floating Window Behavior doesn't appear to do the trick.

 

Please advise.

0 Kudos
Message 1 of 12
(3,666 Views)

Open the properties dialog (ctrl I).Select the window appearance category, select customize, and set it to modal.

Jim

LV 2020
0 Kudos
Message 2 of 12
(3,665 Views)

This doesn't appear to work, as when I try to move my cursor to another cell in Excel, the VI goes behind Excel.

0 Kudos
Message 3 of 12
(3,658 Views)
You will need to call windows user32.DLL functions. First to get the window handle, and then to set the z order of the window. Setting z order to -1 sticks the window to the top of all applications. I can probably find an example for you when I am back at work in the morning.
good luck,
Michael.
0 Kudos
Message 4 of 12
(3,650 Views)

Rivers, that would be most appreciated.

0 Kudos
Message 5 of 12
(3,648 Views)
Solution
Accepted by topic author Eric1977

Just use the Windows API Function Utilities for LabVIEW. It has a VI in there to set a window on top.

Message 6 of 12
(3,642 Views)

I have written an example for this using native dll calls as promised.  Copy the dll nodes to your application to preserve the paramater setup.

Stop the VI using the Close X, not the abort button, or your window will be stuck on top!

All the best,

Michael.

0 Kudos
Message 7 of 12
(3,628 Views)

Is the Windows API functions available in LV2010 SP1?

0 Kudos
Message 8 of 12
(3,609 Views)

If you are referring to the link I sent you, then just download the 8.6 version. 2010 can open 8.6 VIs. You can then simply resave them.

0 Kudos
Message 9 of 12
(3,606 Views)

Thank you. That worked!

0 Kudos
Message 10 of 12
(3,600 Views)