Solution Nine Posted February 16 Author Solution Posted February 16 Solve possible crash after deletion. New version available pat4005 and Qwerty212 1 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
WildByDesign Posted Tuesday at 11:35 PM Posted Tuesday at 11:35 PM I just came across this UDF now. I am really impressed with how low the CPU usage is. My first thought was to combine this UDF with an example from Move window behind desktop icons thread which puts an image above the desktop wallpaper but below the desktop icons; within Progman under a WorkerW window. It actually works quite well and was easy to do. I stretched the background image to fit the current desktop resolution. However, I was also hoping to be able to stretch the animated Gif as well. I understand that your UDF comments clearly state "(must be the actual size of the GIF)" for the height and width. Would it be technically possible and would you be willing to add an option to resize the dimensions of the Gif similar to how your example script uses _GDIPlus_ImageResize() to resize the background image? Anyway, here is what I have working so far if you want to mess around with it: expandcollapse popup;Code by UEZ build 2025-07-18 beta #include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPIGdi.au3> #include <Array.au3> #include <GDIPlus.au3> #include "Cached GIF Animation.au3" OnAutoItExitRegister(_GIF_Animation_Quit) DllCall("User32.dll", "bool", "SetProcessDpiAwarenessContext" , "HWND", "DPI_AWARENESS_CONTEXT" -4) Global $aPrimary = GetPrimaryMonitorCoords() If @error Then Exit MsgBox(16, "Error", "Unable to get primary monitor") Global $hProgman = WinGetHandle("[CLASS:Progman]"), $hWorkerW, $i If Not $hProgman Then Exit MsgBox(16, "ERROR", "Couldn't find Progman", 30) _WinAPI_SendMessageTimeout($hProgman, 0x052C, 13, 1, 250, $SMTO_NORMAL) #cs _GDIPlus_Startup() Local $sFile = "C:\Program Files (x86)\AutoIt3\Examples\GUI\logo4.gif" Local $hImage = _GDIPlus_ImageLoadFromFile($sFile) ;create an image object based on a file #ce Global $hWorkerW = _WinAPI_FindWindowEx($hProgman, 0, "WorkerW", "") If $hWorkerW = 0 Then Exit MsgBox(16, "ERROR", "Couldn't find WorkerW under Progman", 30) Local $aOrigin = GetDesktopOrigin() Local $iX = $aPrimary[0] - $aOrigin[0] Local $iY = $aPrimary[1] - $aOrigin[1] Global $hGUI = GUICreate("GUI behind Desktop icons", $aPrimary[4], $aPrimary[5], $iX, $iY, $WS_POPUP, $WS_EX_TOOLWINDOW) ;GUISetBkColor(0xff00ff) ;GUICtrlCreatePic("D:\Tools\PublicDomainTray\Rectify11TrayTool\.bordercolor\Source\aero.jpg", 0, 0, $aPrimary[4], $aPrimary[5]) Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) Local $hOrig = _GDIPlus_ImageLoadFromFile("bg.png") Local $hImage = _GDIPlus_ImageResize($hOrig, $aPrimary[4], $aPrimary[5]) _GDIPlus_ImageDispose($hOrig) _WinAPI_SetParent($hGUI, $hWorkerW) _WinAPI_SetWindowPos($hGUI, $HWND_BOTTOM, 0, 0, 0, 0, BitOR($SWP_NOMOVE, $SWP_NOSIZE, $SWP_NOACTIVATE)) _WinAPI_SetWindowLong($hGUI, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($hGUI, $GWL_EXSTYLE), $WS_EX_LAYERED, $WS_EX_TRANSPARENT)) _WinAPI_SetLayeredWindowAttributes($hGUI, 0, 180, $LWA_ALPHA) GUISetState(@SW_SHOWNOACTIVATE, $hGUI) _GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage, 0, 0, $aPrimary[4], $aPrimary[5]) _GUICtrlCreateAnimGIF("Counter.gif", 0, 0, 285, 280, -1, -1, False, $hImage, True) #cs _GDIPlus_Startup() ;Global $sFile = "c:\windows\web\screen\img101.jpg" Global $sFile = "D:\Tools\PublicDomainTray\Rectify11TrayTool\.bordercolor\Source\aero.jpg" Global $hImage = _GDIPlus_ImageLoadFromFile($sFile) Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) GUISetState(@SW_SHOWNOACTIVATE, $hGUI) Global $hEffect = _GDIPlus_EffectCreateBlur(10, True) _GDIPlus_BitmapApplyEffect($hImage, $hEffect) _GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage, 0, 0, $aPrimary[4], $aPrimary[5]) #ce #cs Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;create a Graphics object from a window handle _GDIPlus_GraphicsClear($hGraphics, 0xFF000000) ;clear graphic handle with dark grey (background) _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;sets the graphics object rendering quality (antialiasing) Local $hTexture = _GDIPlus_TextureCreate2($hImage, 5, 4, 59, 59) ;create texture brush only from a defined rectangle _GDIPlus_GraphicsFillRect($hGraphics, 0, 0, $aPrimary[4], $aPrimary[5], $hTexture) #ce While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd #cs ;cleanup resources _GDIPlus_BrushDispose($hTexture) _GDIPlus_ImageDispose($hImage) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() #ce #cs _GDIPlus_EffectDispose($hEffect) _GDIPlus_ImageDispose($hImage) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() #ce _GDIPlus_ImageDispose($hImage) _GDIPlus_GraphicsDispose($hGraphics) GUIDelete($hGUI) Func _WinAPI_FindWindowEx($hParent, $hAfter, $sClass, $sTitle = "") Local $ret = DllCall("user32.dll", "hwnd", "FindWindowExW", "hwnd", $hParent, "hwnd", $hAfter, "wstr", $sClass, "wstr", $sTitle) If @error Or Not IsArray($ret) Then Return 0 Return $ret[0] EndFunc ;==>_WinAPI_FindWindowEx Func GetPrimaryMonitorCoords() Local $tPoint = DllStructCreate("int x;int y") $tPoint.x = 0 $tPoint.y = 0 Local $hMonitor = _WinAPI_MonitorFromPoint($tPoint, $MONITOR_DEFAULTTOPRIMARY) If Not $hMonitor Then Return SetError(1, 0, 0) Local $tMI = DllStructCreate("dword cbSize;long rcMonitor[4];long rcWork[4];dword dwFlags") DllStructSetData($tMI, "cbSize", DllStructGetSize($tMI)) Local $aCall = DllCall("user32.dll", "bool", "GetMonitorInfoW", "handle", $hMonitor, "ptr", DllStructGetPtr($tMI)) If @error Or Not $aCall[0] Then Return SetError(2, 0, 0) Local $iLeft = $tMI.rcMonitor(1) Local $iTop = $tMI.rcMonitor(2) Local $iRight = $tMI.rcMonitor(3) Local $iBottom = $tMI.rcMonitor(4) Local $iWidth = $iRight - $iLeft Local $iHeight = $iBottom - $iTop Local $a[6] = [$iLeft, $iTop, $iRight, $iBottom, $iWidth, $iHeight] Return $a EndFunc ;==>GetPrimaryMonitorCoords Func GetDesktopOrigin() Local $minX = 0, $minY = 0, $x, $y Local $i = 0, $tDevice, $aRet, $tDevMode, $aED While True $tDevice = DllStructCreate("dword cb; char DeviceName[32]; char DeviceString[128]; dword StateFlags; char DeviceID[128]; char DeviceKey[128]") $tDevice.cb = DllStructGetSize($tDevice) $aRet = DllCall("user32.dll", "bool", "EnumDisplayDevicesA", "ptr", 0, "dword", $i, "ptr", DllStructGetPtr($tDevice), "dword", 0) If @error Or Not $aRet[0] Then ExitLoop If BitAND($tDevice.StateFlags, 1) Then $tDevMode = DllStructCreate( _ "byte dmDeviceName[32]; word dmSpecVersion; word dmDriverVersion; word dmSize; word dmDriverExtra; dword dmFields;" & _ "long dmPositionX; long dmPositionY; dword dmDisplayOrientation; dword dmDisplayFixedOutput;" & _ "short dmColor; short dmDuplex; short dmYResolution; short dmTTOption; short dmCollate; char dmFormName[32];" & _ "ushort dmLogPixels; dword dmBitsPerPel; dword dmPelsWidth; dword dmPelsHeight;" & _ "dword dmDisplayFlags; dword dmDisplayFrequency; dword dmICMMethod; dword dmICMIntent;" & _ "dword dmMediaType; dword dmDitherType; dword dmReserved1; dword dmReserved2; dword dmPanningWidth; dword dmPanningHeight") $tDevMode.dmSize = DllStructGetSize($tDevMode) $aED = DllCall("user32.dll", "bool", "EnumDisplaySettingsA", "str", $tDevice.DeviceName, "dword", -1, "ptr", DllStructGetPtr($tDevMode)) If Not @error And $aED[0] Then $x = $tDevMode.dmPositionX $y = $tDevMode.dmPositionY If $x < $minX Then $minX = $x If $y < $minY Then $minY = $y EndIf EndIf $i += 1 WEnd Local $a[2] = [$minX, $minY] Return $a EndFunc ;==>GetDesktopOrigin Parsix 1
UEZ Posted 22 hours ago Posted 22 hours ago When you parse the GIF anim you will get a handle to the current frame which you can resize and display appropriatly. WildByDesign and Parsix 1 1 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now