Hallo zusammen, mich beschäftigt seit Tagen schon ein Problem welches ich leider nicht gelöst bekomme
(Hätte ich mal nicht mit den GDI+ zeug angefangen )
Das Problem ist das der Inhalt von der zweiten Gui nicht in der Live Preview angezeigt wird, sobald das Fenster Minimiert ist.
Und wenn ich die Gui minimiere sieht es leider so aus:
Hier mal der Dazugehörige beispiel AutoIt Code:
AutoIt
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
Func _SetBmp($hGUI, $hImage, $iWidth, $iHeight, $iOpacity = 255)
Local $hScrDC = _WinAPI_GetDC($hGUI)
Local $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)
Local $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
Local $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap)
Local $tSize = DllStructCreate("long X;long Y")
Local $pSize = DllStructGetPtr($tSize)
DllStructSetData($tSize, "X", $iWidth)
DllStructSetData($tSize, "Y", $iHeight)
Local $tSource = DllStructCreate("long X;long Y")
Local $pSource = DllStructGetPtr($tSource)
Local $tBlend = DllStructCreate("byte Op;byte Flags;byte Alpha;byte Format")
Local $pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha", $iOpacity)
DllStructSetData($tBlend, "Format", 1)
_WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, 0x02)
_WinAPI_ReleaseDC(0, $hScrDC)
_WinAPI_SelectObject($hMemDC, $hOld)
_WinAPI_DeleteObject($hBitmap)
_WinAPI_DeleteDC($hMemDC)
EndFunc
Func _DrawItems(ByRef $hImage, $iWidth, $iHeight, $hGui)
Local $hWindow = _GDIPlus_GraphicsCreateFromHWND($hGui)
Local $hBmp = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hWindow)
Local $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBmp)
Local $hBrush = _GDIPlus_LineBrushCreateFromRect(_GDIPlus_RectFCreate(0, 0, $iWidth, $iHeight), 0xFF009917, 0xFF0F6029, 1)
_GDIPlus_GraphicsFillRect($hGraphic, 0, 0, $iWidth, $iHeight, $hBrush)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 0, 0, 92, 90)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_GraphicsDispose($hWindow)
Return $hBmp
EndFunc
_GDIPlus_Startup()
Global $Image = _GDIPlus_ImageLoadFromFile(StringRegExpReplace(@AutoItExe, "(?i)AutoIt(?:[\dx_]+)\.exe", "Examples\\GUI\\Torus.png"))
Global $Width = 400, $Height = 300
Global $Clone = _GDIPlus_BitmapCloneArea($Image, 0, 0, 92, 90, $GDIP_PXF32ARGB)
Global $Gui = GUICreate("Test Gui", $Width, $Height, -1, -1, BitOR($WS_POPUP, $WS_GROUP, $WS_SYSMENU), $WS_EX_LAYERED)
Global $Bmp = _DrawItems($Clone, $Width, $Height, $Gui)
_SetBmp($Gui, $Bmp, $Width, $Height)
_GDIPlus_ImageDispose($Image)
_GDIPlus_ImageDispose($Bmp)
Global $Child = GUICreate("", $Width-10, $Height-10, 10, 10, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $Gui)
GUISetBkColor(0x000000, $Child)
_WinAPI_SetLayeredWindowAttributes($Child, 0x000000, 255)
GUICtrlCreateLabel("Wo ist der Text und der Button, in der Live Vorschau, wenn das Fenster Minimiert ist?", 1, 94, 360, 152, $WS_BORDER)
GUICtrlSetFont(-1, 24, 800)
GUICtrlSetColor(-1, 0xEEEEEE)
Global $BtnExit = GUICtrlCreateButton("Beenden", 150, 256, 100, 25)
Global $BtnMinimize = GUICtrlCreateButton("Minimieren", 260, 256, 100, 25)
GUISetState(@SW_SHOW, $Gui)
GUISetState(@SW_SHOW, $Child)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE, $BtnExit
ExitLoop
Case $BtnMinimize
WinSetState($Gui, "", @SW_MINIMIZE)
EndSwitch
WEnd
_GDIPlus_Shutdown()
GUIDelete($Gui)
GUIDelete($Child)
Alles anzeigen
Ich hoffe ihr könnt mir weiterhelfen