[lazarus] CreateComponent

Jeff Wormsley daworm at cdc.net
Mon Aug 16 20:51:47 EDT 1999


On 8/16/99, at 5:25 PM, Samuel Liddicott wrote: 

>Is a FHandle supposed to be equivalent to a FComponent ?
>
>I mean it seems like under GTK FComponent is the reference to the "real"
>control, under windows FHandle is the "real" control - do we have one that
>applies to both?

I have been using FComponent as the Hwnd to the WindowsAPI functions, since that seemed the closest equivalent to what GTK was doing.  I don't remember right off hand, but is FHandle visible to a TWinControl, or is it private to TControl?  We do need to work out a clear method of handling the window handle, owner and parent for this.  What I have done so far has been to put the window handle in FComponent, and store self in the HWnd structure with SetProp.  But this still leaves the question of Parent open.  I was planning to use self to find the parent HWnd, then GetProp on that HWnd to find the parent's self, but haben't had time to work on that.  The thing that keeps tripping me up is the diferences between handling LM_xxx messages recieved via SendMessage and handling WM_Messages recieved in the WindoProc.  LM_xxx messages get a pointer to the LCL object, which has the HWnd stored in FComponent.  WM_xxx messages get the HWnd, which has the pointer to the LCL object in the propertiy available from GetProp.  I think with that information, everything that needs to be done in either case can be determined, but whether this is the best method or not I do not know.  Any ideas would be appreciated, as I plan to get back into it tonight.  I haven't had time in the last few days.

Jeff.







More information about the Lazarus mailing list