Set a hook to intercept WM_COMMAND sent from a menu
Posted on 2004-10-14
I have an ActiveX DLL which is loaded by an application (MSN Messenger) in the same thread. I want the DLL to know when the button "Send File" in the application is pressed.
Using Spy++, I've found that it generates this message when the button is pressed:
000C044A P WM_COMMAND wNotifyCode:0 (sent from a menu) wID:40275 [wParam:00009D53 lParam:00000000]
How can I intercept that message from the DLL?
I've tried WH_MSGFILTER and WH_GETMESSAGE hooks but they do not seem to fire when the button is pressed. Any ideas?