Hooks for VK_APPS

yateesh
yateesh used Ask the Experts™
on
Hi All..

I have a dialog with many controls. I need to block pop-up menu due to key press from keyboard.(VK_APPS).
 
If i have the focus on some control and if i press the windows menu key, I investigated(using Spy ++) that the dialog directly doesnt receive this command.

The dialog receives WM_COMMAND from control(eg.ComboBox) which had focus. This way Iam not able to get the hook. I tried using GetMsgProc and GetKeyBoardProc but i was not able to block the menu from poping up.

please help me in this matter.

-Yateesh
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
IT Professional
Top Expert 2005
Commented:
>>if i press the windows menu key, I investigated(using Spy ++) that the dialog directly doesnt receive this command.

When the context menu key (the right windows key) is pressed, a WM_CONTEXTMENU message is sent to the window independently of the keyboard event. This is the reason why it doesn't work to trap the key alone.

However You can trap and ignore WM_CONTEXTMENU using a 'Message Hook' .

-MAHESH

Author

Commented:
Thanks a lot....
Mahesh

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial