Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. global hotkey: i dont get the WM_HOTKEY message

global hotkey: i dont get the WM_HOTKEY message

Scheduled Pinned Locked Moved C / C++ / MFC
c++comtutorialquestionlearning
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 1343677
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups