Hi Bob,
Chris has given some idea on this issue, and I'd like to expand the
solution.
In Win32, we often handle the messages in wndproc , Now in WinForm the
WndProc still exists, every class derived from Control class have a
protected method named WndProc, you can override this method to handle your
own message of that control. Here is some snippet to show how to do this.
<code>
protected override void WndProc(ref Message m)
{
const int WM_USER = 0x0400;
If(m.Msg == WM_USER)
{
//call your handler here.
}
base.WndProc(ref m);
}
</code>
Also if you need to handle the message before it is dispatched, you may
implement the IMessageFilter interface to do this job, You can add a
MessageFilter to the MessageLoop by the Application.AddMessageFilter
method, to get more information on and sample code on this topic you may
take a look at the this link:
<Application.AddMessageFilter Method>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemwindowsformsapplicationclassaddmessagefiltertopic.asp
Does this answer your problem?
Please be free to reply to this group, if you have anything unclear on it.
Thanks!
Best regards,
Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties and confers no rights.
You should not reply this mail directly, "Online" should be removed before
sending, Thanks!