LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

why GetPanelAttribute(m_iPanel, ATTR_SYSTEM_WINDOW_HANDLE, &hWnd) does not work?

hello, I load a panel via:

step1: m_iPanel = LoadPanelEx (iParentPanel, "uirfile.uir", P, __CVIUserHInst);

then I obtain the windows handle of the panel (m_iPanel) via:

step2: GetPanelAttribute(m_iPanel, ATTR_SYSTEM_WINDOW_HANDLE, &hWnd);

notice: if the first parameter (iParentPanel) in step1 is 0, step2 success, otherwise the hWnd always be 0.

is this a bug of CVI or should I do something else?

thanks advance!

 

 

 

 

 

 

0 Kudos
Message 1 of 3
(3,107 Views)

This is actual expected behaviour of the function. As is said in the help for ATTR_SYSTEM_WINDOW_HANDLE attribute:

Description:  A number that can be cast to obtain the system-specific window handle for a top-level panel.
    The actual type of the value is HWND. 
    The value is zero for child panels.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(3,102 Views)
Thanks! Since I need a hWnd for a child panel, I would put parent panel parameter for loading a child always 0 even it is not. It looks work...
0 Kudos
Message 3 of 3
(3,084 Views)