Well, this is the big list of virtual key codes.
CTRL-S is going to be sent through as 2 WM_KEYDOWN
messages - a message when the ctrl key is pressed (VK_LCONTROL
or VK_RCONTROL
) followed by a 0x53
for the "S" key.
Rather than processing both messages, wait for the key down message for the 'S' press then call GetKeyState using the magic value VK_CONTROL (otheriwse you'd need to test individually for the left AND right control keys) to see if the S was pressed with CTRL held down.
--
Obviously, keyboard messages are sent directly to the window that has focus. To get accelerator combinations to work at the application scope you need to check the messages before dispatching them to the focus window - i.e. in your message pump. See the documentation for TranslateAccelerator.
If you want to handle system wide keypresses, the other answer points to the hot key api.