Jump to content

How do I obtaining the window size and coordinates of a Project Explorer


Recommended Posts

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. :)

Link to comment

QUOTE(Jim Kring @ Jul 27 2007, 04:10 AM)

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).

:D

Link to comment

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

Link to comment

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.