是这个意思?
#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <GuiConstantsEx.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <Memory.au3>
Global Const $AC_SRC_ALPHA = 1
_GDIPlus_Startup()
$hImage = _GDIPlus_ImageLoadFromFile("meiko.png")
$Width = _GDIPlus_ImageGetWidth($hImage)
$Height = _GDIPlus_ImageGetHeight($hImage)
$about_normal = _GDIPlus_ImageLoadFromFile("about_normal.png")
$hGUI = GUICreate(" ", 250, 250, @DesktopWidth / 2 - $Width / 2, @DesktopHeight / 2 - $Height / 2, $WS_POPUP, $WS_EX_LAYERED)
$GC = _GDIPlus_ImageGetGraphicsContext($hImage)
$bkbitmap = _GDIPlus_BitmapCreateFromGraphics($Width, $Height, $GC)
$newGC = _GDIPlus_ImageGetGraphicsContext($bkbitmap)
_GDIPlus_GraphicsDrawImageRect($newGC, $hImage, 0, 0, $Width, $Height)
_GDIPlus_GraphicsDrawImageRect($newGC, $about_normal, 315, 300, 50, 50)
SetBitMap($hGUI, $bkbitmap, 255)
$Label1 = GUICtrlCreateLabel("", 313, 279, 50, 50, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUISetState()
;~ $hGUI2 = GUICreate("", 850, 450, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hGUI)
;~ GUISetBkColor(0xfffffe,$hGUI2)
;~ _WinAPI_SetLayeredWindowAttributes($hGUI2, 0xfffffe, 255)
GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
;~ GUIRegisterMsg(0x0216, "WM_MOVING")
;~ GUISetState()
While 1
$CursorInfo = GUIGetCursorInfo()
If $CursorInfo[4] = $Label1 Then
;Sleep(50)
If $CursorInfo[2] == 1 Then MsgBox(0, '', '')
EndIf
If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
WEnd
Func WM_MOVING($hWnd, $msg, $wParam, $lParam)
$tBuffer = DllStructCreate($tagRECT, $lParam)
$iLeft = DllStructGetData($tBuffer, "Left")
$iTop = DllStructGetData($tBuffer, "Top")
_WinAPI_MoveWindow($hWnd, $iLeft, $iTop, $Width, $Height)
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_MOVING
Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam)
If ($hWnd = $hGUI) And ($iMsg = $WM_NCHITTEST) Then Return $HTCAPTION
EndFunc ;==>WM_NCHITTEST
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))
DllStructSetData($tSize, "X", $Width)
DllStructSetData($tSize, "Y", $Height)
$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
|