#RequireAdmin
#include <Process.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
; 设置窗口参数
Local $GuiWidth = 441, $GuiHeight = 251 ; 窗口宽度和高度
Local $GuiTitle = "Form1" ; 窗口标题
; 创建无边框窗口在屏幕居中显示
Local $MainWindow = GUICreate($GuiTitle, $GuiWidth, $GuiHeight, (@DesktopWidth - $GuiWidth) / 2, (@DesktopHeight - $GuiHeight) / 2 , $WS_POPUP,$WS_EX_TOOLWINDOW)
; 设置窗口颜色(蓝色=0x2b579a,绿色=0x217346,红色=0xb7472a)
GUISetBkColor(0x2b579a)
; 创建显示控件
$Label1 = GUICtrlCreateLabel("软件安装", 15, 15, 325, 25)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
GUICtrlSetColor(-1, 0xFFFFFF)
$Label2 = GUICtrlCreateLabel("请稍候", 124, 82, 165, 75, BitOr(0x200, 0x1))
GUICtrlSetFont(-1, 40, 400, 0, "微软雅黑")
GUICtrlSetColor(-1, 0xFFFFFF)
$Label3 = GUICtrlCreateLabel('....', 290, 82, 55, 75)
GUICtrlSetFont(-1, 40, 400, 0, "微软雅黑")
GUICtrlSetColor(-1, 0xFFFFFF)
$Label4 = GUICtrlCreateLabel("正在安装:", 15, 205, 410, 25)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
GUICtrlSetColor(-1, 0xFFFFFF)
$Label5 = GUICtrlCreateLabel("(00/00)", 348, 15, 80, 25, BitOr(0x200, 0x1))
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
GUICtrlSetColor(-1, 0xFFFFFF)
GUISetState(@SW_SHOW)
; 循环显示动态效果
AdlibRegister("MyAdLibFunc", 500)
; 动态显示
Func MyAdLibFunc()
; 分配一个静态变量保存函数调用的次数.
Local Static $iCount = 0
$iCount += 1
If $iCount = 1 Then GUICtrlSetData($Label3, '.')
If $iCount = 2 Then GUICtrlSetData($Label3, '..')
If $iCount = 3 Then GUICtrlSetData($Label3, '...')
If $iCount = 4 Then
GUICtrlSetData($Label3, '....')
$iCount = 0
EndIf
EndFunc
; 进入消息循环,等待用户交互
While 1
If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
; 删除窗口,并结束程序
GUIDelete($MainWindow)