So far from c++ I found how to move the mouse to position x and y and to right and left click. I cannot seem to figure out how to click on something and then type from c++ . If I had a word document up I want to be able to click it, open it and type something into it. Thanks in advance !
#include <windows.h>
#include <iostream>
#include <ctime>
using namespace std;
int main ()
{
SetCursorPos(97,758);
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); // Left click
Sleep( 1000 );
SetCursorPos(418,657);
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
SetCursorPos(266,34);
Sleep( 1000 );
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
//right here is where I would like to type something to the document
}