-
Posts
7,479 -
Joined
-
Last visited
-
Days Won
95
UEZ last won the day on April 2
UEZ had the most liked content!
About UEZ

- Birthday 12/03/2007
Profile Information
-
Member Title
Never say never
-
Location
Germany
-
Interests
Computer, watching movies, football (soccer), being lazy :-)
UEZ's Achievements
-
You actually specified the file size above, so the question was unnecessary. For high-resolution video recordings, you shouldn't enable in-memory decoding. The script roughly checks whether there is enough memory for the decompression in the memory. If not, playback is skipped. The lower the quality and bitrate settings are, the faster the encoding speed, but the lower the recording quality. I need to figure out how to use other codecs for full-screen video recordings. WebP isn't really suitable for that.
-
UEZ reacted to a post in a topic:
DLL Call Problems
-
@Werty Estimated FPS is only an indicator not real FPS because WebP uses delta frames that means only the differences will be saved. When nothing is changing no additional frames will be saved. Probably WebP codec is not designed for realtime recording, especially for large screens. Wondering why it fails at 3840 x 2160. When save fails the webp dll returns a negative value which should be displayed when recording has finished. @AndyG obviously all frames couldn't extracted to memory -> probably out of memory or WebPMalloc() cannot handle it - it needs several gigs of memory for this screen resolution. Is the recording saved? Thank you all three for testing!
-
UEZ reacted to a post in a topic:
DLL Call Problems
-
UEZ reacted to a post in a topic:
DLL Call Problems
-
UEZ reacted to a post in a topic:
DLL Call Problems
-
The C++ DLL now works perfectly, at least on my system. Could someone please test the WebP example “Example09.1.au3”, which can be found here? -> WebP.7z. Requires Windows10 build 18362+. It should work on both architectures—x86 and x64. It records for 10 seconds at 30 FPS; at least, that’s the goal. Please run the script via SciTE, select the entire primary monitor, and start recording. As soon as the yellow rectangle appears, recording begins. If possible, it would be great to see the utilization level in the GPU monitor. In theory, the recording should use the GPU. You can use Process Explorer from Sysinternals to see GPU. Once the recording is complete, a summary should appear in the SciTE console, similar to the one shown here: ... Animation file size: 56571058 bytes Dimension: 1920 x 1080 Frame count: 158 Duration: 10046 ms Estimated FPS: 15.7276527971332 CPU: Intel Core Ultra 5 135U GPU: Intel(R) Graphics Can you post your result here? Which CPU / Gfx card you have used for testing? Thanks.
-
UEZ reacted to a post in a topic:
ITaskbarList4 interface
-
Davidyese reacted to a post in a topic:
Fake checkbox's
-
argumentum reacted to a post in a topic:
Fake checkbox's
-
WildByDesign reacted to a post in a topic:
Fake checkbox's
-
ioa747 reacted to a post in a topic:
Fake checkbox's
-
UEZ reacted to a post in a topic:
Fake checkbox's
-
How about colored checkboxes? ;Coded by UEZ build 2026-04-07 ;Direct2D code by Eukalyptus / trancexx ;Proof of concept version #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPIGdi.au3> #region D2D init If @OSBuild < 9600 Then Exit MsgBox($MB_ICONERROR, "ERROR", "Windows 8.1 or higher required!", 30) Global Const $WICERR_NOOBJ = 0x800710D8 Global Const $sGUID_WICPixelFormat32bppPBGRA = "{6fddc324-4e03-4bfe-b185-3d77768dc910}" Global Const $sCLSID_WICImagingFactory = "{cacaf262-9370-4615-a13b-9f5539da4c0a}" Global Const $sIID_IWICImagingFactory = "{ec5ec8a9-c395-4314-9c77-54d7a935ff70}" Global Const $sIID_IWICBitmap = "{00000121-a8f2-4877-ba0a-fd2b6645fb94}" Global Const $tagIWICBitmapSource = "GetSize hresult(uint*;uint*);" & "GetPixelFormat hresult(struct*);" & "GetResolution hresult(double*;double*);" & "CopyPalette hresult(struct*);" & "CopyPixels hresult(struct*;uint;uint;struct*);" Global Const $tagIWICImagingFactory = "CreateDecoderFromFilename hresult(wstr;struct*;uint;uint;ptr*);" & "CreateDecoderFromStream hresult(struct*;struct*;uint;ptr*);" & "CreateDecoderFromFileHandle hresult(handle;struct*;uint;ptr*);" & "CreateComponentInfo hresult(struct*;ptr*);" & "CreateDecoder hresult(struct*;struct*;ptr*);" & "CreateEncoder hresult(struct*;struct*;ptr*);" & "CreatePalette hresult(ptr*);" & "CreateFormatConverter hresult(ptr*);" & "CreateBitmapScaler hresult(ptr*);" & "CreateBitmapClipper hresult(ptr*);" & "CreateBitmapFlipRotator hresult(ptr*);" & "CreateStream hresult(ptr*);" & "CreateColorContext hresult(ptr*);" & "CreateColorTransformer hresult(ptr*);" & "CreateBitmap hresult(uint;uint;struct*;uint;ptr*);" & "CreateBitmapFromSource hresult(struct*;uint;ptr*);" & "CreateBitmapFromSourceRect hresult(struct*;uint;uint;uint;uint;ptr*);" & "CreateBitmapFromMemory hresult(uint;uint;struct*;uint;uint;struct*;ptr*);" & "CreateBitmapFromHBITMAP hresult(handle;handle;uint;ptr*);" & "CreateBitmapFromHICON hresult(handle;ptr*);" & "CreateComponentEnumerator hresult(uint;uint;ptr*);" & "CreateFastMetadataEncoderFromDecoder hresult(struct*;ptr*);" & "CreateFastMetadataEncoderFromFrameDecode hresult(struct*;ptr*);" & "CreateQueryWriter hresult(struct*;struct*;ptr*);" & "CreateQueryWriterFromReader hresult(struct*;struct*;ptr*);" Global Const $tagIWICBitmap = $tagIWICBitmapSource & "Lock hresult(struct*;uint;ptr*);" & "SetPalette hresult(struct*);" & "SetResolution hresult(double;double);" Global Const $DWRITEERR_NOOBJ = 0x800710D8 Global Const $sIID_IDWriteFactory = "{b859ee5a-d838-4b5b-a2e8-1adc7d93db48}" Global Const $sIID_IDWriteTextFormat = "{9c906818-31d7-4fd3-a151-7c5e225db55a}" Global Const $tagIDWriteFactory = "GetSystemFontCollection hresult(ptr*;bool);" & "CreateCustomFontCollection hresult(struct*;struct*;uint;ptr*);" & "RegisterFontCollectionLoader hresult(struct*);" & "UnregisterFontCollectionLoader hresult(struct*);" & "CreateFontFileReference hresult(wstr;struct*;ptr*);" & "CreateCustomFontFileReference hresult(struct*;uint;struct*;ptr*);" & "CreateFontFace hresult(uint;uint;struct*;uint;uint;ptr*);" & "CreateRenderingParams hresult(ptr*);" & "CreateMonitorRenderingParams hresult(handle;ptr*);" & "CreateCustomRenderingParams hresult(float;float;float;uint;uint;ptr*);" & "RegisterFontFileLoader hresult(struct*);" & "UnregisterFontFileLoader hresult(struct*);" & "CreateTextFormat hresult(wstr;struct*;uint;uint;uint;float;wstr;ptr*);" & "CreateTypography hresult(ptr*);" & "GetGdiInterop hresult(ptr*);" & "CreateTextLayout hresult(wstr;uint;struct*;float;float;ptr*);" & "CreateGdiCompatibleTextLayout hresult(wstr;uint;struct*;float;float;float;struct*;bool;ptr*);" & "CreateEllipsisTrimmingSign hresult(struct*;ptr*);" & "CreateTextAnalyzer hresult(ptr*);" & "CreateNumberSubstitution hresult(uint;wstr;bool;ptr*);" & "CreateGlyphRunAnalysis hresult(struct*;float;struct*;uint;uint;float;float;ptr*);" Global Const $tagIDWriteTextFormat = "SetTextAlignment hresult(uint);" & "SetParagraphAlignment hresult(uint);" & "SetWordWrapping hresult(uint);" & "SetReadingDirection hresult(uint);" & "SetFlowDirection hresult(uint);" & "SetIncrementalTabStop hresult(float);" & "SetTrimming hresult(struct*;ptr*);" & "SetLineSpacing hresult(uint;float;float);" & "GetTextAlignment uint();" & "GetParagraphAlignment uint();" & "GetWordWrapping uint();" & "GetReadingDirection uint();" & "GetFlowDirection uint();" & "GetIncrementalTabStop float();" & "GetTrimming hresult(struct*;ptr*);" & "GetLineSpacing hresult(uint*;float*float*);" & "GetFontCollection hresult(ptr*);" & "GetFontFamilyNameLength uint(wstr;uint);" & "GetFontFamilyName hresult();" & "GetFontWeight uint();" & "GetFontStyle uint();" & "GetFontStretch uint();" & "GetFontSize float();" & "GetLocaleNameLength uint();" & "GetLocaleName hresult(wstr;uint);" Global Const $D2DERR_NOOBJ = 0x800710D8 Global Const $D2DERR_UFAIL = 0x8000FFFF Global Const $tagD2D1_MATRIX_3X2_F = "struct; float M11; float M12; float M21; float M22; float M31; float M32; endstruct;" Global Const $tagD2D1_COLOR_F = "struct; float R; float G; float B; float A; endstruct;" Global Const $tagD2D1_RECT_F = "struct; float Left; float Top; float Right; float Bottom; endstruct;" Global Const $tagD2D1_BRUSH_PROPERTIES = "struct; float Opacity; float M11; float M12; float M21; float M22; float M31; float M32; endstruct;" Global Const $tagD2D1_RENDER_TARGET_PROPERTIES = "struct; uint Type; uint PixelFormat; uint AlphaMode; float DpiX; float DpiY; uint Usage; uint MinLevel; endstruct;" Global Const $sIID_ID2D1SolidColorBrush = "{2cd906a9-12e2-11dc-9fed-001143a055f9}" Global Const $sIID_ID2D1RenderTarget = "{2cd90694-12e2-11dc-9fed-001143a055f9}" Global Const $sIID_ID2D1Factory = "{06152247-6f50-465a-9245-118bfd3b6007}" Global Const $tagID2D1Resource = "GetFactory none(ptr*);" Global Const $tagID2D1Brush = $tagID2D1Resource & "SetOpacity none(float);" & "SetTransform none(struct*);" & "GetOpacity float();" & "GetTransform none(struct*);" Global Const $tagID2D1SolidColorBrush = $tagID2D1Brush & "SetColor none(struct*);" & "GetColor ptr(struct*);" Global Const $tagID2D1RenderTarget = $tagID2D1Resource & "CreateBitmap hresult(struct;struct*;uint;struct*;ptr*);" & "CreateBitmapFromWicBitmap hresult(struct*;struct*;ptr*);" & "CreateSharedBitmap hresult(struct*;struct*;struct*;ptr*);" & "CreateBitmapBrush hresult(struct*;struct*;struct*;ptr*);" & "CreateSolidColorBrush hresult(struct*;struct*;ptr*);" & "CreateGradientStopCollection hresult(struct*;uint;uint;uint;ptr*);" & "CreateLinearGradientBrush hresult(struct*;struct*;struct*;ptr*);" & "CreateRadialGradientBrush hresult(struct*;struct*;struct*;ptr*);" & "CreateCompatibleRenderTarget hresult(struct*;struct*;struct*;uint;ptr*);" & "CreateLayer hresult(struct*;ptr*);" & "CreateMesh hresult(ptr*);" & "DrawLine none(struct;struct;struct*;float;struct*);" & "DrawRectangle none(struct*;struct*;float;struct*);" & "FillRectangle none(struct*;struct*);" & "DrawRoundedRectangle none(struct*;struct*;float;struct*);" & "FillRoundedRectangle none(struct*;struct*);" & "DrawEllipse none(struct*;struct*;float;struct*);" & "FillEllipse none(struct*;struct*);" & "DrawGeometry none(struct*;struct*;float;struct*);" & "FillGeometry none(struct*;struct*;struct*);" & "FillMesh none(struct*;struct*);" & "FillOpacityMask none(struct*;struct*;uint;struct*;struct*);" & "DrawBitmap none(struct*;struct*;float;uint;struct*);" & "DrawText none(wstr;uint;struct*;struct*;struct*;uint;uint);" & "DrawTextLayout none(struct;struct*;struct*;uint);" & "DrawGlyphRun none(struct;struct*;struct*;uint);" & "SetTransform none(struct*);" & "GetTransform none(struct*);" & "SetAntialiasMode none(uint);" & "GetAntialiasMode uint();" & "SetTextAntialiasMode none(uint);" & "GetTextAntialiasMode uint();" & "SetTextRenderingParams none(struct*);" & "GetTextRenderingParams none(ptr*);" & "SetTags none(uint64;uint64);" & "GetTags none(uint64*;uint64*);" & "PushLayer none(struct*;struct*);" & "PopLayer none();" & "Flush hresult(uint64*;uint64*);" & "SaveDrawingState none(struct*);" & "RestoreDrawingState none(struct*);" & "PushAxisAlignedClip none(struct*;uint);" & "PopAxisAlignedClip none();" & "Clear none(struct*);" & "BeginDraw none();" & "EndDraw hresult(uint64*;uint64*);" & "GetPixelFormat ptr(struct*);" & "SetDpi none(float;float);" & "GetDpi none(float*;float*);" & "GetSize ptr(struct*);" & "GetPixelSize ptr(struct*);" & "GetMaximumBitmapSize uint();" & "IsSupported bool(struct*);" Global Const $tagID2D1Factory = "ReloadSystemMetrics hresult();" & "GetDesktopDpi none(float*;float*);" & "CreateRectangleGeometry hresult(struct*;ptr*);" & "CreateRoundedRectangleGeometry hresult(struct*;ptr*);" & "CreateEllipseGeometry hresult(struct*;ptr*);" & "CreateGeometryGroup hresult(uint;struct*;uint;ptr*);" & "CreateTransformedGeometry hresult(struct*;struct*;ptr*);" & "CreatePathGeometry hresult(ptr*);" & "CreateStrokeStyle hresult(struct*;struct*;uint;ptr*);" & "CreateDrawingStateBlock hresult(struct*;struct*;ptr*);" & "CreateWicBitmapRenderTarget hresult(struct*;struct*;ptr*);" & "CreateHwndRenderTarget hresult(struct*;struct*;ptr*);" & "CreateDxgiSurfaceRenderTarget hresult(struct*;struct*;ptr*);" & "CreateDCRenderTarget hresult(struct*;ptr*);" Global Const $D2D1_TEXT_ANTIALIAS_MODE_DEFAULT = 0 Global Const $D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE = 1 Global Const $D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE = 2 Global Const $D2D1_TEXT_ANTIALIAS_MODE_ALIASED = 3 Global Const $DWRITE_TEXT_ALIGNMENT_LEADING = 0 Global Const $DWRITE_TEXT_ALIGNMENT_TRAILING = 1 Global Const $DWRITE_TEXT_ALIGNMENT_CENTER = 2 Global Const $DWRITE_PARAGRAPH_ALIGNMENT_NEAR = 0 Global Const $DWRITE_PARAGRAPH_ALIGNMENT_FAR = 1 Global Const $DWRITE_PARAGRAPH_ALIGNMENT_CENTER = 2 Global Const $D2D1_ANTIALIAS_MODE_PER_PRIMITIVE = 0 Global Const $D2D1_ANTIALIAS_MODE_ALIASED = 1 Global Const $D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT = 4 Global Const $DWRITE_MEASURING_MODE_NATURAL = 0 Global Const $__g_hD2D1DLL = DllOpen("d2d1.dll") Global Const $__g_hDWriteDLL = DllOpen("dwrite.dll") Global $oD2DFactory = _D2D_Factory_Create() If Not IsObj($oD2DFactory) Then MsgBox(16, "Error", "Failed to create D2D Factory!") Exit EndIf Global $oWICFactory = _WIC_ImagingFactory_Create() If Not IsObj($oWICFactory) Then MsgBox(16, "Error", "Failed to create WIC Imaging Factory!") Exit EndIf Global $oDWriteFactory = _DWrite_Factory_Create() If Not IsObj($oDWriteFactory) Then MsgBox(16, "Error", "Failed to create DWrite Factory!") Exit EndIf #EndRegion _GDIPlus_Startup() Global $hBmpUnchecked1 = D2D1_RenderEmojiToGDIpBitmap($oD2DFactory, $oWICFactory, $oDWriteFactory, "🔲", 16) Global $hBmpChecked1 = D2D1_RenderEmojiToGDIpBitmap($oD2DFactory, $oWICFactory, $oDWriteFactory, "✅", 16) Global $hBmpUnchecked2 = D2D1_RenderEmojiToGDIpBitmap($oD2DFactory, $oWICFactory, $oDWriteFactory, "⬛", 16) Global $hBmpChecked2 = D2D1_RenderEmojiToGDIpBitmap($oD2DFactory, $oWICFactory, $oDWriteFactory, "☑️", 16) Global $hGUI = GUICreate("Custom Checkbox using colored Emojis by UEZ", 237, 143) GUISetBkColor(0x282828) Global $bState1 = False Global $Pic1 = GUICtrlCreatePic("", 8, 8, 16, 16) GUICtrlSendMsg($Pic1, 0x0172, $IMAGE_BITMAP, $hBmpUnchecked1) Global $Label1 = GUICtrlCreateLabel("Checkbox1", 28, 8, 97, 17) GUICtrlSetColor(-1, 0xF0F0F0) GUICtrlSetCursor($Pic1, 0) GUICtrlSetCursor($Label1, 0) Global $bState2 = True Global $Pic2 = GUICtrlCreatePic("", 8, 40, 16, 16) GUICtrlSendMsg($Pic2, 0x0172, $IMAGE_BITMAP, $hBmpUnchecked2) Global $Label2 = GUICtrlCreateLabel("Checkbox2", 28, 40, 97, 17) GUICtrlSetColor(-1, 0xF0F0F0) GUICtrlSetCursor($Pic2, 0) GUICtrlSetCursor($Label2, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _WinAPI_DeleteObject($hBmpChecked1) _WinAPI_DeleteObject($hBmpUnchecked1) _WinAPI_DeleteObject($hBmpChecked2) _WinAPI_DeleteObject($hBmpUnchecked2) _GDIPlus_Shutdown() Exit Case $Pic1, $Label1 $bState1 = Not $bState1 If $bState1 Then GUICtrlSendMsg($Pic1, 0x0172, $IMAGE_BITMAP, $hBmpChecked1) Else GUICtrlSendMsg($Pic1, 0x0172, $IMAGE_BITMAP, $hBmpUnchecked1) EndIf Case $Pic2, $Label2 $bState2 = Not $bState2 If $bState2 Then GUICtrlSendMsg($Pic2, 0x0172, $IMAGE_BITMAP, $hBmpChecked2) Else GUICtrlSendMsg($Pic2, 0x0172, $IMAGE_BITMAP, $hBmpUnchecked2) EndIf EndSwitch WEnd #Region D2D functions Func D2D1_RenderEmojiToGDIpBitmap($oD2DFactory, $oWICFactory, $oDWriteFactory, $sEmoji, $iSize, $bGDI = True) Local $oWICBitmap = _WIC_ImagingFactory_CreateBitmap($oWICFactory, $iSize, $iSize, $sGUID_WICPixelFormat32bppPBGRA, 0x1) If Not IsObj($oWICBitmap) Then Return SetError(-1, 0, 0) Local $oRenderTarget = _D2D_Factory_CreateWicBitmapRenderTarget($oD2DFactory, $oWICBitmap) If Not IsObj($oRenderTarget) Then $oWICBitmap = 0 Return SetError(-2, 0, 0) EndIf Local $oTextFormat = _DWrite_Factory_CreateTextFormat($oDWriteFactory, "Arial", $iSize * 0.75) If Not IsObj($oTextFormat) Then $oRenderTarget = 0 $oWICBitmap = 0 Return SetError(-3, 0, 0) EndIf $oTextFormat.SetTextAlignment($DWRITE_TEXT_ALIGNMENT_CENTER) $oTextFormat.SetParagraphAlignment($DWRITE_PARAGRAPH_ALIGNMENT_CENTER) $oRenderTarget.SetTextAntialiasMode($D2D1_TEXT_ANTIALIAS_MODE_ALIASED) $oRenderTarget.SetAntialiasMode($D2D1_ANTIALIAS_MODE_ALIASED) $oRenderTarget.BeginDraw() _D2D_RenderTarget_Clear($oRenderTarget, 0, 0, 0, 0) Local $oBrush = _D2D_RenderTarget_CreateSolidColorBrush($oRenderTarget, 0, 0, 0, 0) $oRenderTarget.DrawText($sEmoji, StringLen($sEmoji), $oTextFormat, _D2D1_RECT_F(0, 0, $iSize, $iSize), $oBrush, $D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT, $DWRITE_MEASURING_MODE_NATURAL) $oRenderTarget.EndDraw(Null, Null) Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iSize, $iSize, $GDIP_PXF32ARGB) If Not $hBitmap Then $oBrush = 0 $oTextFormat = 0 $oRenderTarget = 0 $oWICBitmap = 0 Return SetError(-4, 0, 0) EndIf Local $tBitmapData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, $iSize, $iSize, $GDIP_ILMWRITE, $GDIP_PXF32ARGB) Local $pScan0 = $tBitmapData.Scan0 Local $iStride = BitAND(($iSize * 4 + 3), 0xFFFFFFFC) ;$iSize * 4 Local $tRect = DllStructCreate($tagRECT) $tRect.Left = 0 $tRect.Top = 0 $tRect.Right = $iSize $tRect.Bottom = $iSize $oWICBitmap.CopyPixels($tRect, $iStride, $iStride * $iSize, $pScan0) _GDIPlus_BitmapUnlockBits($hBitmap, $tBitmapData) $oBrush = 0 $oTextFormat = 0 $oRenderTarget = 0 $oWICBitmap = 0 If $bGDI Then Local $hGDI_Bmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) If @error Or Not $hGDI_Bmp Then _GDIPlus_ImageDispose($hBitmap) Return SetError(-4, 0, 0) EndIf _GDIPlus_ImageDispose($hBitmap) Return $hGDI_Bmp EndIf Return $hBitmap EndFunc ;==>D2D1_RenderEmojiToGDIpBitmap Func _WIC_ImagingFactory_Create() Local $oObj = ObjCreateInterface($sCLSID_WICImagingFactory, $sIID_IWICImagingFactory, $tagIWICImagingFactory) If Not IsObj($oObj) Then Return SetError(0x80080001, 0, False) Return $oObj EndFunc ;==>_WIC_ImagingFactory_Create Func _WIC_ImagingFactory_CreateBitmap(Const ByRef $oIImagingFactory, $iWidth, $iHeight, $sPixelFormat = $sGUID_WICPixelFormat32bppPBGRA, $iOption = 0x2) If Not IsObj($oIImagingFactory) Then Return SetError($WICERR_NOOBJ, 0, False) Local $tGUID = _WinAPI_GUIDFromString($sPixelFormat) If @error Or Not IsDllStruct($tGUID) Then Return SetError(0x80070057, 1, False) Local $pBitmap Local $iHResult = $oIImagingFactory.CreateBitmap($iWidth, $iHeight, $tGUID, $iOption, $pBitmap) If $iHResult Or Not $pBitmap Then Return SetError($iHResult, 2, False) Local $oBitmap = ObjCreateInterface($pBitmap, $sIID_IWICBitmap, $tagIWICBitmap) If Not IsObj($oBitmap) Then Return SetError(0x80080001, 3, False) Return $oBitmap EndFunc ;==>_WIC_ImagingFactory_CreateBitmap Func _D2D_Factory_Create() Local $tIID_ID2D1Factory = _WinAPI_GUIDFromString($sIID_ID2D1Factory) Local $aResult = DllCall($__g_hD2D1DLL, "int", "D2D1CreateFactory", "uint", 0, "struct*", $tIID_ID2D1Factory, "uint*", 0, "ptr*", 0) If @error Then Return SetError($D2DERR_UFAIL, 1, False) If $aResult[0] Or Not $aResult[4] Then Return SetError($aResult[0], 2, False) Local $oFactory = ObjCreateInterface($aResult[4], $sIID_ID2D1Factory, $tagID2D1Factory) If Not IsObj($oFactory) Then Return SetError(0x80080001, 3, False) Return $oFactory EndFunc ;==>_D2D_Factory_Create Func _D2D_Factory_CreateWicBitmapRenderTarget(Const ByRef $oIFactory, Const ByRef $oWICBitmap, $iPixelFormat = 87, $iAlphaMode = 1, $fDpiX = 0, $fDpiY = 0, $iUsage = 0x00000000) If Not IsObj($oIFactory) Then Return SetError($D2DERR_NOOBJ, 0, False) If Not IsObj($oWICBitmap) Then Return SetError($D2DERR_NOOBJ, 1, False) Local $tD2D1_RENDER_TARGET_PROPERTIES = _D2D1_RENDER_TARGET_PROPERTIES(1, $iPixelFormat, $iAlphaMode, $fDpiX, $fDpiY, $iUsage, 0) Local $pRenderTarget Local $iHResult = $oIFactory.CreateWicBitmapRenderTarget($oWICBitmap, $tD2D1_RENDER_TARGET_PROPERTIES, $pRenderTarget) If $iHResult Or Not $pRenderTarget Then Return SetError($iHResult, 2, False) Local $oRenderTarget = ObjCreateInterface($pRenderTarget, $sIID_ID2D1RenderTarget, $tagID2D1RenderTarget) If Not IsObj($oRenderTarget) Then Return SetError(0x80080001, 3, False) Return $oRenderTarget EndFunc ;==>_D2D_Factory_CreateWicBitmapRenderTarget Func _D2D_RenderTarget_CreateSolidColorBrush(Const ByRef $oIRenderTarget, $fRed = 0, $fGreen = 0, $fBlue = 0, $fAlpha = 1, $fOpacity = 1) If Not IsObj($oIRenderTarget) Then Return SetError($D2DERR_NOOBJ, 0, False) Local $pSolidColorBrush Local $iHResult = $oIRenderTarget.CreateSolidColorBrush(_D2D1_COLOR_F($fRed, $fGreen, $fBlue, $fAlpha), _D2D1_BRUSH_PROPERTIES($fOpacity), $pSolidColorBrush) If $iHResult Or Not $pSolidColorBrush Then Return SetError($iHResult, 1, False) Local $oSolidColorBrush = ObjCreateInterface($pSolidColorBrush, $sIID_ID2D1SolidColorBrush, $tagID2D1SolidColorBrush) If Not IsObj($oSolidColorBrush) Then Return SetError(0x80080001, 2, False) Return $oSolidColorBrush EndFunc ;==>_D2D_RenderTarget_CreateSolidColorBrush Func _D2D_RenderTarget_Clear(Const ByRef $oIRenderTarget, $fR = 0, $fG = 0, $fB = 0, $fA = 1) If Not IsObj($oIRenderTarget) Then Return SetError($D2DERR_NOOBJ, 0, False) $oIRenderTarget.Clear(_D2D1_COLOR_F($fR, $fG, $fB, $fA)) Return True EndFunc ;==>_D2D_RenderTarget_Clear Func _D2D1_COLOR_F($fR = 0, $fG = 0, $fB = 0, $fA = 1) Local $tStruct = DllStructCreate($tagD2D1_COLOR_F) $tStruct.R = $fR $tStruct.G = $fG $tStruct.B = $fB $tStruct.A = $fA Return $tStruct EndFunc ;==>_D2D1_COLOR_F Func _D2D1_RECT_F($fLeft = 0, $fTop = 0, $fRight = 0, $fBottom = 0) Local $tStruct = DllStructCreate($tagD2D1_RECT_F) $tStruct.Left = $fLeft $tStruct.Top = $fTop $tStruct.Right = $fRight $tStruct.Bottom = $fBottom Return $tStruct EndFunc ;==>_D2D1_RECT_F Func _D2D1_SIZEOF(Const ByRef $sTag) Local $tStruct = DllStructCreate($sTag) Return DllStructGetSize($tStruct) EndFunc ;==>_D2D1_SIZEOF Func _D2D1_BRUSH_PROPERTIES($fOpacity = 0, $tMatrix = Null) Local $tStruct = DllStructCreate($tagD2D1_BRUSH_PROPERTIES) $tStruct.Opacity = $fOpacity If IsDllStruct($tMatrix) Then DllCall("kernel32.dll", "none", "RtlMoveMemory", "struct*", DllStructGetPtr($tStruct) + 4, "struct*", $tMatrix, "ulong_ptr", _D2D1_SIZEOF($tagD2D1_MATRIX_3X2_F)) Else $tStruct.M11 = 1 $tStruct.M22 = 1 EndIf Return $tStruct EndFunc ;==>_D2D1_BRUSH_PROPERTIES Func _D2D1_RENDER_TARGET_PROPERTIES($iType = 2, $iPixelFormat = 0, $iAlphaMode = 0, $fDpiX = 0, $fDpiY = 0, $iUsage = 0x00000000, $iMinLevel = 0) Local $tStruct = DllStructCreate($tagD2D1_RENDER_TARGET_PROPERTIES) $tStruct.Type = $iType $tStruct.PixelFormat = $iPixelFormat $tStruct.AlphaMode = $iAlphaMode $tStruct.DpiX = $fDpiX $tStruct.DpiY = $fDpiY $tStruct.Usage = $iUsage $tStruct.MinLevel = $iMinLevel Return $tStruct EndFunc ;==>_D2D1_RENDER_TARGET_PROPERTIES Func _DWrite_Factory_Create() Local $tIID_IDWriteFactory = _WinAPI_GUIDFromString($sIID_IDWriteFactory) Local $aResult = DllCall($__g_hDWriteDLL, "int", "DWriteCreateFactory", "uint", 0, "struct*", $tIID_IDWriteFactory, "ptr*", 0) If @error Or $aResult[0] Then Return SetError(1, 1, False) Local $oObj = ObjCreateInterface($aResult[3], $sIID_IDWriteFactory, $tagIDWriteFactory) If Not IsObj($oObj) Then Return SetError(0x80080001, 2, False) Return $oObj EndFunc ;==>_DWrite_Factory_Create Func _DWrite_Factory_CreateTextFormat(Const ByRef $oIFactory, $sFontFamilyName = "Arial", $fFontSize = 48, $iFontWeight = 400, $iFontStyle = 0, $iFontStretch = 5, $oFontCollection = Null, $sLocaleName = "en-us") If Not IsObj($oIFactory) Then Return SetError($DWRITEERR_NOOBJ, 0, False) If $oFontCollection <> Null And Not IsObj($oFontCollection) Then Return SetError($DWRITEERR_NOOBJ, 1, False) Local $pTextFormat Local $iHResult = $oIFactory.CreateTextFormat($sFontFamilyName, $oFontCollection, $iFontWeight, $iFontStyle, $iFontStretch, $fFontSize, $sLocaleName, $pTextFormat) If $iHResult Or Not $pTextFormat Then Return SetError($iHResult, 2, False) Local $oTextFormat = ObjCreateInterface($pTextFormat, $sIID_IDWriteTextFormat, $tagIDWriteTextFormat) If Not IsObj($oTextFormat) Then Return SetError(0x80080001, 3, False) Return $oTextFormat EndFunc ;==>_DWrite_Factory_CreateTextFormat #EndRegion Had too much Ouzo? 😉
-
WildByDesign reacted to a post in a topic:
GUIDarkTheme UDF
-
It started with copy / paste and continued without the need of StringLower because string compare is not case sensitive in Autoit -> can be removed to improve performance. I would say use a hybrid approach using one shared function for controls that behave identically and dedicated functions for complex controls like the ListView, TreeView, etc. Messages like WM_MOUSEMOVE or WM_NCHITTEST fire constantly and it doesn't make sense regarding performance to have huge different Case statements for every pixel the mouse moves, Also drawing complex GDI+ functions in WM_PAINT or WM_ERASEBKGND may reduce the overall performance.
-
argumentum reacted to a post in a topic:
GUIDarkTheme UDF
-
WildByDesign reacted to a post in a topic:
SampleControls.au3 in Dark Mode
-
Can you please replace _PaintSizeBox() function with this and test it again? Func _PaintSizeBox($hWnd, $hDC) Local $iWinStyle = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE) ; Only proceed if both horizontal and vertical scrollbars are active If Not (BitAND($iWinStyle, $WS_HSCROLL) And BitAND($iWinStyle, $WS_VSCROLL)) Then Return False ; 1. Retrieve exact Window and Client dimensions Local $tRW = _WinAPI_GetWindowRect($hWnd) Local $tRC = _WinAPI_GetClientRect($hWnd) ; 2. Map Client coordinates to Window-DC space Local $tPoint = DllStructCreate($tagPOINT) $tPoint.X = 0 $tPoint.Y = 0 _WinAPI_ClientToScreen($hWnd, $tPoint) ; Calculate border offsets Local $iOffL = $tPoint.X - $tRW.Left Local $iOffT = $tPoint.Y - $tRW.Top ; Calculate total window dimensions Local $iWinW = $tRW.Right - $tRW.Left Local $iWinH = $tRW.Bottom - $tRW.Top ; 3. Define the SizeBox Rect Local $tCorner = DllStructCreate($tagRECT) ; LEFT/TOP: Start exactly where the client area ends (scrollbar junction) $tCorner.Left = $iOffL + $tRC.Right $tCorner.Top = $iOffT + $tRC.Bottom ; RIGHT/BOTTOM: Align with the inner edge of the window border. $tCorner.Right = $iWinW - $iOffL $tCorner.Bottom = $iWinH - $iOffT ; Adjust for ListView the size of the box If _WinAPI_GetClassName($hWnd) = "SysListView32" Then $tCorner.Right += 1 $tCorner.Bottom += 1 EndIf ; 4. Paint the box using the dark theme color Local $hBrush = _WinAPI_CreateSolidBrush(_ColorToCOLORREF(0xF00000)) ;;$COLOR_TITLE_DARK _WinAPI_FillRect($hDC, $tCorner, $hBrush) _WinAPI_DeleteObject($hBrush) Return True EndFunc ;==>_PaintSizeBox
-
WildByDesign reacted to a post in a topic:
SampleControls.au3 in Dark Mode
-
Please test: <code removed because test only> Since I'm at home (vacation) I cannot properly test DPI behaviour, that's why I marked the size box in red to see if the scaling works correctly when the DPI is changed. Can somebody test and report? Thanks.
-
Good catch - let me try to fix it...
-
UEZ reacted to a post in a topic:
SampleControls.au3 in Dark Mode
-
WildByDesign reacted to a post in a topic:
GUIDarkTheme UDF
-
As far as I'm concerned, the DarkMode project is complete for now. You're well on your way to building a great UDF! Keep it up. That's right. I usually have to switch back and forth between three languages every day, which isn't easy, but there are some great tools out there that make the work easier when it comes to phrasing things. 😉
-
WildByDesign reacted to a post in a topic:
GUIDarkTheme UDF
-
Any control that has its own HWND can be subclassed. WM_NOTIFY is always sent upward - from the control to its parent window. When you subclass the trackbar itself, you're watching messages sent to the trackbar - but WM_NOTIFY from the trackbar is sent away from it, never back into it. The trackbar will never see its own WM_NOTIFY. GUIRegisterMsg works because it hooks into the main GUI window's message pump, which is exactly where those notifications land. You need to attach the subclass proc to the parent HWND (your GUI), not the trackbar: ; Subclass the main GUI window to catch child-control notifications Local $hGUI = GUICreate("Test", 400, 300) Local $hSlider = GUICtrlCreateSlider(10, 10, 200, 30) Local $hSliderHWND = GUICtrlGetHandle($hSlider) _WinAPI_SetWindowSubclass(WinGetHandle($hGUI), $g_pSubclassProc, 1, 0) Then inside _SubclassProc, branch on $hFrom to identify which child sent the notification: ... Case $WM_NOTIFY Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam) Local $hFrom = $tNMHDR.hWndFrom Local $iCode = $tNMHDR.Code Switch StringLower(_WinAPI_GetClassName($hFrom)) Case "sysheader32" ; ... existing header handling Case "msctls_trackbar32" Switch $iCode Case $TRBN_THUMBPOSCHANGING ; handle slider EndSwitch EndSwitch ...
-
It seems to be a problem with GetPrivateProfileStringW which I suppose is internally used. Obviously ANSI and UTF-16 LE with BOM only are supported by this WinAPI call. #include <Array.au3> Local $sPathA, $sPathB, $sPathC, $sPathD, $hFile ; File A - UTF-8-BOM - No Leading LineBreak $sPathA = "C:\Temp\File_UTF-8-BOM_v1.ini" $hFile = FileOpen($sPathA, 2 + 8 + 128) FileWrite($hFile, "[SectionA]" & @CRLF & "Key=Value") FileClose($hFile) ; File B - UTF-8-BOM - Leading LineBreak $sPathB = "C:\Temp\File_UTF-8-BOM_v2.ini" $hFile = FileOpen($sPathB, 2 + 8 + 128) FileWrite($hFile, @CRLF & "[SectionB]" & @CRLF & "Key=Value") FileClose($hFile) ; File C - UTF-8 - No Leading LineBreak $sPathC = "C:\Temp\File_UTF-8_v1.ini" $hFile = FileOpen($sPathC, 2 + 8 + 256) FileWrite($hFile, "[SectionA]" & @CRLF & "Key=Value") FileClose($hFile) ; File D - UTF-8 - Leading LineBreak $sPathD = "C:\Temp\File_UTF-8_v2.ini" $hFile = FileOpen($sPathD, 2 + 8 + 256) FileWrite($hFile, @CRLF & "[SectionB]" & @CRLF & "Key=Value") FileClose($hFile) Local $aSectionA = IniReadSectionNames($sPathA) Local $aSectionB = IniReadSectionNames($sPathB) Local $aSectionC = IniReadSectionNames($sPathC) Local $aSectionD = IniReadSectionNames($sPathD) ConsoleWrite("$aSectionA" & @TAB & UBound($aSectionA) & @CRLF) ConsoleWrite("$aSectionB" & @TAB & UBound($aSectionB) & @CRLF) ConsoleWrite("$aSectionC" & @TAB & UBound($aSectionC) & @CRLF) ConsoleWrite("$aSectionD" & @TAB & UBound($aSectionD) & @CRLF) ConsoleWrite("-------------------------------------------------" & @CRLF) Global $a = _WinAPI_IniReadSection($sPathA) ConsoleWrite("$aSectionA" & @TAB & UBound($a) & @CRLF) Global $b = IniSectionRead($sPathA) ConsoleWrite("$aSectionA" & @TAB & UBound($b) & @CRLF) Exit Func _WinAPI_IniReadSection($sIniFile) If Not FileExists($sIniFile) Then Return SetError(1, 0, 0) Local $iSize = 4096 Local $tBuffer = DllStructCreate("wchar d[" & $iSize & "]") Local $aResult = DllCall("Kernel32.dll", "dword", "GetPrivateProfileStringW", "ptr", Null, "ptr", Null, "wstr", "default", "struct*", $tBuffer, "dword", $iSize, "wstr", $sIniFile) If @error Or Not IsArray($aResult) Then Return SetError(2, 0, 0) If $aResult[0] < 1 Then Return SetError(3, 0, 0) Local $aSections[0] Local $sTemp = "" For $i = 1 To $iSize Local $tChar = DllStructCreate("wchar t", DllStructGetPtr($tBuffer) + ($i - 1) * 2) Local $sChar = $tChar.t If $sChar = Chr(0) Then If $sTemp = "" Then ExitLoop ReDim $aSections[UBound($aSections) + 1] $aSections[UBound($aSections) - 1] = $sTemp $sTemp = "" Else $sTemp &= $sChar EndIf Next Return $aSections EndFunc Func IniSectionRead($sIniFile) Local $hFile = FileOpen($sIniFile, 256) Local $sContent = FileRead($hFile) FileClose($hFile) Local $aLines = StringSplit($sContent, @CRLF, 1) Local $aSections[1] For $i = 1 To $aLines[0] If StringRegExp($aLines[$i], "^\[.+\]$") Then ReDim $aSections[UBound($aSections) + 1] $aSections[UBound($aSections) - 1] = StringMid($aLines[$i], 2, StringLen($aLines[$i]) - 2) EndIf Next $aSections[0] = UBound($aSections) - 1 Return $aSections EndFunc
-
UEZ reacted to a post in a topic:
WebView2AutoIt - AutoIt WebView2 Component (COM Interop)
-
UEZ reacted to a post in a topic:
WebView2AutoIt - AutoIt WebView2 Component (COM Interop)
-
To handle all headers generically you need something like my _SubclassProc() and NM_CUSTOMDRAW notification to manage ListView headers. Since $hWndFrom contains the actual handle of the sending control, the StringLower(_WinAPI_GetClassName($hWndFrom)) = "sysheader32" check automatically matches all ListView headers regardless of how many ListViews you have. If you need per-ListView differentiation, you can check the header's parent: Case "sysheader32" ; Optionally identify which ListView this header belongs to: Local $hParentListView = _WinAPI_GetParent($hFrom) ; Apply different colors per ListView if needed ; Otherwise the generic class name check handles all of them uniformly I hope it helps you.
-
UEZ reacted to a post in a topic:
GUIDarkTheme UDF
-
You can overpaint the size grips in edit, listvew and treeview. I used in my example $WM_PAINT in _SubclassProc function: ... Case $WM_PAINT Local $sClass = StringLower(_WinAPI_GetClassName($hWnd)) If $sClass = "syslistview32" Or $sClass = "systreeview32" Or $sClass = "edit" Then ; hide Sizegrip boxes Local $iRet = _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam) ; Overpaint sizegrip boxes if visible Local $iWinStyle = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE) If BitAND($iWinStyle, $WS_HSCROLL) And BitAND($iWinStyle, $WS_VSCROLL) Then Local $hDC = _WinAPI_GetWindowDC($hWnd) ; GetWindowDC statt GetDC! Local $tWnd = _WinAPI_GetWindowRect($hWnd) Local $tClient = _WinAPI_GetClientRect($hWnd) Local $iScrollW = _WinAPI_GetSystemMetrics($SM_CXVSCROLL) Local $iScrollH = _WinAPI_GetSystemMetrics($SM_CYHSCROLL) ; convert client-area to Window coordinates Local $tPt = DllStructCreate($tagPOINT) $tPt.X = $tClient.right $tPt.Y = $tClient.bottom DllCall("user32.dll", "bool", "ClientToScreen", "hwnd", $hWnd, "struct*", $tPt) ; direct relativ coordinates Local $tCorner = DllStructCreate($tagRECT), $delta = (_WinAPI_GetWindowLong($hWnd, $GWL_EXSTYLE) And $WS_EX_CLIENTEDGE ? 4 : 1) $tCorner.left = $tClient.right + $delta $tCorner.top = $tClient.bottom + $delta $tCorner.right = $tCorner.left + $iScrollW $tCorner.bottom = $tCorner.top + $iScrollH Local $hBrush = _WinAPI_CreateSolidBrush(_ColorToCOLORREF($COLOR_TITLE_DARK)) _WinAPI_FillRect($hDC, $tCorner, $hBrush) _WinAPI_DeleteObject($hBrush) _WinAPI_ReleaseDC($hWnd, $hDC) EndIf Return $iRet Else Return _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam) EndIf ... I didn't test it for DPI <> 1 aka 96 if $tCorner is properly calculated.
-
It seems to work also for child windows: ;Coded by UEZ #include <GUIConstantsEx.au3> #include <GDIPlus.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> AutoItSetOption("GuiOnEventMode", 1) Global Const $DWMWA_REDIRECTIONBITMAP_ALPHA = 39 _GDIPlus_Startup() Global $hImage = _GDIPlus_ImageLoadFromFile("c:\Program Files (x86)\AutoIt3\Examples\GUI\Torus.png") Global $iW = _GDIPlus_ImageGetWidth($hImage) Global $iH = _GDIPlus_ImageGetHeight($hImage) Global $hGfx = _GDIPlus_ImageGetGraphicsContext($hImage) _GDIPlus_GraphicsSetSmoothingMode($hGfx, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsSetTextRenderingHint($hGfx, $GDIP_TEXTRENDERINGHINTANTIALIAS) Global $hBrush = _GDIPlus_BrushCreateSolid(0xA0FFFFFF) Global $hFormat = _GDIPlus_StringFormatCreate() Global $hFamily = _GDIPlus_FontFamilyCreate("Arial") Global $hFont = _GDIPlus_FontCreate($hFamily, 30) Global $tLayout = _GDIPlus_RectFCreate(0, $iH - 100, $iW, 32) _GDIPlus_StringFormatSetAlign($hFormat, 1) _GDIPlus_GraphicsDrawStringEx($hGfx, "Hello world", $hFont, $tLayout, $hFormat, $hBrush) _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_GraphicsDispose($hGfx) Global $hGUI = GUICreate("Parent", 200, 150, 300, 200) Global $hChild = GUICreate("Child", $iW, $iH, -1, -1, $WS_POPUP, $WS_EX_TOOLWINDOW, $hGUI) Global $aCall = DllCall("dwmapi.dll", "long", "DwmSetWindowAttribute", _ "hwnd", $hChild, _ "dword", $DWMWA_REDIRECTIONBITMAP_ALPHA, _ "bool*", True, _ "dword", 4) GUIRegisterMsg($WM_PAINT, "_WM_PAINT") GUISetState(@SW_SHOW, $hGUI) GUISetState(@SW_SHOW, $hChild) GUISetOnEvent($GUI_EVENT_CLOSE, "_Quit") Do Until Not Sleep(100) Func _WM_PAINT($hWnd, $iMsg, $wParam, $lParam) If $hWnd <> $hChild Then Return $GUI_RUNDEFMSG Local $tPS = DllStructCreate($tagPAINTSTRUCT) Local $hDC = _WinAPI_BeginPaint($hWnd, $tPS) Local $hGfx = _GDIPlus_GraphicsCreateFromHDC($hDC) _GDIPlus_GraphicsSetCompositingMode($hGfx, $GDIP_COMPOSITINGMODESOURCECOPY) _GDIPlus_GraphicsSetSmoothingMode($hGfx, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsDrawImageRect($hGfx, $hImage, 0, 0, $iW, $iH) _GDIPlus_GraphicsDispose($hGfx) _WinAPI_EndPaint($hWnd, $tPS) Return 0 EndFunc Func _Quit() GUIRegisterMsg($WM_PAINT, "") _GDIPlus_BitmapDispose($hImage) _GDIPlus_Shutdown() GUIDelete($hGUI) GUIDelete($hChild) Exit EndFunc
-
Seem that it can display GUI with 32bit image with transparency without using WS_EX_LAYERED: ;Coded by UEZ #include <GUIConstantsEx.au3> #include <GDIPlus.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> AutoItSetOption("GuiOnEventMode", 1) Global Const $DWMWA_REDIRECTIONBITMAP_ALPHA = 39 _GDIPlus_Startup() Global $hImage = _GDIPlus_ImageLoadFromFile("c:\Program Files (x86)\AutoIt3\Examples\GUI\Torus.png") Global $iW = _GDIPlus_ImageGetWidth($hImage) Global $iH = _GDIPlus_ImageGetHeight($hImage) Global $hGUI = GUICreate(" DWMWA_REDIRECTIONBITMAP_ALPHA Test", $iW, $iH, -1, -1, $WS_POPUP) Global $aCall = DllCall("dwmapi.dll", "long", "DwmSetWindowAttribute", _ "hwnd", $hGUI, _ "dword", $DWMWA_REDIRECTIONBITMAP_ALPHA, _ "bool*", True, _ "dword", 4) GUISetState() GUIRegisterMsg($WM_PAINT, "_WM_PAINT") GUISetOnEvent($GUI_EVENT_CLOSE, "_Quit") _WinAPI_InvalidateRect($hGUI, 0, True) Do Until Not Sleep(100) Func _WM_PAINT($hWnd, $iMsg, $wParam, $lParam) If $hWnd <> $hGUI Then Return $GUI_RUNDEFMSG Local $tPS = DllStructCreate($tagPAINTSTRUCT) Local $hDC = _WinAPI_BeginPaint($hWnd, $tPS) Local $hGfx = _GDIPlus_GraphicsCreateFromHDC($hDC) _GDIPlus_GraphicsSetCompositingMode($hGfx, $GDIP_COMPOSITINGMODESOURCECOPY) _GDIPlus_GraphicsSetSmoothingMode($hGfx, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsDrawImageRect($hGfx, $hImage, 0, 0, $iW, $iH) _GDIPlus_GraphicsDispose($hGfx) _WinAPI_EndPaint($hWnd, $tPS) Return 0 EndFunc Func _Quit() GUIRegisterMsg($WM_PAINT, "") _GDIPlus_BitmapDispose($hImage) _GDIPlus_Shutdown() GUIDelete($hGUI) Exit EndFunc