#Include <WindowsConstants.au3>
#Include <GUIConstantsEx.au3>
#Include <WinAPIEx.au3>
#Include <GDIPlus.au3>
_GDIPlus_Startup()
$hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & '\1.png')
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
_GDIPlus_Shutdown()
$hForm = GUICreate('', 442, 332, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
_WinAPI_UpdateLayeredWindowEx($hForm, -1, -1, $hBitmap, 255)
GUIRegisterMsg($WM_NCHITTEST, 'WM_NCHITTEST')
GUISetState()
$iPos = WinGetPos($hForm)
$hChild = GUICreate('', 442, 332, $iPos[0], $iPos[1], $WS_POPUP, $WS_EX_LAYERED, $hForm)
GUISetBkColor(0xFF00DC)
$iButton = GUICtrlCreateButton('Exit', 20, 20, 50, 20)
_WinAPI_SetLayeredWindowAttributes($hChild, 0xFF00DC, 255)
GUIRegisterMsg($WM_MOVE, 'WM_MOVE')
GUISetState()
While 1
Switch GUIGetMsg()
Case -3, $iButton
Exit
EndSwitch
WEnd
Func WM_MOVE($hWnd, $iMsg, $wParam, $lParam)
Switch $hWnd
Case $hForm
$iPos = _WinAPI_GetPosFromRect(_WinAPI_GetWindowRect($hWnd))
WinMove($hChild, '', $iPos[0], $iPos[1])
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc
Func WM_NCHITTEST($hWnd, $iMsg, $wParam, $lParam)
Switch $hWnd
Case $hForm
Switch _WinAPI_DefWindowProc($hWnd, $iMsg, $wParam, $lParam)
Case $HTCLIENT
Return $HTCAPTION
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc