Page 1 of 1

Object reference from handle

Posted: Tue May 27, 2008 5:04 pm
by Carlos Mora
I'm looking the way to get a reference to a control's object, given the hWnd (handle) of the control.

In clipper it can be done using GetProp( hWnd, 'WP' ) that gives the index into aWindows array.
An aScan can be done in aDialog:aControls looking for control's ID, but it is slow and is a little bit complex if there are Folders, Pages and other multidialog controls, and aControls is not allways available if oParent is not a Dialog/Window.

Any sugestion is welcome.

Regars,

Carlos.

Re: Object reference from handle

Posted: Tue May 27, 2008 6:13 pm
by Enrico Maria Giordano
Try

Code: Select all

oCtl = oWndFromhWnd( hWnd )
EMG

Posted: Wed May 28, 2008 9:59 am
by Carlos Mora
Thank you, i'll try.

Regards,

Carlos.