[lazarus] wndproc

Samuel Liddicott sam at campbellsci.co.uk
Mon Aug 16 12:49:49 EDT 1999


Are wndprocs are completely out of favour in lazarus?

I see the gtkcallback uses dispatch directly; also it seems many of the
callbacks do not pass back the result of the dispatched message to gtk.

Is this right?

I think the callbacks should not call Dispatch, but WndProc.

It is TControl.WndProc (first object where wndproc is declared (virtual, not
override) that calls dispatch for all messages that have made it thus far
(usually unhandled messages, not always - I'm not sure if dispatch will pass
on messages that have been handled).

WndProc acts like a pre-dispatch interceptor, and DefaultHandler acts like a
post-dispatch interceptor.

In delphi the DefaultHandler calls the window-controls own default wndproc.

Broadcasts are sent to the wndproc of controls - also VERY useful for
messages unknown at design time - RegisterWindowMessage et al.

So; I'm suggesting that instead of calling Dispatch, gtkcallback calls the
wndproc. (Maybe if it is a TControl descendand - otherwise (for csCanvas etc
call dispatch)?

Is this OK?  If so I will make the changes to include in the diff's I will
send up.

Sam






More information about the Lazarus mailing list