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. PostMessage Problem

PostMessage Problem

Scheduled Pinned Locked Moved C / C++ / MFC
help
9 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.
  • J Offline
    J Offline
    jmkhael
    wrote on last edited by
    #1

    I want to send ALT + S to an application, ive tried: PostMessage ( hHandle , WM_SYSCHAR , 's' , 0 ); What im i doing wrong cos its not working Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;

    L L 2 Replies Last reply
    0
    • J jmkhael

      I want to send ALT + S to an application, ive tried: PostMessage ( hHandle , WM_SYSCHAR , 's' , 0 ); What im i doing wrong cos its not working Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;

      L Offline
      L Offline
      Lakitu
      wrote on last edited by
      #2

      Try passing 0x20000000 as lParam value. According to the docs, that defines the ALT key as being pressed.


      Look! They have the Internet on computers now! (Homer J. Simpson)

      J 1 Reply Last reply
      0
      • L Lakitu

        Try passing 0x20000000 as lParam value. According to the docs, that defines the ALT key as being pressed.


        Look! They have the Internet on computers now! (Homer J. Simpson)

        J Offline
        J Offline
        jmkhael
        wrote on last edited by
        #3

        PostMessage ( hHandle , WM_SYSCHAR , 's' , 0x20000000 ); didnt work? Why? Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;

        1 Reply Last reply
        0
        • J jmkhael

          I want to send ALT + S to an application, ive tried: PostMessage ( hHandle , WM_SYSCHAR , 's' , 0 ); What im i doing wrong cos its not working Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          See SendInput, keybd_event.

          J 1 Reply Last reply
          0
          • L Lost User

            See SendInput, keybd_event.

            J Offline
            J Offline
            jmkhael
            wrote on last edited by
            #5

            yeah ok, but what message to send?? is there a VK_ALT cos i didnt find any Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;

            A 1 Reply Last reply
            0
            • J jmkhael

              yeah ok, but what message to send?? is there a VK_ALT cos i didnt find any Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;

              A Offline
              A Offline
              Andreas Saurwein
              wrote on last edited by
              #6

              Fill out the KEYBDINPUT structure and use .type = INPUT_KEYBOARD or use keybd_event() ...make it about Visual C++, and don't ever mention Visual Basic. Nick Hodapp (MSFT) in Semicolon[^]

              J 1 Reply Last reply
              0
              • A Andreas Saurwein

                Fill out the KEYBDINPUT structure and use .type = INPUT_KEYBOARD or use keybd_event() ...make it about Visual C++, and don't ever mention Visual Basic. Nick Hodapp (MSFT) in Semicolon[^]

                J Offline
                J Offline
                jmkhael
                wrote on last edited by
                #7

                Yes, but please, if i want to state that the keyboard event is the ALT Key, how should i do that? Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;

                A 1 Reply Last reply
                0
                • J jmkhael

                  Yes, but please, if i want to state that the keyboard event is the ALT Key, how should i do that? Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;

                  A Offline
                  A Offline
                  Andreas Saurwein
                  wrote on last edited by
                  #8

                  Should be something like

                  keybd_event( VK_MENU,0,KEYEVENTF_EXTENDEDKEY,0);
                  keybd_event( 's',0,0,0);
                  // 'release' the keys
                  keybd_event( 's',0,KEYEVENTF_KEYUP,0);
                  keybd_event( VK_MENU,0,KEYEVENTF_EXTENDEDKEY|KEYEVENTF_KEYUP,0);

                  ...make it about Visual C++, and don't ever mention Visual Basic. Nick Hodapp (MSFT) in Semicolon[^]

                  J 1 Reply Last reply
                  0
                  • A Andreas Saurwein

                    Should be something like

                    keybd_event( VK_MENU,0,KEYEVENTF_EXTENDEDKEY,0);
                    keybd_event( 's',0,0,0);
                    // 'release' the keys
                    keybd_event( 's',0,KEYEVENTF_KEYUP,0);
                    keybd_event( VK_MENU,0,KEYEVENTF_EXTENDEDKEY|KEYEVENTF_KEYUP,0);

                    ...make it about Visual C++, and don't ever mention Visual Basic. Nick Hodapp (MSFT) in Semicolon[^]

                    J Offline
                    J Offline
                    jmkhael
                    wrote on last edited by
                    #9

                    Thank u very much, long live VC++ :) ! Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;

                    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