I want windows to send message to my programme when a specific key combination is pressed even when my window is minimized or not shown (i.e) minimized to systray or it is pressed while some other application was active
I want windows to send message to my programme when a specific key combination is pressed even when my window is minimized or not shown (i.e) minimized to systray or it is pressed while some other application was active
RegisterHotKey(). Beware that your hot key may already be in use. You can let the user choose a hot key with a hot key control(HOTKEY_CLASS).
http://msdn.microsoft.com/library/de...sterHotKey.asp
BOOL RegisterHotKey(HWND hWnd,
int id,
UINT fsModifiers,
UINT vk
);
Example:
RegisterHotKey(m_hWnd, ID_EXIT,
MOD_ALT | MOD_SHIFT, VK_F1);
This will generate a WM_HOTKEY meessage when alt+shift+f1 is pressed. wParam will contain the ID.