Código: Seleccionar todo
#RequireAdmin
#include <ButtonConstants.au3>
#include <MsgBoxConstants.au3>
#include <StructureConstants.au3>
#include <WinAPIConstants.au3>
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <NoMadMemory.au3>
#include <Sound.au3>
;Un checkbox que utilizo $Checkbox1 = GUICtrlCreateCheckbox("NO FUNCIONA", 144, 40, 65, 17)
;Un button $Button1 = GUICtrlCreateButton("Exit", 136, 64, 75, 25)
_GDIPlus_Startup()
Global Const $SC_DRAGMOVE = 0xF012
Global $iW, $iH, $hImage, $hBitmap, $hGUI
$hImage = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\fondo.png")
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
$iW = _GDIPlus_ImageGetWidth($hImage)
$iH = _GDIPlus_ImageGetHeight($hImage)
$hGUI = GUICreate("", $iW, $iH, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
GUISetState(@SW_SHOW)
$handle = _SoundOpen(@ScriptDir & "\recession.mp3");Lo único que me ha funcionado la música xD
_SoundPlay($handle)
_WinAPI_BitmapDisplayTransparentInGUI($hBitmap, $hGUI)
GUIRegisterMsg($WM_LBUTTONDOWN, "_WM_LBUTTONDOWN")
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
_WinAPI_DeleteObject($hBitmap)
_GDIPlus_BitmapDispose($hImage)
_GDIPlus_Shutdown()
GUIDelete()
Func _WinAPI_BitmapDisplayTransparentInGUI(ByRef $hHBitmap, ByRef $hGUI, $iOpacity = 0xFF, $bReleaseGDI = True)
If Not BitAND(GUIGetStyle($hGUI)[1], $WS_EX_LAYERED) = $WS_EX_LAYERED Then Return SetError(1, 0, 0)
Local $tDim = DllStructCreate($tagBITMAP)
If Not _WinAPI_GetObject($hHBitmap, DllStructGetSize($tDim), DllStructGetPtr($tDim)) Then Return SetError(2, 0, 0)
Local $tSize = DllStructCreate($tagSIZE), $tSource = DllStructCreate($tagPOINT), $tBlend = DllStructCreate($tagBLENDFUNCTION)
Local Const $hScrDC = _WinAPI_GetDC(0), $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC), $hOld = _WinAPI_SelectObject($hMemDC, $hHBitmap)
$tSize.X = $tDim.bmWidth
$tSize.Y = $tDim.bmHeight
$tBlend.Alpha = $iOpacity
$tBlend.Format = 1
_WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, DllStructGetPtr($tSize), $hMemDC, DllStructGetPtr($tSource), 0, DllStructGetPtr($tBlend), $ULW_ALPHA)
_WinAPI_ReleaseDC(0, $hScrDC)
_WinAPI_SelectObject($hMemDC, $hOld)
_WinAPI_DeleteDC($hMemDC)
If $bReleaseGDI Then _WinAPI_DeleteObject($hHBitmap)
Return True
EndFunc
Func _WM_LBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam)
_SendMessage($hGUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0)
EndFunc ;==>_WM_LBUTTONDOWN