Application.AddmessageFilter

  • Thread starter Thread starter P. Meyer
  • Start date Start date
P

P. Meyer

Hi
I want to reroute messages with a certain code to a specific control.

I need to intercept those messages at Application level since the main
window doesn't catch a third party ActiveX. It is done correctly with my
IMessageFilter.

From there I would like to create (and SendMessage) a new message with same
parameters except the Handler. The problem I have is to get the main window
handler from inside IMessageFilter process.

Any short example would be very appreciated!

Philippe (C# student)
 
Philippe,

You should be able to change the HWnd property of the structure to the
handle of the window you want to route the messages to. Since the
PreFilterMessage method takes the structure by ref, any changes you make to
it will stick after the method exits.
 
Thanks Nicholas.
Did not try yet but it's helpful.
Philippe


"Nicholas Paldino [.NET/C# MVP]" <[email protected]> a écrit
dans le message de (e-mail address removed)...
Philippe,

You should be able to change the HWnd property of the structure to the
handle of the window you want to route the messages to. Since the
PreFilterMessage method takes the structure by ref, any changes you make
to it will stick after the method exits.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

P. Meyer said:
Hi
I want to reroute messages with a certain code to a specific control.

I need to intercept those messages at Application level since the main
window doesn't catch a third party ActiveX. It is done correctly with
my IMessageFilter.

From there I would like to create (and SendMessage) a new message with
same parameters except the Handler. The problem I have is to get the main
window handler from inside IMessageFilter process.

Any short example would be very appreciated!

Philippe (C# student)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top