[VB6] - how catch the hwnd from a form with usercontrol(for 1 test)
i have these line:
Code:
UserControl.ParentControls(0).hwnd
but the vb6 tell me that don't support\have that property\method...
how can i catch the hwnd property from a form control?(i'm trying do 1 little test)
Re: [VB6] - how catch the hwnd from a form with usercontrol(for 1 test)
All usercontrols have a ContainerHwnd. You can get that, then in a loop use GetParent API until it returns zero. The last hWnd that API returned should be the main-level window.
Also not sure when that line of code is run. If it is run before the control is "sited", it very well may not be supported. I'd wait for the Show event to fire if possible.
Re: [VB6] - how catch the hwnd from a form with usercontrol(for 1 test)
Quote:
Originally Posted by
LaVolpe
All usercontrols have a ContainerHwnd. You can get that, then in a loop use GetParent API until it returns zero. The last hWnd that API returned should be the main-level window.
Also not sure when that line of code is run. If it is run before the control is "sited", it very well may not be supported. I'd wait for the Show event to fire if possible.
thanks for that... i will try it