#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <Misc.au3>
#include <Timers.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 214, 408, 621, 332);, $WS_POPUP, $WS_EX_LAYERED, WinGetHandle("[Class:Progman;Title:Program Manager]"))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Global Const $AC_SRC_ALPHA = 1
_GDIPlus_Startup()
$hImage = _GDIPlus_ImageLoadFromFile("联络聊天.PNG")
$width = _GDIPlus_ImageGetWidth($hImage)
$height = _GDIPlus_ImageGetHeight($hImage)
$Form2 = GUICreate("窗体1", $width, $height, 639, 374, $WS_POPUP, $WS_EX_LAYERED,$Form1)
GUISetCursor(0)
;$Form2 = GUICreate("窗体1", 175, 141, 639, 374)
;$Label1 = GUICtrlCreateLabel("Label1", 0, $height, $width, 20, BitOR($SS_CENTER, $SS_CENTERIMAGE))
;GUICtrlSetBkColor($Label1, $GUI_BKCOLOR_TRANSPARENT)
;GUICtrlSetColor($Label1, 0xFFFFFF) ;字体颜色
;$Input1 = GUICtrlCreateInput("Input1", 120, 32, 121, 21)
;$Button1 = GUICtrlCreateButton("Button1", 80, 128, 75, 25)
;MsgBox(0,$width,$height)
SetBitmap($Form2, $hImage, 255)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $GUI_EVENT_MINIMIZE
;MsgBox(0,"","")
;GUISetState(@SW_RESTORE)
Case $GUI_EVENT_PRIMARYUP
MsgBox(0,"","")
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 ;==>SetBitmap