I am working on special Artificial Intelligence program that interfaces with other programs. In order to do so, I need the program to control the mouse, which can easily be done with setcursorpos() and the other cursor functions. However, i do not know how to make the program left click and right click on other windows as you would normally with a mouse. If anyone knows how to perform this action with Win API or even with C++, please drop the message.