Normally the Alt key opens the menu in Windows.
I need this to be disabled, because I need Alt key for my application. (It is an emulator of old computer, so I need to mimic its behaviour.) I write it in pure Windows API, so I expect there must be some message which is sent and needs to be disabled, discarded or ignored.
Alt+Tab is no problem, as well as other system keys and key combinations, I just need to ignore Alt when it opens the menu.
(My application uses DirectInput to read the keys, so it works well. I just need to disable the functionality which opens the menu with Alt key. I will open the menu using mouse.)
How about checking for
WM_SYSCOMMAND, and when wParam isSC_KEYMENU, return 0?Update / exact solution:
Description: If
lParam>>16is positive then menu is activated by mouse, when it is zero or negative then menu is activated by Alt or Alt+something.