论坛里有这样的例子的。 我发一个我综合了几个人的代码你看看。
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
; ●○
$pi = 3.14159265358979
Local $iCount = 0
Local $iColor = 1
Local $PointNum=1
;颜色控制变量
Local $color
$Form1 = GUICreate("圆", 300, 300,300,200,$WS_POPUP,bitor($WS_EX_LAYERED,$WS_EX_TOOLWINDOW))
GUISetBkColor(0xFFFBF0)
_API_SetLayeredWindowAttributes($Form1, 0xFFFBF0,255,False)
$Label1 = GUICtrlCreateLabel("●", 150, 100, 20, 20)
GUICtrlSetColor($Label1, 0xff0000)
$x = 50 * sin( 20 * $pi / 180)
for $i = 1 to 24 Step 1
$x = 50 * cos(15 * $i * $pi / 180)
$y = 50 * sin(15 * $i * $pi / 180)
$Label = GUICtrlCreateLabel("○", 150 + $x, 100 + $y, 10, 10)
GUICtrlSetColor(-1, $GUI_BKCOLOR_TRANSPARENT)
Next
$strInfo = GUICtrlCreateLabel("正在扫描系统信息,请稍后......", 70, 200)
AdlibRegister('_TimerProc',100)
;2.5秒变换一次颜色
AdlibRegister('_colorchange',2500)
GUISetState(@SW_SHOW)
;随即数生成颜色值
Func _ColorChange()
$color=Random(0x000000,0xffffff,1)
EndFunc
Func _API_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency, $isColorRef)
Local Const $AC_SRC_ALPHA = 1
Local Const $ULW_ALPHA = 2
Local Const $LWA_ALPHA = 0x2
Local Const $LWA_COLORKEY = 0x1
If Not $isColorRef Then
$i_transcolor = Hex(String($i_transcolor), 6)
$i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
EndIf
Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $LWA_COLORKEY + $LWA_ALPHA)
Select
Case @error
Return SetError(@error, 0, 0)
Case $Ret[0] = 0
Return SetError(4, 0, 0)
Case Else
Return 1
EndSelect
EndFunc
Func _TimerProc()
$iCount = $iCount + 1
$x = 50 * cos(15 * $iCount * $pi / 180)
$y = 50 * sin(15 * $iCount * $pi / 180)
$Label = GUICtrlCreateLabel("★", 150 + $x, 100 + $y, 12, 12)
if 0 = Mod($iColor,2) Then
GUICtrlSetColor(-1, $color)
Else
$color=BitOR($color,0x0f000F)
GUICtrlSetColor(-1, $color)
EndIf
Sleep(100)
If Mod($iCount,24) = 0 Then
$iColor = $iColor + 1
EndIf
;显示的文字信息也动作
Select
Case $PointNum=1
GUICtrlSetData($strInfo,"正在扫描系统信息,请稍后.")
Case $PointNum=2
GUICtrlSetData($strInfo,"正在扫描系统信息,请稍后..")
Case $PointNum=3
GUICtrlSetData($strInfo,"正在扫描系统信息,请稍后...")
Case $PointNum=4
GUICtrlSetData($strInfo,"正在扫描系统信息,请稍后....")
Case $PointNum=5
GUICtrlSetData($strInfo,"正在扫描系统信息,请稍后.....")
Case $PointNum=6
GUICtrlSetData($strInfo,"正在扫描系统信息,请稍后......")
EndSelect
;文字后的点数量加一
$PointNum=$PointNum+1
;如果文字后的点数量大于6,则将数量值置一
If $PointNum>6 Then $PointNum=1
;将显示过的实心圆再设置成空心的
;GUICtrlDelete($Label)
EndFunc
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
AdlibUnRegister('_TimerProc')
Exit
EndSwitch
WEnd
GUISetState(@SW_SHOW)
|