global hotkey: i dont get the WM_HOTKEY message
-
I have a volume control prog. downloaded and written the necessary hotkey code lines based on Beginner's Tutorial - Using global hotkeys http://www.codeproject.com/system/nishhotkeys01.asp into it. The hotkey succesfully registers. RegisterHotKey(this->m_hWnd, myatom, MOD_CONTROL, VK_UP) on querying this line I get a true in the header: public: ... LRESULT OnHotKey(WPARAM wParam, LPARAM lParam); ... DECLARE_MESSAGE_MAP() in the correspondig cpp file: BEGIN_MESSAGE_MAP(CVolumeControlDemoDlg, CDialog) //{{AFX_MSG_MAP(CVolumeControlDemoDlg) ... // some more messages ON_MESSAGE(WM_HOTKEY,OnHotKey) //}}AFX_MSG_MAP END_MESSAGE_MAP() and also in the cpp file: LRESULT CVolumeControlDemoDlg::OnHotKey(WPARAM wParam, LPARAM lParam) { if(wParam == MOD_CONTROL && lParam == VK_UP) { log.write("!!! HOTKEY PRESSED SUCCESS !!!"); } return 0; } on pressing the hotkey while the prog is running -> NOTHING happens. But if I call the following line in the code I get the WM_HOTKEY message correctly: SendMessage(WM_HOTKEY, MOD_CONTROL, VK_UP); What am I doing wrong? Plz in very easy language since I am a programming N00b. TY