PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms Do I need to call base.WndProc in this scenario?

Reply

Do I need to call base.WndProc in this scenario?

 
Thread Tools Rate Thread
Old 20-07-2007, 11:59 AM   #1
R3al1ty
Guest
 
Posts: n/a
Default Do I need to call base.WndProc in this scenario?


Hi all,

I have been working around the notorious 'Automatically scroll
selected control into view' 'feature' of the .net framework using the
following code. Now I read that if I do not call base.WndProc, this
can cause problems like 'Error creating Window Handle' and I am
getting this error.

My code is as below. How do I modify it to prevent the WM_SETFOCUS
from being handled but still call base.WndProc()? Thanks!

private const int WM_SETFOCUS = 0x0007;
protected override void WndProc(ref Message m)
{
// Listen for operating system messages.
// The WM_SETFOCUS message is sent to a window after it
has gained the keyboard focus.
if (m.Msg != WM_SETFOCUS)
{
base.WndProc(ref m);
}
}

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off