AutoHotkey

Run, "notepad.exe"
WinWaitActive, ahk_class Notepad
Send, Hello World{!}