How Can I Bring the Front Panel in Front of All Desktop Windows?

Updated Jun 15, 2018

Reported In

Software

  • LabVIEW Professional
  • LabVIEW Base
  • LabVIEW Full

Operating System

  • Windows

Issue Details

I want to set my Front Panel window in front of all desktop windows. The Front Panel property IsFrontmost, which is showed in the image below, sets the Front Panel only in front of all LabVIEW windows. How can I bring the Front Panel in front of all desktop windows?

Solution

If you use the functions GetForegroundWindow and SetForegroundWindow in the User32.dlllocated in C:\WINDOWS\system32, the Front Panel is set in front of all desktop windows. 

The GetForegroundWindow function returns a handle to the foreground window (the window with which the user is currently working). The SetForegroundWindow function puts the thread that created the specified window into the foreground and activates the window.

The attached example moves the front panel to the front of all desktop windows after 5 seconds.

Additional Information

Note: The snippet and VI attached are currently not compatible with Windows 10.

WAS THIS ARTICLE HELPFUL?

Not Helpful