Dim Const $WM_CHAR = 0x102
Dim Enum $VK_A = 0x41, $VK_B, $VK_C, $VK_D, $VK_E
Dim $hNote, $hEdit, $aRet
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, $VK_A, 0)
_WinAPI_PostMessage($hEdit, $WM_CHAR, $VK_B, 0)
_WinAPI_PostMessage($hEdit, $WM_CHAR, $VK_C, 0)
_WinAPI_PostMessage($hEdit, $WM_CHAR, $VK_D, 0)
_WinAPI_PostMessage($hEdit, $WM_CHAR, $VK_E, 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