CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2008
    Posts
    12

    Simulate a press of the cntrl key

    What would be the easiest way to simulate pressing the control key in C++?
    (make it press the button for you instead of having to manually press it on the keyboard)

  2. #2
    Join Date
    Oct 2005
    Location
    Minnesota, U.S.A.
    Posts
    680

    Re: Simulate a press of the cntrl key

    C++ or WinAPI?

    C++, it would depend on the platform.

    WinAPI, just send the WM_KEYDOWN message and fake out the app.

    -Erik

  3. #3
    Join Date
    May 2005
    Posts
    4,954

    Re: Simulate a press of the cntrl key

    Quote Originally Posted by tofurocks View Post
    What would be the easiest way to simulate pressing the control key in C++?
    (make it press the button for you instead of having to manually press it on the keyboard)
    Look at this FAQ.

    Cheers
    If a post helped you dont forget to "Rate This Post"

    My Article: Capturing Windows Regardless of Their Z-Order

    Cheers

  4. #4
    Join Date
    Nov 2008
    Posts
    12

    Re: Simulate a press of the cntrl key

    OMG thanks so much guys im making my friend an app and this will complete it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured