Antoine Chalons Posted July 8, 2009 Report Share Posted July 8, 2009 Hi, I have a few front panels which are top level VIs (tasks running in parallel) and I'd like to be able to manage their position, not (X,Y) position on the monitor, but which FP "first/second/third/etc" on top. I know I can bring a specific FP window on top, but I also would like to be able to bring a FP window "from top to bottom", can this be done in LV VI Server or do we have to use some "SetWindow..." from the user32.dll ? Thanks in advance for any help Quote Link to comment
gleichman Posted July 8, 2009 Report Share Posted July 8, 2009 (edited) You can set the z-order by calling SetWindowPos in User32.dll. There is an example on NI devzone. Although the example sets the z-order to the top, it is easily changed for setting a window to any level. Edited July 8, 2009 by gleichman Quote Link to comment
Antoine Chalons Posted July 8, 2009 Author Report Share Posted July 8, 2009 You can set the z-order by calling SetWindowPos in User32.dll. Thanks, technically this is does exactly what I need.. I was just hopping we could do the same using VI Server in order to be more cross-platform :-o Quote Link to comment
gleichman Posted July 8, 2009 Report Share Posted July 8, 2009 Thanks, technically this is does exactly what I need.. I was just hopping we could do the same using VI Server in order to be more cross-platform :-o It looks like it should work, but it can only set the window to the top (or bottom?). I did a little more reading after posting at msdn and it does not set z-order as simply as I expected after looking at the NI example. You could loop through your windows in reverse order setting each one to the top to get your desired order, but that might be ugly. Quote Link to comment
Antoine Chalons Posted July 8, 2009 Author Report Share Posted July 8, 2009 It looks like it should work, but it can only set the window to the top (or bottom?). I did a little more reading after posting at msdn and it does not set z-order as simply as I expected after looking at the NI example. You could loop through your windows in reverse order setting each one to the top to get your desired order, but that might be ugly. Well.. yes.. fortunately I have only 2 FP windows to manage at the same time (I have alot in fact but only 2 are displayed at the same time and I need to be able to choose which one is on top), so when the "secondary" FP window comes to top (over the main window), it first get the hWnd of the foreground window so that it can set back the main window to foreground when it has to go back to "second layer". It just bugs me that it's not cross-platform Quote Link to comment
Yair Posted July 8, 2009 Report Share Posted July 8, 2009 The FP.Is Frontmost property might be able to help you, but will mean that you have to cycle through the different FPs, which will probably be visible to the user as it happens. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.