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. RegisterHotKey Ctrl+Alt+F1

RegisterHotKey Ctrl+Alt+F1

Scheduled Pinned Locked Moved C / C++ / MFC
question
6 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.
  • A Offline
    A Offline
    Andy H
    wrote on last edited by
    #1

    I want to use the hotkey combination of CTRL+ALT+F1, ...F2, ...F3 but although in my application I register these hotkeys thus: ... ::OnInitDialog() ... RegisterHotKey( GetSafeHwnd(), ID_HELP_CONTENTS, MOD_CONTROL | MOD_ALT, VK_F1 ); ... I deregister the hotkeys in the destructor as well. and I am capturing the message WM_HOTKEY these hotkeys do not work! I have registered other hotkeys just fine, and even if I change the above to capture say CTRL+ALT+B that works fine. Do I need to capture the key combination CTRL+ALT+F1 in a different way?

    N 1 Reply Last reply
    0
    • A Andy H

      I want to use the hotkey combination of CTRL+ALT+F1, ...F2, ...F3 but although in my application I register these hotkeys thus: ... ::OnInitDialog() ... RegisterHotKey( GetSafeHwnd(), ID_HELP_CONTENTS, MOD_CONTROL | MOD_ALT, VK_F1 ); ... I deregister the hotkeys in the destructor as well. and I am capturing the message WM_HOTKEY these hotkeys do not work! I have registered other hotkeys just fine, and even if I change the above to capture say CTRL+ALT+B that works fine. Do I need to capture the key combination CTRL+ALT+F1 in a different way?

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #2

      Andy H wrote:

      I am capturing the message WM_HOTKEY these hotkeys do not work! I have registered other hotkeys just fine, and even if I change the above to capture say CTRL+ALT+B that works fine. Do I need to capture the key combination CTRL+ALT+F1 in a different way?

      What does GetLastError say? Or use @err,hr in the debugger and debug through to find out what happens when you call RegisterHotKey. On my machine on pressing Ctrl + Alt + F1 it pops up windows help dialog.


      Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com

      A 2 Replies Last reply
      0
      • N Nibu babu thomas

        Andy H wrote:

        I am capturing the message WM_HOTKEY these hotkeys do not work! I have registered other hotkeys just fine, and even if I change the above to capture say CTRL+ALT+B that works fine. Do I need to capture the key combination CTRL+ALT+F1 in a different way?

        What does GetLastError say? Or use @err,hr in the debugger and debug through to find out what happens when you call RegisterHotKey. On my machine on pressing Ctrl + Alt + F1 it pops up windows help dialog.


        Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com

        A Offline
        A Offline
        Andy H
        wrote on last edited by
        #3

        Thanks. I GetLastError() returns 1409 which equates to "Hot key is already registered".

        1 Reply Last reply
        0
        • N Nibu babu thomas

          Andy H wrote:

          I am capturing the message WM_HOTKEY these hotkeys do not work! I have registered other hotkeys just fine, and even if I change the above to capture say CTRL+ALT+B that works fine. Do I need to capture the key combination CTRL+ALT+F1 in a different way?

          What does GetLastError say? Or use @err,hr in the debugger and debug through to find out what happens when you call RegisterHotKey. On my machine on pressing Ctrl + Alt + F1 it pops up windows help dialog.


          Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com

          A Offline
          A Offline
          Andy H
          wrote on last edited by
          #4

          Is it possible to hook into an existing hotkey combination, without having to go down to the WinMain?

          N 1 Reply Last reply
          0
          • A Andy H

            Is it possible to hook into an existing hotkey combination, without having to go down to the WinMain?

            N Offline
            N Offline
            Nibu babu thomas
            wrote on last edited by
            #5

            Andy H wrote:

            Is it possible to hook into an existing hotkey combination

            This[^] should help. Second question is yours. Let me tell you that it's quite annoying to override an existing hotkey, imagine somebody doing the to your hotkey, be polite and choose another one. :)

            Andy H wrote:

            without having to go down to the WinMain

            I didn't get you. :~


            Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com

            A 1 Reply Last reply
            0
            • N Nibu babu thomas

              Andy H wrote:

              Is it possible to hook into an existing hotkey combination

              This[^] should help. Second question is yours. Let me tell you that it's quite annoying to override an existing hotkey, imagine somebody doing the to your hotkey, be polite and choose another one. :)

              Andy H wrote:

              without having to go down to the WinMain

              I didn't get you. :~


              Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com

              A Offline
              A Offline
              Andy H
              wrote on last edited by
              #6

              I totally agree. I have suggested that some different hotkeys are used. Thanks for the advice.

              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