05-02-2013 07:49 AM - edited 05-02-2013 07:50 AM
I'm doing some testing with Parent/Child window functions in Windows. At this point I'm just trying to see what I can do and see I can perform some basic window manipulations using it, and then I may make it into a more official tool. One of the things I'm trying to do is move a child window within a parent window. This works just fine using the MoveWindow User32.dll call, the one thing I notice however is that when I set it to go to X=0 and Y=0 it will go into the upper left corner of the parent window, but it will be on top of the Menubar, and Toolbar of LabVIEW if one is being shown.
I believe this is because as far as Windows is conserned this is the upper left corner of the window. What I would like to do is not allow to move the window this far, and I would like to have some kind of offset so you can't move the window this far if the Toolbar or Menubar is being shown in the VI. The toolbar is no big deal because it should be a constant size (right now I find 24px works), but the menubar can vary based on the font used, and may even be operating system dependent. So is there a way to know the size in pixels of the menubar? Or alternativly is there some other way to know where the 0,0 location is within LabVIEW.
Attatched is a quick example that shows what I'm talking about. It will insert Notepad into the VI at 0,0 but this will be on top of the toolbar and menubar. Is there a way to know the size of the menu bar, so I can have an offset so 0,0 will be below these UI items?
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
Solved! Go to Solution.
05-02-2013 09:29 AM - edited 05-02-2013 09:30 AM
If vi scripting is acceptable, you could obtain the Total Bounds Rect Property of your pane and use the "Top" value.
05-02-2013 09:41 AM
@.aCe. wrote:
If vi scripting is acceptable, you could obtain the Total Bounds Rect Property of your pane and use the "Top" value.
Scripting is always acceptable, but in this case it was the wrong method. Total Bounds Rect returned the 4 points on the front panel, so if you scrolled to the right the values would change. Master Bounds on the panel was what I wanted and the "Top" will be 0 if menu and toolbars are hidden, and will be 46 if both are on which is the height of both those UI items in my test case. Thanks.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord