Claes
Fri Dec 19 06:58:57 CST 2003
It depends. If you process the message yourself you (probably)
don't want to call the base class
In your case the base class will paint over the stuff that you
just painted.
For WM_NCPAINT you should also set m.Result = IntPtr.Zero
/claes
"Saurabh" <saurabh@nagpurcity.net> wrote in message
news:%23BTic8XxDHA.2528@TK2MSFTNGP10.phx.gbl...
> I handled WM_NCPAINT and painted an additional button in the title bar. I
> called the base.WndProc at the end of the function and it doesn't work, my
> button just flickers for a moment and the title bar becomes blank again. I
> moved the call to the base class implementation as first line of the
> function and it all seems to work fine.
>
> Should the call to base class be at the beginning or end of the function?
>
> --Saurabh
>
> "Jacek" <infodata@acn.waw.pl> wrote in message
> news:%23uvpiYUxDHA.540@tk2msftngp13.phx.gbl...
> > And as a result you will end up controling every event in your form and
> will
> > be forced to reimplement almost every behaviuor.
> >
> > You should pass all unporcessed messages to base.WndProc(ref m) for
> further
> > processing at the end of function call.
> >
> > Jacek
> >
> > Uzytkownik "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> napisal
w
> > wiadomosci news:brpcmr$60p2b$1@ID-208219.news.uni-berlin.de...
> > > * Gerhard Menzl <gerhard.menzl@spambucket.net> scripsit:
> > > >>> In win32 this is not problem, but how can I add a message handler
> > > >>> for a user defined windows message to a .NET form???
> > > >
> > > >> Add this to your form:
> > > >
> > > >> \\\
> > > >
> > > >> Protected Overrides Sub WndProc(ByRef m As
> > System.Windows.Forms.Message)
> > > >> If m.Msg = ... Then
> > > >> ...
> > > >> End If
> > > >> End Sub
> > > >> ///
> > > >>
> > > >
> > > > Hm, I doubt his C# compiler will like this code ...
> > >
> > > Siimply override the form's 'WndProc'...
> > >
> > > ;-)
> > >
> > > --
> > > Herfried K. Wagner [MVP]
> > > <
http://www.mvps.org/dotnet>
> >
> >
>
>