来论坛之后,人生第一贴,请大大们多帮忙......最小化.时钟...不对...想用INI文件来配置发现没作用!
#NoTrayIcon
#include <A3LGDIPlus.au3>
; $i = "confing.ini"
; $A1 = IniRead($i, "基本配置", "菜单标题", "")
; $A2 = IniRead($i, "基本配置", "公告", "")
; $B[6] = IniRead($i, "菜单设置", "菜单名称"&[6], "")
; $C[6]= IniRead($i, "菜单设置", "菜单说明"&[6], "")
; $png[6] =IniRead($i, "菜单设置", "图片路径"&[6], "")
; $run[6] =IniRead($i, "菜单设置", "执行文件"&[6], "")
Opt("MustDeclareVars", 0)
Global Const $AC_SRC_ALPHA = 1
Global Const $ULW_ALPHA = 2
Global $old_string = "", $runthis = ""
Global $launchDir = @DesktopDir
Local $controlGui[9], $text1[6]
_GDIP_Startup()
$pngSrc = @scriptdir&"\client.png"
$hImage = _GDIP_ImageLoadFromFile($pngSrc)
$width = _GDIP_ImageGetWidth ($hImage)
$height = _GDIP_ImageGetHeight($hImage)
$GUI = GUICreate("launcher", $width, $height, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
SetBitMap($GUI, $hImage, 0)
GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
GUISetState()
WinSetOnTop($gui,"",1)
for $i = 0 to 255 step 10
SetBitMap($GUI, $hImage, $i)
next
$controlGui[0] = GUICreate("ControlGUI", $width, $height, 0,0,$WS_POPUP,BitOR($WS_EX_LAYERED,$WS_EX_MDICHILD),$gui)
GUICtrlCreatePic(@ScriptDir & "\grey.gif",0,0,$width,$height)
GuiCtrlSetState(-1,$GUI_DISABLE)
GUICtrlCreateLabel("QQ菜单 V1.0", 70, 7, 140, 50)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1, 0xFFFFFF)
$goButton = GUICtrlCreateButton("x", 450, 22, 10, 10, $BS_DEFPUSHBUTTON)
$goButton1 = GUICtrlCreateButton("+", 420, 22, 10, 10, $BS_DEFPUSHBUTTON)
$goButton2 = GUICtrlCreateButton("-", 390, 22, 10, 10, $BS_DEFPUSHBUTTON)
$clock=GUICtrlCreateLabel("当前时间 " & @hour & ":" & @min & ":" & @sec,215,17,200,20)
GUICtrlSetFont(-1, 10)
GUICtrlSetColor(-1, 0xff0000)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState()
$text=GUICtrlCreateLabel("温馨提醒您:贵重财物请自行保管好,手机请勿摆放到桌面", 30, 250, 400, 15)
GuiCtrlSetFont($text, 10)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1,0x000000)
$text1[0]=GUICtrlCreateLabel("QQ2008", 110, 110, 80, 15)
GuiCtrlSetFont($text1[0], 10)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1,0xFFFFFF)
$text1[1]=GUICtrlCreateLabel("珊瑚QQ", 250, 110, 80, 15)
GuiCtrlSetFont($text1[1], 10)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1,0xFFFFFF)
$text1[2]=GUICtrlCreateLabel("游戏1", 394, 110, 80, 15)
GuiCtrlSetFont($text1[2], 10)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1,0xFFFFFF)
$text1[3]=GUICtrlCreateLabel("游戏1", 79, 216, 80, 15)
GuiCtrlSetFont($text1[3], 10)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1,0xFFFFFF)
$text1[4]=GUICtrlCreateLabel("游戏1", 219, 216, 80, 15)
GuiCtrlSetFont($text1[5], 10)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1,0xFFFFFF)
$text1[5]=GUICtrlCreateLabel("游戏1", 359, 216, 80, 15)
GuiCtrlSetFont($text1[5], 10)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1,0xFFFFFF)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE or $msg = $goButton
ExitLoop
Case $msg = $goButton1
ExitLoop
Case $msg = $goButton2
ExitLoop
While 1
Sleep(200)
GuiCtrlSetData($clock, @hour & ":" & @min & ":" & @sec)
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
EndSelect
Sleep(300)
WEnd
EndSelect
WEnd
GUIDelete($controlGui[0])
;淡出背景颜色
for $i = 255 to 0 step -10
SetBitMap($GUI, $hImage, $i)
next
; 释放资源
_API_DeleteObject($hImage)
_GDIP_Shutdown()
Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam)
if ($hWnd = $GUI) and ($iMsg = $WM_NCHITTEST) then Return $HTCAPTION
EndFunc
Func SetBitmap($hGUI, $hImage, $iOpacity)
Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend
$hScrDC = _API_GetDC(0)
$hMemDC = _API_CreateCompatibleDC($hScrDC)
$hBitmap = _GDIP_BitmapCreateHBITMAPFromBitmap($hImage)
$hOld = _API_SelectObject($hMemDC, $hBitmap)
$tSize = DllStructCreate($tagSIZE)
$pSize = DllStructGetPtr($tSize )
DllStructSetData($tSize, "X", _GDIP_ImageGetWidth ($hImage))
DllStructSetData($tSize, "Y", _GDIP_ImageGetHeight($hImage))
$tSource = DllStructCreate($tagPOINT)
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha" , $iOpacity )
DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA)
_API_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
_API_ReleaseDC (0, $hScrDC)
_API_SelectObject($hMemDC, $hOld)
_API_DeleteObject($hBitmap)
_API_DeleteDC ($hMemDC)
EndFunc
Func _ShellExecute($sCmd, $sArg="", $sFolder = "", $rState = @SW_SHOWNORMAL)
$aRet = DllCall("shell32.dll", "long", "ShellExecute", _
"hwnd", 0, _
"string", "", _
"string", $sCmd, _
"string", $sArg, _
"string", $sFolder, _
"int", $rState)
If @error Then Return 0
$RetVal = $aRet[0]
If $RetVal > 32 Then
Return 1
else
Return 0
EndIf
EndFunc
[ 本帖最后由 yuko4632 于 2008-6-30 12:16 编辑 ] |