FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Object reference from handle
Posts: 989
Joined: Thu Nov 24, 2005 03:01 PM
Object reference from handle
Posted: Tue May 27, 2008 05: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.

Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Object reference from handle
Posted: Tue May 27, 2008 06:13 PM
Try

oCtl = oWndFromhWnd( hWnd )


EMG
Posts: 989
Joined: Thu Nov 24, 2005 03:01 PM
Object reference from handle
Posted: Wed May 28, 2008 09:59 AM

Thank you, i'll try.

Regards,

Carlos.

Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"

Continue the discussion