I have a DLL that monitors global events and when it finds the correct event I want to send a message to the C# app. So far the DLL appears to be monitoring fine but when I try to send a message to the C# app it never makes it. When I load the DLL in C# I pass it the handle to the C# window. Then in the DLL I send a message like so:
SendMessage(g_hAppHandle,WM_COPYDATA,(WPARAM) somedata,(LPARAM) somedata);
Then in the C# app I register a message filter that monitors for 0x004A (WM_COPYDATA). But even though the message is sent my C# app never receives it. It appears that I have implemented the C# message filter correctly because I can see a bunch of messages going through it, but no WM_COPYDATA message.
Does anybody have any idea why the C# app wouldn’t see the message, and how to fix it? Thanks in advance.