No subject

Tue Dec 7 07:52:45 EST 2004

When a program is started the application object gets created and and the
initialize routing is called on the interface object. Here is where we tell
the engine to create a engine instance. From then on the lcl will pass a
message to the IntSendMessage routine telling the widget engine to do
various things depending on what was passed. For instance the routine may
get a message to create a form in that case lcl_win32_create_widget gets
called and it internally creates a form. It will pass back a integer value
"we'll call it the hwnd" which is the index of the component in the list.
Inside of the interface object we set the LCL TComponent handle with that
returned value because that is what we are going to use to access the
instance. Now in the library you will need to do something like
lcl_win32_reparent_widget(hwndparent, hwndchild: integer) and that will
inturn set the parent of the child to the parent. Then you add something
like lcl_win32_set_bounds(hwndwidget: integer;x,y,top,left: integer)  so
internal you just grab that widget from the list and set the properties.
Then you need to add a event hook I think I coded the stub into it but did
not finish it. Something like lcl_win32_hook_mouse_move(hwndwidget: integer;
fproc: pointer) You then assign a handler internal which will call this fpc
method pointer. I know this sounds like a lot of stuff but it is pretty
simple to implement.


-----Original Message-----
From: vital at <vital at>
To: Cliff Baeseman <vbman at>
Date: Monday, May 01, 2000 5:16 PM
Subject: Re: Finally I get the code to you

>I just took a look to the code. I got a good idea of what has to be done.
>In order to get the the Dll compiled, I have needed to change the Ancestor
>class of TWidgetEngine to TWinControl. This is because
>TForm(lWidget.widget).Parent need at least a TWinControl. Like this:
>  TWidgetEngine = class(TWinControl)
>I think, we could also initially set the Parent wiget to Nil and it wouldnt
>matter. That will enable us to use A TObject as the TWidgetEngine ancestor
>Also I believe that the TWidgetEngine.Create miss an inherited sentence.
>Would be like this:
>constructor TWidgetEngine.Create;
>  Inherited;
>  FWidgetStack := TWidgetStack.Create;
>The Dll compile but I was unable to compile the test program. I get a
>   Can't write ppu-file
>Sound promissing though!
>What is not clear for me right now is about the main winproc. If the main
>applicaton (The Lazarus host) has is own WinProc how could we execting of
>creating a TApplication not to make interferance. As you should know an
>instance of TApplicaton is always create in a Delphi DLL. We just need to
>assign his Handle of the Application in order to make it to  get it hooked
>to the host Applicaton. That would mean:
>   procedure lcl_win32_initialize(AppHandle : THandle); stdcall; export;
>   begin
>      Application.Handle := AppHandle; // Application already create by
>      engine := TWidgetEngine.Create(nil);
>   end;
>What I would need to know then is what wiget need to be done first and what
>event need to be hooked.

More information about the Lazarus mailing list