能不出窗口输入吗???输入到该输到地方??请不惜指教。(已解决)
本帖最后由 creativewwz 于 2011-4-22 18:15 编辑能不出窗口输入吗???输入到该输到地方??请不惜指教。谢谢
这是原贴地址
http://www.autoitx.com/forum.php?mod=viewthread&tid=11173&highli#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Dim $keyboardPath = "keyboard.exe"
#Region ### START Koda GUI section ### Form=
$WinIO_Test = GUICreate("WinIO_Test", 633, 441, 192, 132)
$Label1 = GUICtrlCreateLabel("winio驱动级键盘模拟输入测试", 56, 32, 325, 33)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton("输入", 144, 96, 81, 49)
$Edit1 = GUICtrlCreateEdit("", 56, 160, 353, 209)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
ShellExecuteWait ($keyboardPath, "\w\w\w\w");等待4个250ms
ShellExecuteWait ($keyboardPath, "AaBbCc123DeEeFf")
ShellExecuteWait ($keyboardPath, "\r");输入一个回车
EndSwitch
WEnd
ght=winio 本帖最后由 lixiaolong 于 2011-4-19 21:07 编辑
回复 1# creativewwz
用Send也可以啊.
If Not WinExists("") Then Run("notepad.exe")
WinWait("")
WinActivate("")
a("你好!我叫lixiaolong,请多多关照!")
Func a($aa)
For $i = 1 To StringLen($aa)
$bb = StringMid($aa, $i, 1)
Send($bb)
If $bb = "!" Or $bb = "," Then
Sleep(500)
Else
Sleep(100)
EndIf
Next
EndFunc ;==>a 谢谢 能不开记事本,输入到密码框吗?
页:
[1]