LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Is the handle of a window generated in CVI same as by windows API functions

Is the handle of a window generated in labwindows/CVI same as by windows API functions? I have an application that needs a window handle generated from a windows API functions. IF not, is there anyway to do so under labwindows/cvi.

Thanks
0 Kudos
Message 1 of 4
(4,577 Views)
No, it's not the same, but you can get the hWnd of a CVI panel very easily with:

GetPanelAttribute (panelHandle, ATTR_SYSTEM_WINDOW_HANDLE, &hWnd);

where panelHandle is the CVI panel handle and hWnd is the window handle used by the windows API functions.

Best Regards,

Chris Matthews
National Instruments
Message 2 of 4
(4,577 Views)
Thanks Chris..but can u make it clearer for me in the sense that i have to define what type of variable hWnd?
IS it a
int hWnd
and use in my application function as typed casted into (HWND)

or

HWND hWnd
and type cast it to (int*) hWnd for the above GetPanelAttribute function?

Thanks a lot and Merry Christmas
0 Kudos
Message 3 of 4
(4,579 Views)

In this example:
GetPanelAttribute (panelHandle, ATTR_SYSTEM_WINDOW_HANDLE, &hWnd);

"hWnd" is the variable name, and it's of type the CVI type "HWND".

So, when you set up your variable to pass into the function above you'll want to set it up as:
HWND hWnd = NULL;

Not sure why you need the hWnd value as an int*, but as per the windows API, the hWnd values passed around are all of type HWND.

0 Kudos
Message 4 of 4
(4,329 Views)