找回密码
 加入
搜索
查看: 2527|回复: 6

[AU3基础] msgbox 创建出来的,不能用winclose winexists之类的?

  [复制链接]
发表于 2011-10-21 19:48:50 | 显示全部楼层 |阅读模式
MsgBox(0,"test","文本")
Sleep(500)
WinActivate("test","文本")
WinClose("test","文本")
Exit

代码如上,winclose好像对msgbox 创建出来的无效,而且我尝试了ControlClick去点击“确定” 取消...好像也无效。
那么msgbox创建出来的有没有办法用程序去关闭它? 除了超时???
发表于 2011-10-21 20:00:37 | 显示全部楼层
发表于 2011-10-21 20:17:26 | 显示全部楼层
_ClickMsgBox("测试","3秒后点击确定,取消窗口","Button1",3)
MsgBox(0,"测试","3秒后点击确定,取消窗口")

Func _ClickMsgBox($MBTitle, $MBText,$MBButton,$MBTimeOut)
    Local $file = FileOpen(EnvGet("temp") & "\ClickMB.au3", 2)
    If $file = -1 Then Return

    Local $line1 = 'WinWait("' & $MBTitle & '", "' & $MBText & '"'&')'
        Local $line2 = 'Sleep("'&$MBTimeOut * 1000&'"'&')'
    Local $line3 = 'Controlclick("' & $MBTitle & '", "' & $MBText & '"' & ', "'&$MBButton&'"'&')'
    FileWrite($file, $line1 & @CRLF & $line2 & @CRLF & $line3)
    FileClose($file)
    
    Run(@AutoItExe & " /AutoIt3ExecuteScript " & EnvGet("temp") & "\ClickMB.au3")
EndFunc
发表于 2011-10-21 21:11:14 | 显示全部楼层
这问题太初级了  绝对没有认真看帮助
发表于 2011-10-21 21:58:01 | 显示全部楼层
这个东西都有UDF,厉害!佩服afan中!
发表于 2011-10-21 22:12:56 | 显示全部楼层
再看一次帮助文档比问谁都好
 楼主| 发表于 2011-10-22 18:18:45 | 显示全部楼层
我是很认真的看了帮助,我一般都不问问题都愿意自己解决。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-20 22:25 , Processed in 0.081549 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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