找回密码
 加入
搜索
查看: 5523|回复: 4

[GUI管理] 如何让程序在后台静默运行,不弹出窗口

[复制链接]
发表于 2010-10-9 00:28:19 | 显示全部楼层 |阅读模式
学校的网络需要申请出校,有个软件,可以自动填表运行,但是成功或者失败都会弹出一个窗口,
希望能有高手帮忙,做到以下效果,
后台运行,不出现填表的界面,弹出的窗口也在后台确认后消失。
先谢过各位达人
发表于 2010-10-9 05:52:06 | 显示全部楼层
这个估计不太可能。但是可以把窗口改成透明
发表于 2010-10-9 10:31:44 | 显示全部楼层
先用WinGetHandle 获取软件程序窗口句柄,再用WinSetState 隐藏程序,再用_WinAPI_EnumChildWindowS枚举运行软件程序中的各个窗口句柄,实现后台填写,弹出的窗口,可用_WinAPI_EnumWindows枚举得到句柄,并发送确定命令。
 楼主| 发表于 2010-10-10 00:43:19 | 显示全部楼层
我是初学者,对WinAPI还不了解。
慢慢研究下,看看可行不。
 楼主| 发表于 2010-10-10 08:21:20 | 显示全部楼层
本帖最后由 goodylq 于 2010-10-10 08:24 编辑

If WinExists("USTS-jf Client V1.0.6") Then
        WinSetState("USTS-jf Client V1.0.6","",@SW_HIDE)
    WinActivate("USTS-jf Client V1.0.6")
    winwaitactive("USTS-jf Client V1.0.6")
    ControlSetText("","","[CLASS:TEdit; INSTANCE:2]","yc10042740")
    ControlSetText("","","[CLASS:TEdit; INSTANCE:1]","****")
    ControlSetText("","","[CLASS:TMaskEdit; INSTANCE:1]","60")
        ControlCommand("","","[CLASS:TCheckBox; INSTANCE:2]","Check","")
    ControlSend("","","[CLASS:TButton; INSTANCE:2]","{SPACE}")
        WinWait("信息")
        WinClose("信息")
        WinSetState("USTS-jf Client V1.0.6","",@SW_HIDE)
        WinActivate("USTS-jf Client V1.0.6")
    winwaitactive("USTS-jf Client V1.0.6")
    ControlSetText("","","[CLASS:TEdit; INSTANCE:2]","yc10042740")
    ControlSetText("","","[CLASS:TEdit; INSTANCE:1]","****")
    ControlSetText("","","[CLASS:TMaskEdit; INSTANCE:1]","60")
    ControlCommand("","","[CLASS:TCheckBox; INSTANCE:2]","Check","")
    ControlSend("","","[CLASS:TButton; INSTANCE:3]","{SPACE}")
        WinWait("校园网计费客户端")
    WinKill("校园网计费客户端","")
Else
  Run("jfc.exe")
  WinSetState("USTS-jf Client V1.0.6","",@SW_HIDE)
  WinActivate("USTS-jf Client V1.0.6")
  winwaitactive("USTS-jf Client V1.0.6")  
  ControlSetText("","","[CLASS:TEdit; INSTANCE:2]","yc10042740")
  ControlSetText("","","[CLASS:TEdit; INSTANCE:1]","****")
  ControlSetText("","","[CLASS:TMaskEdit; INSTANCE:1]","60")
  ControlCommand("","","[CLASS:TCheckBox; INSTANCE:2]","Check","")
  ControlSend("","","[CLASS:TButton; INSTANCE:3]","{SPACE}")
  WinWait("校园网计费客户端")
  WinKill("校园网计费客户端","")
EndIf
Exit
现在软件窗口已经隐藏了,后台运行,就剩下弹出的需要确认的窗口。
请问各位高手,这个脚本里,如何让弹出的“信息”窗口和"校园网计费客户端"不出现???这两个窗口都只是仅有确认键。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-11-15 07:29 , Processed in 0.076938 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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