LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Forcing LV Dialog boxes to the Top Z order

I need to force a Labview Dialog box to the top Z order. THe Dialog pops above the application window but not over any other
windows. (such as windows explorer)
Do I need to create a custom Dialog, or is there a short cut.

Any help is much appreciated.

Martin
0 Kudos
Message 1 of 2
(3,313 Views)


Hello Martin,

You can achieve this by calling the SetWindowsPos Windows function (found in User32.dll) from LabVIEW. Lookup this function in Win32 SDK (or MSDN) for details. Basically your dll-node in LabVIEW would look like this:

long SetWindowPos(unsigned long hwnd, long hWndInsertAfter, long X, long Y, long cx, long cy, unsigned long uFlags);

The first argument hwnd is the handle to the window you want to affect. This can be obtained by calling the FindWindowA, again from User32.dll. Its function prototype in LabVIEW would look like:

unsigned long FindWindowA(long class, CStr title);

Where you pass a 0 to class and the title of the window/vi to 'title.'

Back to SetWindowsPos: Passing 1 to hWndInsertAfter will mak
e the window topmost. X, Y, cx, and cy can all be zeros. The uFlags have to be an OR of SWP_NOSIZE (0x1) and SWP_NOMOVE (0x2) because you probably don't want to resize or move the window. There are other flags you can OR into this. See the windows header file WINUSER.H for these.

I am attaching a bare-bones 7.0 VI which demos this. Hope this gives you some ideas.

Regards,

Khalid
0 Kudos
Message 2 of 2
(3,313 Views)