autoit 将输入法修改为英文输入法

如果能用ControlSend,就不推荐用send,如果非要用send,可以切换输入法为英文再send.

$hWnd = WinGetHandle("[ACTIVE]");$hWnd 为目标窗口句柄,这里设置的是当前活动窗口
$ret = DllCall("user32.dll", "long", "LoadKeyboardLayout", "str", "08040804", "int", 1 + 0)
DllCall("user32.dll", "ptr", "SendMessage", "hwnd", $hWnd, "int", 0x50, "int", 1, "int", $ret[0])        
Send('nh')

 

原文地址:https://www.cnblogs.com/jenney-qiu/p/4527932.html