找回密码
 加入
搜索
查看: 4606|回复: 10

[AU3基础] 怎么判断程序运行后,关闭SplashTextOn提示【已解决】

  [复制链接]
发表于 2010-3-9 00:47:31 | 显示全部楼层 |阅读模式
本帖最后由 tianya1631 于 2010-3-9 11:51 编辑

在程序运行前我设置了SplashTextOn提示,但我怎么去判断,在程序窗口打开之前,用SplashOff关闭这个提示呢?我说的应该够明白了吧?谢谢了。。
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>

;怎么在gui界面出现前关闭这个提示,我现在是加的sleep,这个不行。。
 SplashTextOn("","正在扫描计算机硬件信息......", 230, 38, -1, -1, 1, "", 12)
 Sleep(3000)
 SplashOff()

$g_szVersion = "系统维护工具V1.0"
If WinExists($g_szVersion) Then
        MsgBox(32, "", "注意程序已经运行了")
        $flag = 1 
        Exit; 此脚本已经运行了
EndIf
AutoItWinSetTitle($g_szVersion)


FileInstall("autologo.jpg", @TempDir & "\autologo.jpg")
$Form1 = GUICreate("系统维护工具", 500, 400, -1, -1)
GUICtrlCreatePic(@TempDir & "\autologo.jpg", 0, 0, 502, 100)
$Label21 = GUICtrlCreateLabel("ACN 中文论坛   www.autoitx.com", 10, 384, 260, 17)
$Label22 = GUICtrlCreateLabel("|", 340, 381, 60, 32)
GUICtrlSetFont(-1, 12, 400, 0, "宋体")
GUICtrlSetState(-1, $GUI_DISABLE)
$Label23 = GUICtrlCreateLabel(" BY TianYa1631  ", 352, 384, 100, 17)
$Tab1 = GUICtrlCreateTab(1, 100, 500, 280)
GUICtrlSetFont(-1, 9, 400, 0, "微软雅黑")
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
$Label30 = GUICtrlCreateLabel(" 当前时间: " & @HOUR & ":" & @MIN & "  " & @YEAR & "-" & @MON & "-" & @MDAY & "  " & _DateDayOfWeek(@WDAY), 150, 83, 250, 17)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

;==============硬件信息界面=============================================
$TabSheet1 = GUICtrlCreateTabItem("  硬件信息 ")
$Group1 = GUICtrlCreateGroup("计算机硬件信息", 24, 173, 457, 200)
GUICtrlSetFont(-1, 9, 400, 0, "MS Sans Serif")
$Label5 = GUICtrlCreateLabel("CPU:", 54, 198, 40, 17)
$Label6 = GUICtrlCreateLabel("主板:", 54, 218, 40, 17)
$Label7 = GUICtrlCreateLabel("内存:", 54, 238, 40, 17)
$Label8 = GUICtrlCreateLabel("硬盘:", 54, 258, 40, 17)
$Label9 = GUICtrlCreateLabel("显卡:", 54, 278, 40, 17)
$Label10 = GUICtrlCreateLabel("网卡:", 54, 298, 40, 17)
$Label11 = GUICtrlCreateLabel("光驱:", 54, 318, 40, 17)
$Label12 = GUICtrlCreateLabel("声卡:", 54, 338, 40, 17)
$cpu = GUICtrlCreateLabel("", 104, 198, 370, 17)
$board = GUICtrlCreateLabel("", 104, 218, 370, 17)
$mem = GUICtrlCreateLabel("", 104, 238, 370, 17)
$hard = GUICtrlCreateLabel("", 104, 258, 370, 17)
$display = GUICtrlCreateLabel("", 104, 278, 370, 17)
$network = GUICtrlCreateLabel("", 104, 298, 370, 17)
$cdrom = GUICtrlCreateLabel("", 104, 318, 370, 17)
$sound = GUICtrlCreateLabel("", 104, 338, 370, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("常规", 24, 128, 457, 41)
GUICtrlSetFont(-1, 9, 400, 0, "MS Sans Serif")
$Label1 = GUICtrlCreateLabel("品牌:", 54, 148, 40, 17)
$model = GUICtrlCreateLabel("", 99, 148, 155, 17)
$Label3 = GUICtrlCreateLabel("计算机名称:", 264, 147, 76, 20)
$Label4 = GUICtrlCreateLabel(@ComputerName, 344, 147, 130, 17)

GUICtrlCreateTabItem("")
$Pic1 = GUICtrlCreatePic("", 0, 0, 502, 100, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
;================================================================

GUISetState()
While 1
        $nMsg = GUIGetMsg()

        Select
                Case $nMsg = $GUI_EVENT_CLOSE
                        Exit
        EndSelect
WEnd
                        

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

发表于 2010-3-9 00:54:29 | 显示全部楼层
先定义一个参数为0,程序准备工作完成后设置参数为1。
循环判断这个参数,为1时SplashOff()
 楼主| 发表于 2010-3-9 01:02:34 | 显示全部楼层
回复 2# afan
谢谢A大,我就知道你会回答我的问题,呵呵,我先试试看,实在搞不出来再来问。。。
 楼主| 发表于 2010-3-9 10:19:03 | 显示全部楼层
先定义一个参数为0,程序准备工作完成后设置参数为1。
循环判断这个参数,为1时SplashOff()
afan 发表于 2010-3-9 00:54


还是不懂,我怎么去判断这个gui窗口什么时候出现呢?
发表于 2010-3-9 10:23:12 | 显示全部楼层
回复 4# tianya1631


    要不你先上段代码及要求?再讨论~ 这样别人不好说
 楼主| 发表于 2010-3-9 10:45:51 | 显示全部楼层
回复 5# afan

A大,已传代码,很简单,就是在gui界面出现前出来一个提示,然后再关闭。。
发表于 2010-3-9 11:07:40 | 显示全部楼层
回复 6# tianya1631


    你把执行扫描的代码去掉了那怎么判断要闪屏多久哦
发表于 2010-3-9 11:15:37 | 显示全部楼层
发表于 2010-3-9 11:22:31 | 显示全部楼层
在程序运行前我设置了SplashTextOn提示,但我怎么去判断,在程序窗口打开之前,用SplashOff关闭这个提示呢? ...
tianya1631 发表于 2010-3-9 00:47


只要把那个代码修改下顺序:
info()
SplashOff()
GUISetState()
就能符合“在程序窗口打开之前,用SplashOff关闭这个提示”
 楼主| 发表于 2010-3-9 11:42:07 | 显示全部楼层
回复 9# afan
谢谢A大,我那个界面一打开就会自动获取硬件信息的。我去看一下。。。
 楼主| 发表于 2010-3-9 11:50:28 | 显示全部楼层
只要把那个代码修改下顺序:
info()
SplashOff()
GUISetState()
就能符合“在程序窗口打开之前,用 ...
afan 发表于 2010-3-9 11:22


搞定了,A大,谢谢了,就是这样做就行了。。
info()
SplashOff()
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-9 23:22 , Processed in 0.092873 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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