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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. disabling alt+space

disabling alt+space

Scheduled Pinned Locked Moved C / C++ / MFC
question
8 Posts 4 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.
  • L Offline
    L Offline
    learningvisualc
    wrote on last edited by
    #1

    Hi all, i want to disable alt + space in my program. How can i do it? Thanks in advance.

    R E 2 Replies Last reply
    0
    • L learningvisualc

      Hi all, i want to disable alt + space in my program. How can i do it? Thanks in advance.

      R Offline
      R Offline
      Rajesh R Subramanian
      wrote on last edited by
      #2

      Add a handler for that key combination and do nothing there.

      It was ever thus, the Neophiles will always rush out and get 'The Latest Thing' at a high price and with all the inherent faults - Dalek Dave.

      P 1 Reply Last reply
      0
      • R Rajesh R Subramanian

        Add a handler for that key combination and do nothing there.

        It was ever thus, the Neophiles will always rush out and get 'The Latest Thing' at a high price and with all the inherent faults - Dalek Dave.

        P Offline
        P Offline
        pasztorpisti
        wrote on last edited by
        #3

        Handle the WM_SYSKEYDOWN message and simply return 0 for wParam==VK_SPACE. WM_SYSKEYDOWN is received instead of WM_KEYDOWN always when the alt is held down, (or when the F10 is pressed). If the alt+Space handling is in your accelerator table then you have to put special handling code to your message loop that drops this WM_SYSKEYDOWN msg before calling TranslateMessage() or DispatchMessage() or something else.

        1 Reply Last reply
        0
        • L learningvisualc

          Hi all, i want to disable alt + space in my program. How can i do it? Thanks in advance.

          E Offline
          E Offline
          Emilio Garavaglia
          wrote on last edited by
          #4

          Is the problem just alt-space or does it relate to the entire system menu (even when accessed by the mouse?) In the first case, just discard the WM_SYSKYDOWN for "space", (but the sysmenu can be invocate by other keywords or by the mouse) In the second case, make your window without the WS_SYSMENU style.

          2 bugs found. > recompile ... 65534 bugs found. :doh:

          P 1 Reply Last reply
          0
          • E Emilio Garavaglia

            Is the problem just alt-space or does it relate to the entire system menu (even when accessed by the mouse?) In the first case, just discard the WM_SYSKYDOWN for "space", (but the sysmenu can be invocate by other keywords or by the mouse) In the second case, make your window without the WS_SYSMENU style.

            2 bugs found. > recompile ... 65534 bugs found. :doh:

            P Offline
            P Offline
            pasztorpisti
            wrote on last edited by
            #5

            If you just want to disable the system menu by pressing keys (but you want to allow it by mouse clicks) then the best solution is to return zero from WM_SYSCOMMAND when wParam==SC_KEYMENU. This disables the system menu for ALT+SPACE, ALT+ALT_RELEASE+DOWN, F10+F10_RELEASE+DOWN, and should disable for all other combinations too.

            R 1 Reply Last reply
            0
            • P pasztorpisti

              If you just want to disable the system menu by pressing keys (but you want to allow it by mouse clicks) then the best solution is to return zero from WM_SYSCOMMAND when wParam==SC_KEYMENU. This disables the system menu for ALT+SPACE, ALT+ALT_RELEASE+DOWN, F10+F10_RELEASE+DOWN, and should disable for all other combinations too.

              R Offline
              R Offline
              Rajesh R Subramanian
              wrote on last edited by
              #6

              It might actually be useful to the OP if you respond to him instead of everyone replying to him.

              It was ever thus, the Neophiles will always rush out and get 'The Latest Thing' at a high price and with all the inherent faults - Dalek Dave.

              P 1 Reply Last reply
              0
              • R Rajesh R Subramanian

                It might actually be useful to the OP if you respond to him instead of everyone replying to him.

                It was ever thus, the Neophiles will always rush out and get 'The Latest Thing' at a high price and with all the inherent faults - Dalek Dave.

                P Offline
                P Offline
                pasztorpisti
                wrote on last edited by
                #7

                What OP stands for? I replied to the previous message because my reply was in relation with that.

                E 1 Reply Last reply
                0
                • P pasztorpisti

                  What OP stands for? I replied to the previous message because my reply was in relation with that.

                  E Offline
                  E Offline
                  Emilio Garavaglia
                  wrote on last edited by
                  #8

                  OP = Original Poster. Your answer adds information to my answer respect to what the OP wanted, but it is not itself a response to me since it is not me having the problem. But -if you answer to me- the system will notify myself, and the OP (that wants to know the solution) will never know until he will visit this page randomly later (may even be never, if he already solved somehow the problem).

                  2 bugs found. > recompile ... 65534 bugs found. :doh:

                  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