#include <GDIPlus.au3>
#include <GuiComboBox.au3>
#include <File.au3>
#include <Array.au3>
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <ButtonConstants.au3>
#include <SliderConstants.au3>
#include <Date.au3>
Global $Label,$controlGui[9], $text
$ini =@ScriptDir&"\config.ini"
$txt = IniRead($ini, "设置", "网吧公告", "")
Opt("MustDeclareVars", 0)
Global Const $AC_SRC_ALPHA = 1
_GDIPlus_Startup()
$Src = @scriptdir&"\beijing.png"
$hImage =_GDIPlus_ImageLoadFromFile($Src)
$width = _GDIPlus_ImageGetWidth ($hImage)
$height = _GDIPlus_ImageGetHeight($hImage)
$GUI = GUICreate("Chat Tools", $width, $height, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
SetBitMap($GUI, $hImage, 0)
$Label1 = GUICtrlCreateLabel("", 360, 8, 30, 30)
$Label2 = GUICtrlCreateLabel("", 330, 8, 30, 30)
GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
GUISetState()
WinSetOnTop($gui,"",1)
for $i = 0 to 255 step 10
SetBitMap($GUI, $hImage, $i)
next
$font="方正粗活意简体"
$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("梦幻王国网吧公告", 25, 25, 140, 50)
GUICtrlSetFont(-1,12,'','',$font)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1, 0x123456)
$clock=GUICtrlCreateLabel("",200,30,200,20)
GUICtrlSetFont(-1,10)
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState(@SW_SHOW)
$text=GUICtrlCreateLabel($txt,60, 240, 400, 15)
GuiCtrlSetFont(-1, 10)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1,0x000000)
_WinAPI_DeleteObject($hImage)
_GDIPlus_Shutdown()
Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam)
if ($hWnd = $GUI) and ($iMsg = $WM_NCHITTEST) then Return $HTCAPTION
EndFunc
$num=0
$b=1
While $num <= 2500
If $b = 240 Then $b = 10
Sleep(100)
ControlMove ('',$txt,$text,60,240-$b,400,15)
$b += 1
$num = $num + 1
_ReduceMemory(@AutoItPID)
$LbR = GUICtrlRead($clock)
$Nw = _Now()
If $Nw <> $LbR Then GUICtrlSetData($clock, $Nw)
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Label1
Exit
Case $Label2
WinSetState($GUI,"",@SW_MINIMIZE)
EndSwitch
WEnd
Func SetBitmap($hGUI, $hImage, $iOpacity)
Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend
$hScrDC = _WinAPI_GetDC(0)
$hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
$hOld = _WinAPI_SelectObject($hMemDC, $hBitmap)
$tSize = DllStructCreate($tagSIZE)
$pSize = DllStructGetPtr($tSize)
DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage))
DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage))
$tSource = DllStructCreate($tagPOINT)
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha", $iOpacity)
DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA)
_WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
_WinAPI_ReleaseDC(0, $hScrDC)
_WinAPI_SelectObject($hMemDC, $hOld)
_WinAPI_DeleteObject($hBitmap)
_WinAPI_DeleteDC($hMemDC)
EndFunc
Func _ReduceMemory($i_PID = -1)
If $i_PID <> -1 Then
Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID)
Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
Else
Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
EndIf
Return $ai_Return[0]
EndFunc
我看了 afan大大的 文字向上移动.Afan那个程序。我想应该是 png做背景的问题把?