Well, this one is a great list of virtual key codes.
CTRL-S will be sent after 2 WM_KEYDOWN messages - a message when the ctrl key is pressed ( VK_LCONTROL or VK_RCONTROL ), followed by 0x53 for the "S" key.
Instead of processing both messages, wait for the "S" key to be pressed, press " GetKeyState using the magic value VK_CONTROL (you will need to check the other for the left and right control keys individually) to see if the S key was pressed while holding the CTRL key .
-
Obviously, keyboard messages are sent directly to the focus window. To get accelerator combinations to work in the application area, you need to check the messages before sending them to the focus window - that is, in your message pump. See the documentation for TranslateAccelerator .
If you want to handle system keystrokes, another answer points to the api hotkey.
Chris becke
source share