Detecting foreign window messages

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • news.microsoft.com

    #1

    Detecting foreign window messages

    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


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Detecting foreign window messages

    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
    PreFilterMessag e, act on windows messages that are foreign to your app.

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


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "news.microsoft .com" <lallous@lgwm.o rgwrote in message
    news:Opf8YKo2HH A.3916@TK2MSFTN GP02.phx.gbl...
    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
    >

    Comment

    Working...