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. Tool for automation

Tool for automation

Scheduled Pinned Locked Moved C / C++ / MFC
javascripttoolstutorialc++com
3 Posts 3 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.
  • U Offline
    U Offline
    User 1619799
    wrote on last edited by
    #1

    Hello all,

    I need a little help: I want to create an application that automatize different applications in the sense that my application will be able to press automatically different buttons on another application.

    For example: my application will start, let's say, Microsoft Office, will press some buttons in MSOffice, and will close MSOffice.

    Could you give me an idea how to do that ? I have no clue... some code in C/C++ would be perfect.

    Thank you very much!

    <script src="//www.codeproject.com:8011/bar17428.js" type="text/javascript" ></script>

    L A 2 Replies Last reply
    0
    • U User 1619799

      Hello all,

      I need a little help: I want to create an application that automatize different applications in the sense that my application will be able to press automatically different buttons on another application.

      For example: my application will start, let's say, Microsoft Office, will press some buttons in MSOffice, and will close MSOffice.

      Could you give me an idea how to do that ? I have no clue... some code in C/C++ would be perfect.

      Thank you very much!

      <script src="//www.codeproject.com:8011/bar17428.js" type="text/javascript" ></script>

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

      Member 1621323 wrote:

      I need a little help

      Actually, I suspect you need quite a lot. An application such as you describe is not as simple as you may think. Take a look at some of the links at https://www.google.com/search?q=sendkeys+c%2B%2B[^].

      1 Reply Last reply
      0
      • U User 1619799

        Hello all,

        I need a little help: I want to create an application that automatize different applications in the sense that my application will be able to press automatically different buttons on another application.

        For example: my application will start, let's say, Microsoft Office, will press some buttons in MSOffice, and will close MSOffice.

        Could you give me an idea how to do that ? I have no clue... some code in C/C++ would be perfect.

        Thank you very much!

        <script src="//www.codeproject.com:8011/bar17428.js" type="text/javascript" ></script>

        A Offline
        A Offline
        Albert Holguin
        wrote on last edited by
        #3

        In addition to sending the exact keys directly as Richard described (I think that method is basically replicating what a keyboard would do if I'm not mistaken), there is another way of achieving this. Sending messages to the application's control directly. Windows allows this and it's relatively easy to get the controls' ID's to send messages to them. Use Spy++[^] to get control IDs and you can also intercept some messages to figure out how yours should be formatted. Once you have control IDs, you can send messages using the SendMessage()[^] method. Biggest problem with this method is that it's more of a hack than anything else. The control IDs are not guaranteed to be the same from one version of the software to the next.

        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