Detecting foreign window messages

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

Hello

How can I write a C# Windows Forms application so that it tells if it
receives foreign windows messages.

Foreign, say something like when another application takes its HWND and
issues a WM_APP+123 for example.
 
Elias,

Well, you have to have a definition of what is foreign. Once you have
that, you can implement the IMessageFilter interface and then in the
PreFilterMessage, act on windows messages that are foreign to your app.

You would then pass this implementation to the AddMessageFilter method
on the Application class.
 

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