#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
Global Const $SC_MOVE = 0xF010
_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, BitXOR($WS_POPUP,$GUI_SS_DEFAULT_GUI),$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)
GUISetState()
$hGUI2 = GUICreate("", 850, 450,-1,-1, $WS_POPUP,BitOR($WS_SYSMENU,$WS_EX_LAYERED,$WS_EX_MDICHILD),$hGUI)
$Label1= GUICtrlCreateLabel("", 313,279,50,50,BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUISetBkColor(0xfffffe,$hGUI2)
_WinAPI_SetLayeredWindowAttributes($hGUI2, 0xfffffe, 255)
;~ GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
GUIRegisterMsg(0x0216, "WM_MOVING")
GUISetState()
While 1
$CursorInfo = GUIGetCursorInfo($hGUI2)
If $CursorInfo[4]=$Label1 Then
;Sleep(50)
If $CursorInfo[2]==1 Then MsgBox(0,'','')
EndIf
If $CursorInfo[2]==1 Then _SendMessage($hGUI, $WM_SYSCOMMAND, $SC_MOVE + $HTCAPTION, 0)
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
Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam)
if ($hWnd = $hGUI ) and ($iMsg = $WM_NCHITTEST) then Return
EndFunc
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