[lazarus] wndproc.....

Marc Weustink weus at quicknet.nl
Wed Nov 3 17:20:08 EST 1999


At 08:12 03-11-99 -0600, you wrote:
>Can someone help me.
>
>I have set up a TControl wndproc and a TWINCONTROL wndproc and a
TCustomForm wndproc.
>How should I call it?  I planned on doing this in the gtkcallback.inc file
inside the callback code
>
>IF (data is TCustomForm) then
>   TCustomForm(data).wndproc(MEssage)
>else
>...
>...
>etc.

Nope something like:

if data is TControl then TControl(data).WndProc(Message);

WndProc is virtual so the appropriate WndProc is called automagically.

>but I can't because wndproc is protected.  Is this the correct method of
doing this?  Should I have a public property that I can use to call the
highest classes wndproc?  Do I have to setup the WINDOWCLASS and use it's
lpfnwndproc to call it?

I don't think you can use lpfnwndproc since it is just a procedural pointer
and no method pointer.

I also looked after DefaultHandler but this one is called after dispatch so
you can use it.

maybe yo can use the public 
function TControl.Perform 
in combination with 
property TControl.WindowProc: TWndMethod

perform just calls WindowProc(Message) 

Marc






More information about the Lazarus mailing list