Re: Messages...

From: David Reeve (dree4456_at_big-pond.net.au)
Date: 07/23/04


Date: Fri, 23 Jul 2004 01:06:38 GMT


<nobody@noplace.not> wrote in message
news:go00g0h7ml49jdtkute8l4798tn48o39g9@4ax.com...
[snip]

> >So, eventually, DefWindowProc will get called.
>
> JEEEES... and I thought my standard dispatcher was complicated...
>
>
[snip.... more of Laura's love of API]

Delphi's message loop in TApplication.Run isn't that different to what you
have. What delphi does, and I like alot, is to provide a system for mapping
a chain of windows procedures to your object and it's ancestral line. 99% of
the time all you want to do is have your object respond to a user message of
your own making and swallow it. This really is made contract-free and
trivial using a message handler declared in the class def. If however, you
want to intercept an existing message, then you have the possibility of
subclassing by a simple override of TControl.Wndproc. You can dynamically
swap between windows procedures (why would you want to do that??) by simply
changing the TControl.WindowProc property. However, as far as intercepting
mouse clicks and the like for a custom component, it is even easier to
override the various click methods exposed by TControl.

Dave



Relevant Pages

  • RE: Deleting rows from DataGrid
    ... you want to intercept into the "delete" key ... and do prompt for the user. ... To achieve this, you should inherit from the datagrid class, then override ...
    (microsoft.public.dotnet.framework.windowsforms.databinding)
  • Re: 508 compliant (i.e. accessible to the people with disabilities)?
    ... intercept the page's output html content and do our custom ... protected override void Render ... Control level, make our custom control wrapper (derived from the ... existing web control classes) and override the render method so as to ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: An simple class derived from CDialog
    ... Should I override the WndProc in my CDialogBaseRedBackground and ... intercept WM_PAINT message? ...
    (microsoft.public.vc.mfc)
  • Re: An simple class derived from CDialog
    ... intercept WM_PAINT message? ... I there any way to do that using the MESSAGE MAP? ... or I would override PreCreateWindow() to set the background ... brush to be a red color. ...
    (microsoft.public.vc.mfc)
  • Re: Intercepting Ctrl+C in a datagrid
    ... Howabout to override WndProc() of datagrid? ... protected override void WndProc ... > How can I intercept Ctrl+C to stop this? ...
    (microsoft.public.dotnet.framework.windowsforms)

Loading