82809085 发表于 2013-2-22 04:58:39

后台键盘无法写入 能帮我解决下吗

#include <WinAPI.au3>
Run("Notepad.exe")
Global $title = '无标题 - 记事本'
Global $HWnd = WinGetHandle($title)
If $HWnd = 0 Then Exit
Sleep(1000)
_WinAPI_PostMessage($HWnd, 0x0100, 43, 0);点击C
Sleep(1000)
WinActivate($title)
Exit

lainline 发表于 2013-2-22 10:11:24

#include <WinAPI.au3>
Run("Notepad.exe")
WinWait('无标题 - 记事本')
Global $title = '无标题 - 记事本'
Global $HWnd = WinGetHandle($title)
$hEdit = ControlGetHandle($HWnd, '', 'Edit1')
If $HWnd = 0 Then Exit
Sleep(1000)
_WinAPI_PostMessage($hEdit, 258, Asc("C"), 0);点击C
Sleep(1000)
WinActivate($title)
Exit

cnergao 发表于 2013-2-22 10:19:12

Run("Notepad.exe")
后面
加个WinWait("无标题 - 记事本")

烟雨 发表于 2013-3-23 14:37:20

输入c还是点击c啊
页: [1]
查看完整版本: 后台键盘无法写入 能帮我解决下吗