See also: http://thesiteformerlyknownas.zachtronicsindustries.com/note... with http://thesiteformerlyknownas.zachtronicsindustries.com/imag... linked in the comments.
I had a lot of fun writing a few small games with this method, don't think I ever shared them anywhere though.
Here are the key bits:
char* c = "Hello World!";
HWND hwnd = FindWindow("Notepad", NULL);
HWND edit = FindWindowEx(hwnd, NULL, "Edit", NULL);
SendMessage(edit, WM_SETTEXT, NULL, (LPARAM)c);