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