找回密码
 加入
搜索
查看: 2091|回复: 2

[AU3基础] 能不出窗口输入吗???输入到该输到地方??请不惜指教。(已解决)

[复制链接]
发表于 2011-4-19 06:11:22 | 显示全部楼层 |阅读模式
本帖最后由 creativewwz 于 2011-4-22 18:15 编辑

能不出窗口输入吗???输入到该输到地方??请不惜指教。谢谢

这是原贴地址
http://www.autoitx.com/forum.php ... id=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

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2011-4-19 21:05:25 | 显示全部楼层
本帖最后由 lixiaolong 于 2011-4-19 21:07 编辑

回复 1# creativewwz

用Send也可以啊.


If Not WinExists("[CLASS:Notepad]") Then Run("notepad.exe")

WinWait("[CLASS:Notepad]")
WinActivate("[CLASS:Notepad]")
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
 楼主| 发表于 2011-4-20 03:19:15 | 显示全部楼层
谢谢 能不开记事本,输入到密码框吗?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-2 08:42 , Processed in 0.080249 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表