How to create auto clicker+typer in C++ ?

Okay so what I want to do is :-
Create a program that can, say for example, switch to an already opened up google search page.
Type in a given string and press enter.

Once more.
The google search page is open.[Type anything on google.com and then THAT next page is the one ..]
**So , the search box ,where you enter text has fixed coordinates..
(Which website doesnt matter, only coordinates do!)

I want the mouse to go to those coordinates, *click* and now a cursor will appear on the search box.
After this I want to send a fixed string output...That is , it should actually type in the string in that search box.
then press enter.

That's it .
[P.S. - obviously I don't want to do this with google, that was just an example.]

Mini Algorithm-
1)Get the mouse pointer to the x-y coords
2)Click!
3)Type in the fixed string.
4)Enter..

I can put it in a loop, don't bother with the easy bits
I need to know how to control the mouse, and how to send the input string.
Code snippets would be perfect

Thank you !
I need to know how to control the mouse
Emulate mouse messages: http://stackoverflow.com/questions/7492529/how-to-simulate-a-mouse-movement
how to send the input string.
Emulate keypresses: http://msdn.microsoft.com/en-us/library/ms171548.aspx
Or work with copy-paste buffer and simulate Ctrl+V
Last edited on
Topic archived. No new replies allowed.