Fake User Program
I want to be able to make a program that emulates what a human at a computer can do. IE: I want to be able to read the visual information of a window (a 2d array of colour would be perfect) and be able to send virtual key syms and mouse movements to the window. Is this at all possible, and if so how is it done?
Related Article: problems with dll files.
is a C++ discussion thread by ananDE that has 5 replies and was last updated 7 months ago.
Labdabeta
Practically a Master Poster
615 posts since Feb 2011
Reputation Points: 27
Solved Threads: 31
Skill Endorsements: 1
Ancient Dragon
Achieved Level 70
32,157 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,577
Skill Endorsements: 69
I looked through that, and it seemed to have what I was looking for in terms of reading the info of the window (I can get its coordinates on the screen then use getPixel on the area?) but it had nothing on how to send fake input to a window. Perhaps the broken link contained the info?
Labdabeta
Practically a Master Poster
615 posts since Feb 2011
Reputation Points: 27
Solved Threads: 31
Skill Endorsements: 1
Ancient Dragon
Achieved Level 70
32,157 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,577
Skill Endorsements: 69
That is great for keyboard input... but what about mouse... I have clarified in my mind what I want a little more now. I want the following self explanatory functions:
WINDOW_HANDLE_TYPE getWindowBasedOnTitle(const char *title);
COLOUR_TYPE **getWindowOutput(WINDOW_HANDLE_TYPE wnd);
void sendKeySym(char key, WINDOW_HANDLE_TYPE wnd);
void setMouseXY(int x, int y, WINDOW_HANDLE_TYPE wnd);
void simClick(bool left, WINDOW_HANDLE_TYPE wnd);
Labdabeta
Practically a Master Poster
615 posts since Feb 2011
Reputation Points: 27
Solved Threads: 31
Skill Endorsements: 1
Ancient Dragon
Achieved Level 70
32,157 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,577
Skill Endorsements: 69
You may also want to have a look at AutoIt
It might save you the trouble of re-inventing the wheel if you dont need the gritty details.
L7Sqr
Practically a Posting Shark
851 posts since Feb 2011
Reputation Points: 253
Solved Threads: 155
Skill Endorsements: 7
Ok, I read the links and I understand how to identify a window and how to copy the output of its device context. What I still do not understand is how to send virtual keysyms/mouse clicks/mouse movements?
Labdabeta
Practically a Master Poster
615 posts since Feb 2011
Reputation Points: 27
Solved Threads: 31
Skill Endorsements: 1
Ancient Dragon
Achieved Level 70
32,157 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,577
Skill Endorsements: 69
Labdabeta
Practically a Master Poster
615 posts since Feb 2011
Reputation Points: 27
Solved Threads: 31
Skill Endorsements: 1
Question Answered as of 8 Months Ago by
Ancient Dragon
and
L7Sqr