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. ALT code

ALT code

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

    hi all, i wanted to simulate pressing ALT by keybd_event() but i dont know the code , or if it is a virtual key. does any1 know code or virtual_key value? thnx

    D 1 Reply Last reply
    0
    • V V_shr

      hi all, i wanted to simulate pressing ALT by keybd_event() but i dont know the code , or if it is a virtual key. does any1 know code or virtual_key value? thnx

      D Offline
      D Offline
      dtr1
      wrote on last edited by
      #2

      WM_SYSKEYDOWN.If u use it in PreTranslateMessage: BOOL CTest::PreTranslateMessage(MSG* pMsg) { if (pMsg->message == WM_SYSKEYDOWN && pMsg->wParam == VK_..something..) { // TO DO:.... } return CDialog::PreTranslateMessage(pMsg); }

      V 1 Reply Last reply
      0
      • D dtr1

        WM_SYSKEYDOWN.If u use it in PreTranslateMessage: BOOL CTest::PreTranslateMessage(MSG* pMsg) { if (pMsg->message == WM_SYSKEYDOWN && pMsg->wParam == VK_..something..) { // TO DO:.... } return CDialog::PreTranslateMessage(pMsg); }

        V Offline
        V Offline
        V_shr
        wrote on last edited by
        #3

        lol,i wanted the something in "VK_something" , my question's answer is : the alt code is (for example) VK_ALT ! or something like that , i know how to get other keys like VK_Shift , but there is nothing about ALT key in my book :(

        D 1 Reply Last reply
        0
        • V V_shr

          lol,i wanted the something in "VK_something" , my question's answer is : the alt code is (for example) VK_ALT ! or something like that , i know how to get other keys like VK_Shift , but there is nothing about ALT key in my book :(

          D Offline
          D Offline
          dtr1
          wrote on last edited by
          #4

          I answered WM_SYSKEYDOWN if you use it in PreTranslateMessage, not VK_something. But you want to simulate. -- modified at 6:43 Saturday 10th November, 2007

          V 1 Reply Last reply
          0
          • D dtr1

            I answered WM_SYSKEYDOWN if you use it in PreTranslateMessage, not VK_something. But you want to simulate. -- modified at 6:43 Saturday 10th November, 2007

            V Offline
            V Offline
            V_shr
            wrote on last edited by
            #5

            i want to press the alt not to check if it is pressed or not . :D thnx , V_shr

            D 2 Replies Last reply
            0
            • V V_shr

              i want to press the alt not to check if it is pressed or not . :D thnx , V_shr

              D Offline
              D Offline
              dtr1
              wrote on last edited by
              #6

              use this: keybd_event(VK_MENU,0xb8,0,0);

              1 Reply Last reply
              0
              • V V_shr

                i want to press the alt not to check if it is pressed or not . :D thnx , V_shr

                D Offline
                D Offline
                dtr1
                wrote on last edited by
                #7

                Don't forget to release the ALT key with : keybd_event(VK_MENU,0xb8,KEYEVENTF_KEYUP,0);

                V 1 Reply Last reply
                0
                • D dtr1

                  Don't forget to release the ALT key with : keybd_event(VK_MENU,0xb8,KEYEVENTF_KEYUP,0);

                  V Offline
                  V Offline
                  V_shr
                  wrote on last edited by
                  #8

                  thanks a LOT :D

                  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