I have been searching this for a while but didn't get good results.
You know these "macro programs" that let you say, find a pixel on the screen and click on it, search for an image and return its coordinates etc.
Instead of having to use those programs can I code this myself with c++? Say is there a already-built library specifically for this? Or any other interesting stuffs you might have to say that is related?
I don't think SDL is relevant to what OP wants to do. It has no facilities to move the mouse outside its window, let alone find a button on an arbitrary window regardless of the window's position.
OP, there are existing tools designed for automation that are already very complete and have their own programming languages; some of them may even allow you to interface with them with C/++. Why do you want to do this yourself?
@helios that's great, any suggestions? I found two online autohotkey and autoit but I want your suggestion.
helios I wanted to integrate c++ with automation so that I could include GUI with the automation script as well. If I could interface them with c++ then that would be fine.
If there's no other choice I could rely on using a c++ gui program to call the scripts from their directories I guess.