Dim Const $WM_CHAR = 0x102
Run('notepad.exe')
Opt('WinTitleMatchMode', 4)
WinWait("[CLASS:Notepad]", '', 10)
$hNote = WinGetHandle("[CLASS:Notepad]")
Opt('WinTitleMatchMode', 1)
$hEdit = ControlGetHandle($hNote, '', 'Edit1')
_WinAPI_PostMessage($hEdit, $WM_CHAR, Asc("w"), 0)
_WinAPI_PostMessage($hEdit, $WM_CHAR, Asc("w"), 0)
_WinAPI_PostMessage($hEdit, $WM_CHAR, Asc("w"), 0)
_WinAPI_PostMessage($hEdit, $WM_CHAR, Asc("."), 0)
_WinAPI_PostMessage($hEdit, $WM_CHAR, Asc("b"), 0)
_WinAPI_PostMessage($hEdit, $WM_CHAR, Asc("a"), 0)
_WinAPI_PostMessage($hEdit, $WM_CHAR, Asc("i"), 0)
_WinAPI_PostMessage($hEdit, $WM_CHAR, Asc("d"), 0)
_WinAPI_PostMessage($hEdit, $WM_CHAR, Asc("u"), 0)
_WinAPI_PostMessage($hEdit, $WM_CHAR, Asc("."), 0)
_WinAPI_PostMessage($hEdit, $WM_CHAR, Asc("c"), 0)
_WinAPI_PostMessage($hEdit, $WM_CHAR, Asc("o"), 0)
_WinAPI_PostMessage($hEdit, $WM_CHAR, Asc("m"), 0)
Func _WinAPI_PostMessage($hWnd, $iMsg, $iwParam, $ilParam)
Local $aResult = DllCall("user32.dll", "bool", "PostMessage", "hwnd", $hWnd, "uint", $iMsg, "wparam", $iwParam, "lparam", $ilParam)
If @error Then Return SetError(@error, @extended, False)
Return $aResult[0]
EndFunc