2008年10月19日 星期日

AUTOIT 一直跑的BAR

http://www.autoit.net.cn/viewthread.php?tid=1901&extra=page%3D1

安装进度条

#include
#include
Opt("WinTitleMatchMode", 2)
$AForm2 = GUICreate("AForm1", 400,100,40,@DesktopHeight-50,$WS_POPUP, $WS_EX_LAYERED+$WS_EX_TOPMOST+$WS_EX_TOOLWINDOW)
GUISetBkColor(0xABCDEF)
for $i=0 to 9
$w=15
$pro= GUICtrlCreateLabel("□",40+$w*$i, 20, 135, 10)
GUICtrlSetBkColor($pro, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor($pro, 0xffffff)
Next
GUISetState(@SW_SHOW)
AdlibEnable("xh",3300)
Func xh()
$h=15
$i=0
Do
$i = $i + 1
$pro= GUICtrlCreateLabel("■",40+$h*($i-1), 20, 10, 10)
GUICtrlSetColor(-1, 0x00ff00)
Sleep(300)
GUICtrlDelete($pro)
if $i=10 Then ExitLoop
Until $i>=10
EndFunc
_API_SetLayeredWindowAttributes($AForm2, 0xABCDEF)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exitloop
EndSwitch
WEnd

Func _API_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $isColorRef = False)

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 ;==>_API_SetLayeredWindowAttributes

沒有留言:

RHEL install EPEL

  https://www.linuxtechi.com/install-epel-repo-on-rhel-system/ EPEL dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest...