I'm trying to prevent a WM_APPCOMMND message from reaching the active window.
Using SetWindowsHookEX with WH_CALLWNDPROC I'm able to SEE the message, but I can't remove or modify the message. Using another hook with WH_GETMESSAGE, I can't see the WM_AppCommand Message. Using SPY++, the AppCommand message (0x319) shows up as Unknown. Does that matter?
Since the AppCommand keys I'm blocking all are related to explorer, if I don't have explorer as my active widow, I'm able to block them - I use a hook with WH_SHELL. If the ncode I intercept HSHELL_APPCOMMAND, I just don't call the next hook and the button press is ignored.
However if Explorer is active, it catches the message first. How do I block the message if the only time I can see the message is in context that I can't modify.
(Or how do I see the message with WH_GETMESSAGE -(and then what do I do to keep it from reaching the window?)
I even tried remove the focus from explorer when I caugh an AppCommand with WH_CALLWNDPROC - It works for every key press after the intial one, but the first message is still handled.