本帖最后由 xiehuahere 于 2012-8-20 10:52 编辑
其实很简单,就是这个UDF有问题。
_SplashCreate函数第一句:DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
改变了主题风格。
_SplashDelete的时候应该再还原的,作者忽视了这一点。
但是如果使用“Windows经典”主题就没有这个问题。
改一下这个UDF:#include-once
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
; #INDEX# =======================================================================================================================
; Title .........: Splash_UDF
; AutoIt Version : 3.3.6.1
; Description ...: Functions to easily create a boot splash
; Author(s) .....: Dragonlair
; ===============================================================================================================================
Global $Splash, $SplashUpdate, $FadeEffectTime, $Progress, $theme
Func _SplashCreate($Pic, $Authorcopy, $Widht = 480, $Height = 272, $Loadmsg = "loading.", $FontColor = 0xFFFFFF, $ProgressBKColor = 0xFFFFFF, $ProgressColor = 0xC0C0C0, $FadeEffectTime = 300,$title='')
$theme = DllCall("uxtheme.dll", "dword", "GetThemeAppProperties")
DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "dword", 0)
$Splash = GUICreate("", $Widht, $Height, -1, -1, BitOR($WS_SYSMENU, $WS_POPUP), BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE, $WS_EX_TOOLWINDOW))
GUICtrlCreatePic($Pic, 0, 0, $Widht, $Height)
GUICtrlCreateLabel($Loadmsg&$title, 15, ($Height - 80), 438, 17)
GUICtrlSetColor(-1, $FontColor)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$SplashUpdate = GUICtrlCreateLabel("", 15, ($Height - 49), 438, 17)
GUICtrlSetColor(-1, $FontColor)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Progress = GUICtrlCreateProgress(15, ($Height - 33), 198, 7, $PBS_SMOOTH)
GUICtrlSetColor(-1, $ProgressColor)
GUICtrlSetBkColor(-1, $ProgressBKColor)
GUICtrlCreateLabel("Copyright 2010 - " & @YEAR & " " & $Authorcopy, 16, ($Height - 20), 438, 14)
GUICtrlSetFont(-1, 8, 800, 0, "Arial")
GUICtrlSetColor(-1, $FontColor)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Splash, "int", $FadeEffectTime, "long", 0x00080000) ;$GUI_EN_ANI_FADEIN
GUISetState()
EndFunc ;==>_SplashCreate
Func _SplashUpdate($updatemsg)
GUICtrlSetData($SplashUpdate, $updatemsg)
EndFunc ;==>_SplashUpdate
Func _SplashProgressUpdate($ProgValue)
if $ProgValue < GUICtrlRead($Progress) Then GUICtrlSetData($Progress, 0)
For $i = GUICtrlRead($Progress) To $ProgValue Step 1
Sleep(10)
GUICtrlSetData($Progress, $i)
Next
EndFunc ;==>_SplashProgressUpdate
Func _SplashDelete()
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Splash, "int", $FadeEffectTime, "long", 0x00090000) ;$GUI_EN_ANI_FADEOUT
GUIDelete($Splash)
DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "dword", $theme[0])
EndFunc ;==>_SplashDelete
|