Object reference from handle

Object reference from handle

Postby Carlos Mora » Tue May 27, 2008 5:04 pm

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.
Carlos Mora
 
Posts: 989
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Re: Object reference from handle

Postby Enrico Maria Giordano » Tue May 27, 2008 6:13 pm

Try

Code: Select all  Expand view
oCtl = oWndFromhWnd( hWnd )


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Carlos Mora » Wed May 28, 2008 9:59 am

Thank you, i'll try.

Regards,

Carlos.
Carlos Mora
 
Posts: 989
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 70 guests