Have you tried making the main VI modal? I believe that this should force it to stay on top.
- From the front panel, right click on the vi's icon in the top right of your screen
- Select VI Properties...
- In the Category drop down box, select Window Appearance
- Click Customize... button
- Change Window Behaviour to Modal.
- Click OK
- Click OK
- Save your VI
If you want to do this programmatically, you will need to download lvwutil32.dll I can never find this on ni's website, but Google will find it in several places for you.
Richard
From Labview Help:
Window Behavior—Sets the behavior of the front panel window. You also can use the Front Panel Window:Behavior property to set the behavior programmatically.
Default—Resets the front panel to its default behavior so it does not behave as a floating or modal window.
Floating—Keeps the front panel on top of all other non-floating LabVIEW windows. Windows and Mac OS If multiple floating windows are open, the last one whose title bar you click appears on top.
Hide when LabVIEW is not active—Configures the front panel so when you switch from LabVIEW to another application or when a modal LabVIEW window appears, the window does not appear.
Note If you place a checkmark in the Allow user to minimize window checkbox, select the Floating option, and place a checkmark in the Hide when LabVIEW is not active checkbox, the front panel window might not behave as expected. For example, on Windows, if you cannot minimize a window, it does not appear in the taskbar. Windows that hide when the application does not have focus also hide their icons in the taskbar. The appearance and disappearance of an item in the taskbar each time the focus changes between LabVIEW and another application can be distracting to the user.
Modal—Keeps the front panel on top of all other LabVIEW windows until you close the window or open another modal window. You cannot interact with other windows while a modal window is open. Most dialog boxes in LabVIEW are modal windows, such as the Options dialog box.