[lazarus] Win32

Jeff Wormsley daworm at cdc.net
Fri Mar 23 10:38:58 EST 2001


On 03/22/2001 at 4:43 PM Gregory Kingsley wrote:

>Ok cool. I've spent the last couple hours brushing up on the win32 API and
>GDI etc..... this is gonna be a cool challenge :-}

When I last looked at it (oh so long ago), I basically started by taking the GTK implementation and using it as a shell, then replacing GTK specific stuff with Win32 stuff.  The biggest hurdle I faced was the mapping of LCL messages into Windows messages (LM_ to WM_) and vice versa.  That, and creating the Win32 window handler to accept the windows messages and pass them to the generic translation routine and then to the correct control.  Windows "objects" can have data tagged to them, so when a control created a new window, I would tag the LCL owner to the object, and thus when my message handler received a message, it could extract the owner back via the window handle.

Looking back on it, I feel that there really must have been a better way.  It was so complex I never really got it working, beyond showing a form with some labels and a button.  All of that nastiness should still be in there, but you might want to ignore it and see if you can come up with a better mechanism, rather than try to expand what may have been a wrong decision on my part.  If you do want to try to use some of it, send me email and I may get a chance this weekend to help deciher what I was doing.

Jeff.









More information about the Lazarus mailing list