Jim Kring Posted July 27, 2007 Report Share Posted July 27, 2007 I need to obtain the window size and coordinates of the project explorer window associated with a project reference. Has anyone done this or have any ideas how? I've looked at all the properties and methods of the project and I cannot find any clues as to how to do this. Thanks, -Jim Update: I've figured out how to achieve this using WinAPI calls to USER32.DLL's windowing functions, based on the expected name of the project explorer window (taking into consideration that the window title might have a trailing "*" if the project has unsaved changes). However, I'd still love to find a cross-platform solution. Quote Link to comment
crelf Posted July 27, 2007 Report Share Posted July 27, 2007 QUOTE(Jim Kring @ Jul 27 2007, 04:10 AM) I need to obtain the window size and coordinates of the project explorer window associated with a project reference. I don't think that's exposed - you're going to have to use USER32.DLL and get a hWnd to the window using it's title. Warning: don't for get the "<SP>*" if your project elements are unsaved. I've got a VI that does this - let me know if you want it, and I'll try to dig it up. QUOTE(Jim Kring @ Jul 27 2007, 04:10 AM) Update: I've figured out how to achieve this using WinAPI calls to USER32.DLL's windowing functions, based on the expected name of the project explorer window (taking into consideration that the window title might have a trailing "*" if the project has unsaved changes). Quote Link to comment
Jim Kring Posted July 27, 2007 Author Report Share Posted July 27, 2007 Great minds think alike Quote Link to comment
crelf Posted July 27, 2007 Report Share Posted July 27, 2007 QUOTE(Jim Kring @ Jul 27 2007, 04:38 AM) Great minds think alike I was just thinking that... Quote Link to comment
MikaelH Posted July 28, 2007 Report Share Posted July 28, 2007 Hi Chris and Jim Ofcasue you can get that information... But it's a bit messy ;-) Here's the code: http://forums.lavag.org/index.php?act=attach&type=post&id=6468 http://forums.lavag.org/index.php?act=attach&type=post&id=6469 Cheers, Mikael Quote Link to comment
Jim Kring Posted July 28, 2007 Author Report Share Posted July 28, 2007 Hi Mike, Thanks for the posting. That's a clever way to do it. (Note that your solution is not platform independent due to its reliance on LabVIEW.ini file which is a windows only construct. However, there are some VIs in vi.lib for platform independent access to LabVIEW's config settings.) Here's my solution, which only works on MS Windows (since it calls USER32.DLL). http://forums.lavag.org/index.php?act=attach&type=post&id=6472 http://forums.lavag.org/index.php?act=attach&type=post&id=6471 Cheers, -Jim Quote Link to comment
Michael Aivaliotis Posted July 28, 2007 Report Share Posted July 28, 2007 QUOTE(MikaelH @ Jul 26 2007, 06:04 PM) Of course you can get that information...But it's a bit messy ;-) I guess I could check but a bit lazy right now. Does this info get updated real-time with every window adjustment or only when LV shuts down? Quote Link to comment
Jim Kring Posted July 28, 2007 Author Report Share Posted July 28, 2007 QUOTE(Michael_Aivaliotis @ Jul 26 2007, 11:03 PM) I guess I could check but a bit lazy right now. Does this info get updated real-time with every window adjustment or only when LV shuts down? From looking at Mikael's code, it appears that LabVIEW writes the last project window bounds to LabVIEW's configuration file every time a project window is closed. 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.