[lazarus] More Native Win32 stuff(Pascal,canyouhelphere?)
Michael A. Hess
mhess at miraclec.com
Tue Aug 10 17:59:44 EDT 1999
Marc Weustink wrote:
>
> You can pass extra info to a Windows window. This way you could store
> the "self" value when you create it. When you receive a Windows
> message you can retrieve the "self" value for this HWND. Look at
> GetProp, SetProc (user32.lib, windows.h) etc.
Oh, excellent news!!!
I had hoped this was possible but I didn't dig around in the API enough
to see if this was possible.
Again great news thanks.
Did you get this Jeff??
When you call the CreateWindow routine you will need to pass the "Self"
parameter to it. This will get stored as extra information int he HWND
structure itself. (I'm not exactly sure how to do this yet just from the
above message that it can be done.)
Now you will also need to create the callback procedure. Now I don't
know if Delphi creates a separate callback (WindProc) for every
component or not. I would assume it would and it would be just a
procedure that is a method of the class object in Delphi. Now we could
have done something like this as well but then this would have tied the
LCL to a API. We don't want to do that. So you will need to create just
the one callback in the win32int.pp unit. This is the callback that
every control you create will use. Now since you are attaching the
"Self" information into the HWND information you are all set.
In the callback which gets passed the HWND pointer you will retrieve the
LCL Self pointer. Then you just need to case the WM_MESSAGE and
translate it into the LM_MESSAGE. Finally you will call the Dispatch
method with the correct data.
Man I have to go get something to eat.
Let me know if you need some more explaination. :-)
--
==== Programming my first best destiny! ====
Michael A. Hess Miracle Concepts, Inc.
mhess at miraclec.com http://www.miraclec.com
More information about the Lazarus
mailing list