LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding the hwnd of a listbox

I am using a Call Library Function Node to start another program. I have a listbox on the front panel and I need to find the hwnd that corresponds to the listbox in order to send debug messages from the other program to LabVIEW. I would appreciate any help I can get. Thanks.
0 Kudos
Message 1 of 7
(4,082 Views)
See the post here about hwnd's of LabVIEW controls. Can you modify the DLL? Instead of using messaging, you can use the LabVIEW ActiveX method Set Control Value.
0 Kudos
Message 2 of 7
(4,079 Views)
If you know window programming, you can create a listbox, a true window object, on the front panel at run time, then
you get the "hWnd" in return.

George Zou
http://gtoolbox.yeah.net
George Zou
0 Kudos
Message 3 of 7
(4,082 Views)
George,

Shouldn't this created object (listbox) be updated when the window receives
a WM_PAINT message?

Normally, aren't controls updated between the BeginPaint and EndPaint
calls,when handling the WM_PAINT message?

I think I saw some programs from your hand, that draw graphics (GDI) on the
front panel of a vi. When I did this, the graphics would disapear when the
front panel gets redawn. How did you get around this?

Regards,

Wiebe.

"zou" wrote in message
news:5065000000050000002AD80000-1042324653000@exchange.ni.com...
> If you know window programming, you can create a listbox, a true
> window object, on the front panel at run time, then
> you get the "hWnd" in return.
>
> George Zou
> http://gtoolbox.yeah.net
0 Kudos
Message 4 of 7
(4,081 Views)
If the listbox is a true window object, then you don't
have to worry about paint event. Unless you want to do
some fancy "owner draw".

Use BeginPaint/EndPaint only in window procedure when
you create your own window, while Listbox is window pre-
defined class.

In my VIs, there are 2 different types: those create an
child window,and those draw directly on the front panel.

If one draw something on an exist window, such as a
front panel, then he has to catch the redraw event of
that window, and paint again. Otherwise, graphics
"disappear".

George Zou
http://gtoolbox.yeah.net
George Zou
0 Kudos
Message 5 of 7
(4,081 Views)
Thanks.

I tried to get the window handler of an activex container, like Greg
McKaskle described in the link Dennis Knutson send. This works fine! Have
you ever tried to subclass a activex component by filtering messages?

Regards,

Wiebe.


"zou" wrote in message
news:50650000000500000078D80000-1042324653000@exchange.ni.com...
> If the listbox is a true window object, then you don't
> have to worry about paint event. Unless you want to do
> some fancy "owner draw".
>
> Use BeginPaint/EndPaint only in window procedure when
> you create your own window, while Listbox is window pre-
> defined class.
>
> In my VIs, there are 2 different types: those create an
> child window,and those draw directly on the front panel.
>
> If o
ne draw something on an exist window, such as a
> front panel, then he has to catch the redraw event of
> that window, and paint again. Otherwise, graphics
> "disappear".
>
> George Zou
> http://gtoolbox.yeah.net
0 Kudos
Message 6 of 7
(4,082 Views)

Dennis's old Exchange link above (that Wiebe "just" referred to) is now dead.  Here's the updated link to Greg's discussion.

Message Edited by LabBEAN on 12-29-2009 11:55 AM

Certified LabVIEW Architect
TestScript: Free Python/LabVIEW Connector

One global to rule them all,
One double-click to find them,
One interface to bring them all
and in the panel bind them.
0 Kudos
Message 7 of 7
(3,486 Views)