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. WM_HOTKEY how to notice a global hotkey release (keyup)?

WM_HOTKEY how to notice a global hotkey release (keyup)?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestionannouncement
3 Posts 2 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

    on pressing the global hotkey for some time ... I get a lot of WM_HOTKEY messages. But how to notice the release of the hotkey button? WM_KEYUP Notification (according to msdn) is posted to window with KEYBOARD FOCUS. but since i have a global hotkey i won't necessarily have keyboard focus. any suggestions?

    A 1 Reply Last reply
    0
    • U User 1343677

      on pressing the global hotkey for some time ... I get a lot of WM_HOTKEY messages. But how to notice the release of the hotkey button? WM_KEYUP Notification (according to msdn) is posted to window with KEYBOARD FOCUS. but since i have a global hotkey i won't necessarily have keyboard focus. any suggestions?

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      Maybe you can have some sort of variable saying that you are processing the hotkey currently, if you are then return from that message eg. ON_WM_HOTKEY() { static bool processing = false; if (processing) return; processing = true; // do some work; processing = false; }

      U 1 Reply Last reply
      0
      • A Anonymous

        Maybe you can have some sort of variable saying that you are processing the hotkey currently, if you are then return from that message eg. ON_WM_HOTKEY() { static bool processing = false; if (processing) return; processing = true; // do some work; processing = false; }

        U Offline
        U Offline
        User 1343677
        wrote on last edited by
        #3

        ty but doesnt work; since on release i dont get a WM_HOTKEY message and after releasing i wont get in the mentioned function (ON_WM_HOTKEY)

        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