IMessageFilter.PreFilterMessage Method

  • Thread starter Thread starter Tyler
  • Start date Start date
T

Tyler

Does the IMessageFilter.PreFilterMessage Method
preprocess every message dispatched in an application?
For some reason when I try to preprocess the WM_SETFOCUS
message, the method never fires. All the other messages
are preprocessed just fine. Why is WM_SETFOCUS different?
 
Hi Tyler,
I'm afraid this is by design, for better performance, when the 'TAB'
pressed, the default window procedure will try to find the next control and
send the WM_SETFOCUS directly to the control using SendMessage. Since the
WM_SETFOCUS didn't apprear on the Message queue, you can't get it in your
MesageFilter. You may try verify this by post an WM_FOCUS message manually.
You may try handling this message on the Enter/Leave event of a certain
control.
Does this answer your question?
If you still have problems on this issue, please let me know.
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!

--------------------
| Content-Class: urn:content-classes:message
| From: "Tyler" <[email protected]>
| Sender: "Tyler" <[email protected]>
| Subject: IMessageFilter.PreFilterMessage Method
| Date: Wed, 1 Oct 2003 13:23:01 -0700
| Lines: 5
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcOIWc+1zbImxP12RWujFCmnBtixTg==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:53538
| NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| Does the IMessageFilter.PreFilterMessage Method
| preprocess every message dispatched in an application?
| For some reason when I try to preprocess the WM_SETFOCUS
| message, the method never fires. All the other messages
| are preprocessed just fine. Why is WM_SETFOCUS different?
|
 
Back
Top