Jump to content

Controlling the Context Help Window


Recommended Posts

I know I can programmatically show and hide the Context Help Window and even set its position, but can I access a reference to be able to set other properties? I'd like to be able to set and lock the window's size and maybe even change its status (modal, floating, etc).

Link to comment

I know that I'm getting away from LabVIEW, but I was hoping to benefit from the expertise of the list - surely someone here has tried to do this before...

Using USER32.DLL I've been able to change the window's mode to non-floating and position it where I want it on the screen, but I've had limited sucess with the size of the window. Using MoveWindow, I'm using the following prototype:

long MoveWindow(unsigned long hWnd, long Left, long Top, long Width, long Height, unsigned long Flags);

Sure enough, it moves the window and it even sets the width correctly, but the hieght doesn't respond to anything I set it to (it actually just draws the bottom of the window off-screen).

Any ideas?

Link to comment
I know that I'm getting away from LabVIEW, but I was hoping to benefit from the expertise of the list - surely someone here has tried to do this before...

Using USER32.DLL I've been able to change the window's mode to non-floating and position it where I want it on the screen, but I've had limited sucess with the size of the window. Using MoveWindow, I'm using the following prototype:

long MoveWindow(unsigned long hWnd, long Left, long Top, long Width, long Height, unsigned long Flags);

Sure enough, it moves the window and it even sets the width correctly, but the hieght doesn't respond to anything I set it to (it actually just draws the bottom of the window off-screen).

Any ideas?

LabVIEW has its own window manager building on the native window handling API of every respective platform. Most probably LabVIEW does maintain its own size attributes and also does some specific clipping on its own to increase performance or work around certain difficulties on some platforms.

A lot of those manager functions are actually exported by LabVIEW (with the prefix W) but totally undocumented.

For instance

void WMove(Wind h, int32 h, int32 v);

moves a window around and

void WSize(Wind w, Rect *bounds);

sizes it. The type Rect is documented in the extcode.h file.

The difficulty is that the parameter Wind h is a specific LabVIEW datatype and does only indirectly correspond to the underlying platform datatype such as the HWND on Windows.

LabVIEW seems to store this Wind handle at the 0 offset of the additional window specific data in the Windows window handle so doing:

typedef void *Wind;

Wind h = (Wind)GetWindowLong(hwnd, 0);

should work in all Windows versions I have seen, but of course this is highly under the hood, undocumented and suspect to changes at any new LabVIEW version.

Rolf Kalbermatter

Link to comment
typedef void *Wind;

Wind h = (Wind)GetWindowLong(hwnd, 0);

should work in all Windows versions I have seen, but of course this is highly under the hood, undocumented and suspect to changes at any new LabVIEW version.

Thanks for your help Rolf :thumbup: I'll check it out!

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