Transparentes GUI mit .png

05/15/2012 00:37 Darkbanner#1
Code:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#Include <WinAPI.au3>

Global $hGUI, $hImage, $hGraphic, $hImage1

; Create GUI
$hGUI = GUICreate("Show PNG", 600, 760,0,0, BitOR($WS_POPUP,$DS_MODALFRAME,$WS_EX_LAYERED),$WS_EX_ACCEPTFILES);,$DS_SETFOREGROUND))
	GUISetBkColor(0xABCDEF)
	_WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF, 255)

; Load PNG image
_GDIPlus_StartUp()
$hImage   = _GDIPlus_ImageLoadFromFile("gui.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)

GUIRegisterMsg($WM_PAINT, "MY_WM_PAINT")
GUISetState()

; Loop until user exits
do
until GUIGetMsg() = $GUI_EVENT_CLOSE

; Clean up resources
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_ShutDown()

; Draw PNG image
Func MY_WM_PAINT($hWnd, $Msg, $wParam, $lParam)
    _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_UPDATENOW)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0)
    _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_VALIDATE)
    Return $GUI_RUNDEFMSG
EndFunc
Sollte normalerweise doch en transparenten hintergrund haben, hat's aber leider nicht...
Wer findet den Fehler? :D

Greetz Darkbanner.

PUSH!
05/21/2012 22:54 Adroxxx#2
Pushes sind nicht erlaubt. Nächstes mal gibt es eine Warnung.
05/21/2012 23:13 Achat#3
WinSetTrans ( "title", "text", transparency )

MfG