#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Documents and Settings\Administrator\桌面\Form1.kxf
$Form1 = GUICreate("Form1", 205, 130, 598, 400, BitOR($WS_POPUP,$WS_DLGFRAME), $WS_EX_LAYERED)
GUISetBkColor(0xABCDEF)
_API_SetLayeredWindowAttributes($Form1, 0x010101)
$Label1 = GUICtrlCreateLabel("", 8, 96, 188, 25 ,$SS_ETCHEDHORZ And $SS_GRAYRECT, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor(-1,-2)
$Label2 = GUICtrlCreateLabel("afdsafsdfdafdsafd", 0, 0, 204, 129)
GUICtrlSetBkColor(-1,-2)
FileInstall("封装logo图片.bmp",@TempDir& "\封装logo图片.bmp",1)
$Pic1 = GUICtrlCreatePic(@TempDir& "\封装logo图片.bmp", 8, 8, 185, 81)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Dim $val
$val= IniRead(@ScriptDir&"\num.ini","num","val","notfound")
If $val=100 Then
MsgBox(0,"","已经5次")
Exit
Else
GUICtrlSetData($Label1, "已经运行的次数:"&$val)
$val=$val+1
IniWrite(@ScriptDir&"\num.ini","num","val",$val)
EndIf
FileDelete(@TempDir&"\封装logo图片.bmp")
HotKeySet("{Esc}","quit")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Form1 =$GUI_CHECKED
_API_SetLayeredWindowAttributes($Form1, 0xABCDEF)
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
|