#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$hGui = GUICreate("", 100,20, @DesktopWidth-100,0,$WS_POPUP, $WS_EX_LAYERED+$WS_EX_TOPMOST+$WS_EX_TOOLWINDOW)
GUICtrlCreateLabel("",0,0,100,20,-1,$GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor(-1, 0x123456)
GUICtrlSetFont(-1,15,1000)
GUICtrlSetColor(-1, 0xFF8000)
_API_SetLayeredWindowAttributes($hGui, 0x123456)
GUISetState()
While 1
GUICtrlSetData(-1, @HOUR&':'&@MIN&':'&@SEC)
sleep(1000)
WinSetOnTop($hGui,'',1)
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
不确定是否好用.