CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    26

    Send command to running app?

    How do I etc send a command to a running application?
    Say I have "cmd" open, how do I make a function from my application to send etc: "cd .." to the cmd console?

    Or a running game. I've gotten it to work but not the way I wanted it. The way I managed to do it, it starts the .exe file that its suppose to send the command to, on new... so there's two running windows...

    Anyone has tips or solution for this?

  2. #2
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    1,901

    Re: Send command to running app?

    CD .. should be able to be sent using the "SendKeys" command

    (it will send the specified keystrokes to whichever application is in focus)

    If your running app is stoped at a data entry point then sendkeys will also send the keystrokes to the input field in focus (so long as the app is in focus)

  3. #3
    Join Date
    May 2005
    Location
    Sunny Adelaide
    Posts
    66

    Re: Send command to running app?

    You could also try the keybd_event, or the newer SendInput() API's.
    You are here.

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