Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 1999-11

wndproc.....

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Shane Miller

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.

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?

Idea's?

Shane

Reply by email

Marc Weustink
to Shane Miller
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

Show quoted text 7 lines
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

Reply by email