YAY! I got it to work, I was stupid for not realising FindWindow doesn't find child windows.
Working code below.
Code:#include <windows.h> main() { HWND Notepad; Notepad = FindWindow("Notepad",NULL); HWND NotepadChild; NotepadChild = FindWindowEx(Notepad, NULL, "Edit", NULL); SendMessage(NotepadChild, WM_KEYDOWN, VkKeyScan('c'), 0); SendMessage(NotepadChild, WM_CHAR, VkKeyScan('c'), 0); SendMessage(NotepadChild, WM_KEYUP, VkKeyScan('c'), 0); /* HWND Notepad; Notepad = FindWindow("Notepad",NULL); SetForegroundWindow(Notepad); keybd_event(VkKeyScan('C'), 1, 0, 0); keybd_event(VkKeyScan('C'), 1, KEYEVENTF_KEYUP, 0); */ }




Reply With Quote