[lazarus] More Native Win32 stuff(Pascal,canyouhelphere?)

Shane Miller SMiller1 at stvgb.org
Tue Aug 10 17:24:23 EDT 1999


During the LM_CREATE, you have the SENDER, so you could also create a TLISt (if it's still nil) then ADD an object (sender) and the handle returned from the CreateWindowEx.  However, you may receive the handle AFTER the WM_CREATE is passed.

Look at TCreateParams in Delphi.  What is the Param property?  Could that be used?

>>> "Michael A. Hess" <mhess at miraclec.com> 08/10 3:47 PM >>>
Shane Miller wrote:
> 
> Here is a basic map of how it's done:
> 
> We call gtkint.pp and send it a "message" or "command" LM_CREATE.
> gtkint.pp says 'Hey, I received a LM_CREATE so they want me to create
> something!" (That's the English version of gtkint.pp talking of
> course)
> 
> gtkint then checks the SELF parameter (as a tcontrol) and check's it's
> compstyle and says "Hey, it's a compstyle is csFORM so I'll create a
> FORM!'.  (gtkint.pp is very excitable, that's why it talks that way.)
> 
> So, now in order to detect when someone clicks on the form, TControl
> (for TForm) calls SetCAllBack(LM_CLICKED) and that's passed onto
> gtkint.pp.

All of this is easy to do and he won't have any problems doing what is
indicated above. However .....

> GtKINT.PP get's it's SetCallBack called with a SELF and a LM_CLICKED
> so it sets a callback procedure up to be called when a clicked event
> occurs.  In that callback, it uses the SELF to call
> DISPATCH(LM_CLICKED).

this is the problem. At present I don't see an easy way to get the value
Self back to the callback. The other issue is that ALL messages for a
given window (which in windows means buttons, scrollbars, just about
everything) goes through only ONE callback for that control. So the
callback must determine which message it is getting and then tranlate
the message to an LM_XXX message and call Dispatch. However since Self
isn't readily available something tricky needs to take place to
determine which "Self" the passed HWND represents. The only really,
really nice thing about this is that ALL and I mean ALL of the messages
from ALL of the controls will go through just ONE callback routine. It
will make that part of the win32int a whole lot cleaner and smaller than
the GTK version.

That is assuming we can figure out a clean and easy way to get the
"Self" value to the callback.


-- 
==== Programming my first best destiny! ====

Michael A. Hess      Miracle Concepts, Inc.
mhess at miraclec.com   http://www.miraclec.com 

_________________________________________________________________
     To unsubscribe: mail lazarus-request at miraclec.com with
                "unsubscribe" as the Subject
    archives at http://www.miraclec.com/list_archives/lazarus






More information about the Lazarus mailing list