You can try PostMessage()
PostMessage Function()
I did a little demo for Notepad for you.
Code:
#include <windows.h>
#include <iostream>
using namespace std;
HWND hwnd;
HWND child;
int main()
{
hwnd = FindWindow(0,"Untitled - Notepad");
if(!hwnd)
{
return 0;
}
child = FindWindowEx(hwnd,0,"edit",0);
if(!child)
{
return 0;
}
SetForegroundWindow(child);
Sleep(500);
PostMessage(child,WM_KEYDOWN,(WPARAM)VkKeyScan('w'),0);
cin.get();
}
Pretty much just types W into the edit box on NotePad.
FindWindowEx was just to find the child window, in this case it's the giant edit box where you type. I don't think you need to do that for CA though.
Code:
child = FindWindowEx(hwnd,0,"edit",0);
"edit" is the system class. If you were to make a textbox using windows api, the system class would be "edit", if you were making a button, it would be "button" etc etc..
More info here:
CreateWindow Function()