Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation since 06/19/2025 in Posts

  1. Jon

    AutoIt v3.3.17.1 Beta

    AutoIt v3.3.17.1 Beta View File 3.3.17.1 (July 08, 2025) (Beta) AutoIt: UDFs: - Fixed: Typo in variable name in Date.au3 introduced in previous beta. 3.3.17.0 (June 29, 2025) (Beta) AutoIt: - Changed: Windows 7/Server 2008 is now the minimum OS version required due to dev environment changes. - Added #3891: DllCall() performance optimisation. - Added: Standard Windows Fonts List for Win10/Win11. - Added #3906: GUICtrlCreateXXX creation in example assign to $idXXX to reflect Ctrl type. - Added: FileGetAttrib() retrieve Join folder (J) as created by FileCreateNTFSLink(). - Added: Split WindowsConstants.u3 in WindowsNotifsConstants.au3, WindowsStylesConstants.au3 and WindowsSysColor.au3. - Added: #3984: GUICtrlSetGraphic() doc precision. - Fixed: Doc Chr(0) handling inside functions. - Fixed #3923: Doc typo in "Send Key List". - Fixed: Regression #3135 handle leak (Thanks Nano, Rudi, Nine). - Fixed #3925: Doc With ... EndWith using DllStruct Type. - Fixed: Links in Tutorials example code (thanks argumentum). Au3info: - Added: Display mouse coordinate mode. - Fixed #3917: Crash under Win7. SciTE-Lite: - Fixed: Folding Fix for #Preprocessor foldblock when followed by a CommentBlock. UDFs: - Added: script examples when running under Win11 with new notepad.exe. - Added: _GUICtrlTreeView_GetItemByIndex() can retrieve handle of the list of main item ($hItem= -1). - Added: _IsPressed() can be called with numeric value as in "WinAPIsvkeysConstants.au3". - Added #3909: _DebugReportData() to report Array column formatted. - Added: libExamples referring MemoWrite() now refer to _MemoWrite() defined in Extras\HelpFileInternals.au3. - Added: _WinAPI_WaitSystemIdle(), _WinAPI_QueryDiskUsage(), _WinAPI_QueryProcessorUsage(), _WinAPI_QueryProcessCycleTime() - Added: Doc _WinAPI_GetWindowSubclass() example (Thanks pixelSearch). - Added: _WinAPI_GetKeyboardLayout() default value for the running thread. - Added: _WinAPI_GetUserDefaultLCID() example. - Added: _WinAPI_GetKeyboardLayoutLocale(). - Added: _WinAPI_GetKeyboardState() example (Thanks AutoXenon). - Added #3932: Try to use file in HelpFile\Extras instead of @ScriptDir. - Added #3934: _WinAPI_SetTimer() example. - Added: _IsPressed() can wait on one of several keys. - Added: _WinAPI_SendInput(). - Added #3960: _Div() integer division. - Added #3963: _WinAPI_OpenEvent(). - Added: _GDIPlus_ImageSaveToFile() doc precision for compression level. - Added: _WinAPI_GetCursorSize() and _WinAPI_SetCursorSize(). - Added: $FOLDERID_Documents Constants in APIShellExConstants.au3. - Added: Support _GUIToolTip*() to be used to external process. - Added: Support _GUICtrlHeader*() to be used to external process. - Added: Support _GUICtrlStatusBar*() to be used to external process. - Added #3988: _WinAPI_GetSystemPowerStatus() return Battery status saver. - Added #3985: _ArrayDisplay() + $WS_EX_TOPMOST. - Added #3991: _SQLite_ForeignKeys() and Add a parameter in _SQLite_Open() to set it also. - Added #3990: _IsPressed() return in @extended if the key is still pressed. - Added: _DebugSetup(..., 1) does not interact with script being debug, Report infos copied to clipboard - Added: _WinAPI_SetWindowTheme() example to demonstrate Checkbox or Radio controls coloring. - Added #3997: _WinAPI_RegisterShellHookWindow() example improvement. - Added #3999: _WinAPI_OemToChar() performance improvement. - Added #3946: _ChooseFont() updated defaults (thanks argumentum). - Added: _DateDiff(), _DateAdd() using array for [days, hours, minutes, seconds]. - Added: _DebugSetup() Type 6, same as 1 but a timeout to close the report log windows. - Fixed #3894: _WinAPI_GetProcessName() returns incorrect result when process ID is invalid. - Fixed: "Then SetError()" in several standard UDF. - Fixed #3921: Missing _GUICtrlStatusBar_SetParts() examples. - Fixed: Doc typo $GPIP_ERR* >> $GDIP_ERR*. - Fixed #3926: _GUICtrlTreeView_SetChildren() not set/reset chidren flag. - Fixed: _WinAPI_DisplayStruct() elements containing chr(124). - Fixed #3945: StringRegExp() /s include VT. - Fixed #3949: _ArrayDisplay() does show multiple subscript of an array. - Fixed #3954: links in libfunction constants. - Fixed: missing doc description $iSubItem = - 1 in _GUICtrlListView_SetItemText(). - Fixed #3959: _WinAPI_ShellUserAuthenticationDlg() example. - Fixed #3975: unrelated link in Pcre doc. - Fixed #3903: _GuiCtrlTab_GetItem() does work on external process. - Fixed #3992: _WinAPI_DwmSetWindowAttribute() does not support all MSDN attributes. - Fixed #4001: _GUICtrlListView_*() example ($tagNMITEMACTIVATE). - Fixed #4003: _ArrayPush() doc precision. - Fixed: _GUICtrlButton_SetSplitInfo() example crash. - Fixed: Support of Notepad under Win11 for _DebugSetup(). - Fixed #4022: Various doc duplicated words. - Fixed #4031: _DebugArrayDisplay() buttons display. - Fixed: _DebugArrayDisplay() not executed if @error on entering ($ARRAYDISPLAY_CHECKERROR if no display wanted on @error). - Fixed #4033: _DateTimeSplit() setting $aTimePart[0] whem no time defined. - Fixed #4024: _DebugSetup(,, 5) (notepad window) not working under Windows 11. - Fixed: _WinAPI_IsElevated() @extended return value (Thanks Argumentum). - Fixed #4039: _GUICtrlTreeView_Delete() with $hWnd. - Fixed #4038: _GUICtrlRichEdit_StreamToFile() extra new paragraph. - Fixed #4029: _Date_Time_SystemTimeToDateTimeStr() Wrong output. - Fixed #4040: _GUICtrlRichEdit_SetZoom() parameter limitation bug. - Fixed #4041: _GUICtrlStatusBar_SetIcon() not shown. Submitter Jon Submitted 07/08/2025 Category Beta  
    10 points
  2. 1.8.5 released! This contains fix for the issue caused by UDF documentation headers with an empty newline in their content, found by @seadoggie01 I also found and fixed a related issue, where the capture regex did not capture the text after the empty newline for the tool-tip content.
    5 points
  3. ... Fun topic ... 🙂 just for fun, here are some tweaks to @argumentum's script above to simulate dragging the window and see the visual effect of the movement under the icons...nice effect. To make the window follow the mouse, press F9 once; to stop the movement, press F9 again. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Version=Beta #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <WinAPISysWin.au3> Opt("MustDeclareVars", True) HotKeySet("{ESC}", Terminate) ;;; https://www.autoitscript.com/forum/topic/212981-move-window-behind-desktop-icons/page/2/#findComment-1544435 HotKeySet('{F9}', F9) ; <-- Global $bFlag = False ; <-- Example() Func Example() Local $hWorkerW = 0, $hProgman = _WinAPI_GetShellWindow() ; WinGetHandle("[CLASS:Progman]") ;~ _SendMessage($hProgman, 0x052C) ; <<<<<< force the creation of a WorkerW handle under Progman ; https://stackoverflow.com/questions/56132584/draw-on-windows-10-wallpaper-in-c ; https://stackoverflow.com/questions/34952967/drawing-to-the-desktop-via-injection ; https://github.com/rocksdanister/lively/issues/2074 _WinAPI_SendMessageTimeout($hProgman, 0x052C, 0, 0, 3000, $SMTO_NORMAL) ; same as _SendMessage() If Not $hWorkerW Then ; dah Local $aEnumWindows = _WinAPI_EnumWindows(False) For $n = 1 To UBound($aEnumWindows) - 1 If $aEnumWindows[$n][1] <> "WorkerW" Then ContinueLoop If _WinAPI_GetParent($aEnumWindows[$n][0]) = $hProgman Then $hWorkerW = $aEnumWindows[$n][0] ExitLoop ; but is likely one at the end of the Z-order EndIf Next EndIf ConsoleWrite("WorkerW = " & $hWorkerW & @CRLF) If Not $hWorkerW Then $hWorkerW = $hProgman Local $hGUI = GUICreate("Overlay", 400, 300, 10, 10) ; , $WS_POPUP, $WS_EX_TOOLWINDOW) GUICtrlCreatePic(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", 0, -1)) & "Examples\GUI\msoobe.jpg", 0, 0, 400, 300) _WinAPI_SetParent($hGUI, $hWorkerW) _WinAPI_SetWindowLong($hGUI, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($hGUI, $GWL_EXSTYLE), $WS_EX_LAYERED)) _WinAPI_SetLayeredWindowAttributes($hGUI, 0, 180) GUISetState(@SW_SHOWNOACTIVATE) While GUIGetMsg() <> $GUI_EVENT_CLOSE If $bFlag Then WinMove($hGUI,'',MouseGetPos(0),MouseGetPos(1)) EndIf WEnd EndFunc ;==>Example Func Terminate() Exit EndFunc ;==>Terminate Func F9() $bFlag = Not $bFlag EndFunc
    4 points
  4. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Version=Beta #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <WinAPISysWin.au3> Opt("MustDeclareVars", True) HotKeySet("{ESC}", Terminate) ;;; https://www.autoitscript.com/forum/topic/212981-move-window-behind-desktop-icons/page/2/#findComment-1544435 Example() Func Example() Local $hWorkerW = 0, $hProgman = _WinAPI_GetShellWindow() ; WinGetHandle("[CLASS:Progman]") ;~ _SendMessage($hProgman, 0x052C) ; <<<<<< force the creation of a WorkerW handle under Progman ; https://stackoverflow.com/questions/56132584/draw-on-windows-10-wallpaper-in-c ; https://stackoverflow.com/questions/34952967/drawing-to-the-desktop-via-injection ; https://github.com/rocksdanister/lively/issues/2074 _WinAPI_SendMessageTimeout($hProgman, 0x052C, 0, 0, 3000, $SMTO_NORMAL) ; same as _SendMessage() If Not $hWorkerW Then ; dah Local $aEnumWindows = _WinAPI_EnumWindows(False) For $n = 1 To UBound($aEnumWindows) - 1 If $aEnumWindows[$n][1] <> "WorkerW" Then ContinueLoop If _WinAPI_GetParent($aEnumWindows[$n][0]) = $hProgman Then $hWorkerW = $aEnumWindows[$n][0] ExitLoop ; but is likely one at the end of the Z-order EndIf Next EndIf ConsoleWrite("WorkerW = " & $hWorkerW & @CRLF) If Not $hWorkerW Then $hWorkerW = $hProgman Local $hGUI = GUICreate("Overlay", 400, 300, 10, 10) ; , $WS_POPUP, $WS_EX_TOOLWINDOW) GUICtrlCreatePic(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", 0, -1)) & "Examples\GUI\msoobe.jpg", 0, 0, 400, 300) _WinAPI_SetParent($hGUI, $hWorkerW) _WinAPI_SetWindowLong($hGUI, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($hGUI, $GWL_EXSTYLE), $WS_EX_LAYERED)) _WinAPI_SetLayeredWindowAttributes($hGUI, 0, 180) GUISetState(@SW_SHOWNOACTIVATE) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd EndFunc ;==>Example Func Terminate() Exit EndFunc ;==>Terminate My take on the problem is creating "WorkerW". Finding it with _WinAPI_EnumWindows() works best. Reading this github.com/rocksdanister/lively/issues/2074 ( and the projects ) look interesting.
    4 points
  5. Hey, got it working on Win10. Never expected it. Found some code about forcing the creation of a WorkerW handle. Let's see if it does the job for your too. #include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> Opt("MustDeclareVars", True) HotKeySet("{ESC}", Terminate) Example() Func Example() Local $hProgman = WinGetHandle("[CLASS:Progman]") _SendMessage($hProgman, 0x052c) ; <<<<<< force the creation of a WorkerW handle under Progman Local $aList = WinList(), $hWorkerW For $i = 1 To $aList[0][0] If _WinAPI_GetParent($aList[$i][1]) = $hProgman And _WinAPI_GetClassName($aList[$i][1]) = "WorkerW" Then $hWorkerW = $aList[$i][1] ExitLoop EndIf Next ConsoleWrite("WorkerW " & $hWorkerW & @CRLF) Local $hGUI = GUICreate("Overlay", 400, 300, 10, 10, $WS_POPUP, $WS_EX_TOOLWINDOW) GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg", 0, 0, 400, 300) _WinAPI_SetParent($hGUI, $hWorkerW) _WinAPI_SetWindowLong($hGUI, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($hGUI, $GWL_EXSTYLE), $WS_EX_LAYERED)) _WinAPI_SetLayeredWindowAttributes($hGUI, 0, 180) GUISetState(@SW_SHOWNOACTIVATE) While Sleep(100) WEnd EndFunc ;==>Example Func Terminate() Exit EndFunc ;==>Terminate
    4 points
  6. MattyD

    WinRT - WinUI3

    Hi all - This is an offshoot of the WinRT Project. I'm posting my progress here while I'm bumbling around with WinUI3 - just so the main project doesn't get too cluttered. If I get things working I'll merge the two projects back together. That's the plan anyway! ATM all I have is a blank Window (thrilling I know!), but if you wish to try it out you'll need to: download and extract the example (obviously!) WindowTest.zip Go here and download the latest Redistributable package of the Windows App SDK. Currently this is 1.7.3 (look in the table for the link.). Once you've extracted that, go to the MSIX > win10-x64 folder It seems the x86 libraries don't work at the moment. (thanks for testing Gianni) . So ensure you're running Autiot_x64 on the autoit side! (#AutoIt3Wrapper_UseX64=Y directive in script) Extract the contents of Microsoft.WindowsAppRuntime.1.7.msix. (7-Zip works fine) I also installed the msix - This is not necessary for now (thanks again Gianni). At some point we'll probably reference our dlls from the installed runtime location. Grab all the .dll files and put then in the same folder as "WindowTest.au3" If you plan to make use of the Class Explorer script, grab all the .winmd files and put them in the same folder as "ClassExplorer v2.3.1.au3" I also found AppxManifest.xml is handy for mapping objects to physical dll files. Cheers, Matt
    4 points
  7. UEZ

    why no array pointer

    Just made a quick test for 2D struct array: ;Code by UEZ #AutoIt3Wrapper_UseX64=y #include <WinAPIDiag.au3> #include <Memory.au3> Global Const $iWidth = 1000, $iHeight = 4000 Global Const $iTotal = $iWidth * $iHeight ConsoleWrite("Total: " & $iTotal & @CRLF) Global $t2DArray = DllStructCreate("uint a[" & $iTotal & "]") ;2D array Global $pArray = DllStructGetPtr($t2DArray) Global $x, $y, $t, $index ;2D For $y = 0 To $iHeight - 1 ;0 1 2 3 4 $t = $y * $iWidth ;10 11 12 13 14 For $x = 0 To $iWidth - 1 ;20 21 22 23 24 $index = $t + $x ;30 31 32 33 34 $t2DArray.a(($index + 1)) = $y & $x ; Next ;1D -> 0 1 2 3 4 10 11 12 13 14 20 21 22 23 24 30 31 32 33 34 Next Global $fTimer = TimerInit() ;~ Print2DArray($t2DArray, $iWidth, $iHeight) InsertValue2D(99, 0, 0, $t2DArray, $pArray, $iWidth, $iHeight, "uint") ;~ ConsoleWrite(@CRLF & "Result (add 99 at 0, 0):" & @CRLF) ConsoleWrite(TimerDiff($fTimer) & @CRLF) ;~ Print2DArray($t2DArray, $iWidth, $iHeight + 1) DeleteValue2D(2, 2, $t2DArray, $pArray, $iWidth, $iHeight + 1, "uint") ConsoleWrite(TimerDiff($fTimer) & @CRLF) ;~ ConsoleWrite(@CRLF & "Result (del 2, 2 -> 21):" & @CRLF) ;~ Print2DArray($t2DArray, $iWidth, $iHeight) Func InsertValue2D($value, $xPos, $yPos, ByRef $tStruct, ByRef $pArray, $cols, $rows, $type) Local $oldElements = $cols * $rows Local $newRows = $rows + 1 Local $newElements = $cols * $newRows Local $elementSize Switch $type Case "ushort", "short", "word" $elementSize = 2 Case "uint", "int", "float" $elementSize = 4 Case "double", "int64", "uint64" $elementSize = 8 Case Else Return SetError(1, 0, 0) EndSwitch Local $tNew = DllStructCreate($type & " a[" & $newElements & "]") Local $pNew = DllStructGetPtr($tNew) Local $insertIndex = $yPos * $cols + $xPos If $insertIndex < 0 Or $insertIndex > $oldElements Then Return SetError(1, 0, 0) _MemMoveMemory($pArray, $pNew, $insertIndex * $elementSize) $tNew.a($insertIndex + 1) = $value Local $bytesAfter = ($oldElements - $insertIndex) * $elementSize _MemMoveMemory($pArray + ($insertIndex * $elementSize), $pNew + (($insertIndex + 1) * $elementSize), $bytesAfter) $tStruct = $tNew $pArray = $pNew Return 1 EndFunc Func DeleteValue2D($xPos, $yPos, ByRef $tStruct, ByRef $pArray, $cols, $rows, $type) Local $oldElements = $cols * $rows If $rows < 2 Then Return SetError(1, 0, 0) Local $newElements = $oldElements - 1 Local $elementSize Switch $type Case "ushort", "short", "word" $elementSize = 2 Case "uint", "int", "float" $elementSize = 4 Case "double", "int64", "uint64" $elementSize = 8 Case Else Return SetError(2, 0, 0) EndSwitch Local $deleteIndex = $yPos * $cols + $xPos If $deleteIndex < 0 Or $deleteIndex >= $oldElements Then Return SetError(3, 0, 0) Local $tNew = DllStructCreate($type & " a[" & $newElements & "]") Local $pNew = DllStructGetPtr($tNew) _MemMoveMemory($pArray, $pNew, $deleteIndex * $elementSize) Local $bytesAfter = ($oldElements - $deleteIndex - 1) * $elementSize _MemMoveMemory($pArray + (($deleteIndex + 1) * $elementSize), $pNew + ($deleteIndex * $elementSize), $bytesAfter) $tStruct = $tNew $pArray = $pNew Return 1 EndFunc Func Print2DArray($t2DArray, $cols, $rows) Local $x, $y, $index For $y = 0 To $rows - 1 For $x = 0 To $cols - 1 $index = $y * $iWidth + $x ConsoleWrite($t2DArray.a($index + 1) & @TAB) Next ConsoleWrite(@CRLF) Next EndFunc It took 13 seconds to execute insert and delete operation for one element each for an array with 4.000.000 elements. I don't know how long it would take using ASM... I'm pretty rusty when it comes to ASM. ¯\_(ツ)_/¯
    4 points
  8. UEZ

    why no array pointer

    Something like that: 1D: ;coded by UEZ #include <WinAPIDiag.au3> #include <Memory.au3> Global $iElements = 2^5 ConsoleWrite("Number of entries: " & $iElements & @CRLF) Global $tArray = DllStructCreate("uint a[" & $iElements & "]") Global $pArray = DllStructGetPtr($tArray) For $i = 1 To $iElements $tArray.a(($i)) = $i Next Global $iPos = Int($iElements * 0.667) ConsoleWrite("Insert to position " & $iPos & @CRLF) InsertValue(123456789, $iPos, $tArray, $pArray, "uint") _WinAPI_DisplayStruct($tArray, "uint a[" & $iElements + 1 & "]") Func InsertValue($value, $iPos, ByRef $tArray, ByRef $pArray, $type) If Not IsDllStruct($tArray) Then Return SetError(1, 0, 0) Local $iUB, $iBytes Switch $type Case "wchar", "short", "ushort", "word" $iBytes = 2 $iUB = DllStructGetSize($tArray) / $iBytes Case "float", "int", "long", "bool", "uint", "ulong" $iBytes = 4 $iUB = DllStructGetSize($tArray) / $iBytes Case "int64", "uint64", "double" $iBytes = 8 $iUB = DllStructGetSize($tArray) / $iBytes Case Else Return SetError(2, 0, 0) EndSwitch If $iPos < 1 Or $iPos > $iUB Then SetError(3, 0, 0) $iUB += 1 Local $tArray_new = DllStructCreate($type & " a[" & $iUB & "]") $pArray = DllStructGetPtr($tArray_new) _MemMoveMemory(DllStructGetPtr($tArray), $pArray, ($iPos - 1) * $iBytes) $tArray_new.a(($iPos)) = $value _MemMoveMemory(DllStructGetPtr($tArray) + ($iPos - 1) * $iBytes, $pArray + $iPos * $iBytes , ($iUB - $iPos) * $iBytes) $tArray = $tArray_new Return 1 EndFunc 2D: #include <WinAPIDiag.au3> #include <Memory.au3> Global Const $iWidth = 5, $iHeight = 4 Global Const $iTotal = $iWidth * $iHeight Global $t2DArray = DllStructCreate("uint a[" & $iTotal & "]") ;2D array Global $pArray = DllStructGetPtr($t2DArray) Global $x, $y, $t, $index ;2D For $y = 0 To $iHeight - 1 ;0 1 2 3 4 $t = $y * $iWidth ;10 11 12 13 14 For $x = 0 To $iWidth - 1 ;20 21 22 23 24 $index = $t + $x ;30 31 32 33 34 $t2DArray.a(($index + 1)) = $y & $x ; Next ;1D -> 0 1 2 3 4 10 11 12 13 14 20 21 22 23 24 30 31 32 33 34 Next Print2DArray($t2DArray, $iWidth, $iHeight) InsertValue2D(99, 0, 0, $t2DArray, $pArray, $iWidth, $iHeight, "uint") ConsoleWrite(@CRLF & "Result (add 99 at 0, 0):" & @CRLF) Print2DArray($t2DArray, $iWidth, $iHeight + 1) DeleteValue2D(2, 2, $t2DArray, $pArray, $iWidth, $iHeight + 1, "uint") ConsoleWrite(@CRLF & "Result (del 2, 2 -> 21):" & @CRLF) Print2DArray($t2DArray, $iWidth, $iHeight) Func InsertValue2D($value, $xPos, $yPos, ByRef $tStruct, ByRef $pArray, $cols, $rows, $type) Local $oldElements = $cols * $rows Local $newRows = $rows + 1 Local $newElements = $cols * $newRows Local $elementSize Switch $type Case "ushort", "short", "word" $elementSize = 2 Case "uint", "int", "float" $elementSize = 4 Case "double", "int64", "uint64" $elementSize = 8 Case Else Return SetError(1, 0, 0) EndSwitch Local $tNew = DllStructCreate($type & " a[" & $newElements & "]") Local $pNew = DllStructGetPtr($tNew) Local $insertIndex = $yPos * $cols + $xPos If $insertIndex < 0 Or $insertIndex > $oldElements Then Return SetError(1, 0, 0) _MemMoveMemory($pArray, $pNew, $insertIndex * $elementSize) $tNew.a($insertIndex + 1) = $value Local $bytesAfter = ($oldElements - $insertIndex) * $elementSize _MemMoveMemory($pArray + ($insertIndex * $elementSize), $pNew + (($insertIndex + 1) * $elementSize), $bytesAfter) $tStruct = $tNew $pArray = $pNew Return 1 EndFunc Func DeleteValue2D($xPos, $yPos, ByRef $tStruct, ByRef $pArray, $cols, $rows, $type) Local $oldElements = $cols * $rows If $rows < 2 Then Return SetError(1, 0, 0) Local $newElements = $oldElements - 1 Local $elementSize Switch $type Case "ushort", "short", "word" $elementSize = 2 Case "uint", "int", "float" $elementSize = 4 Case "double", "int64", "uint64" $elementSize = 8 Case Else Return SetError(2, 0, 0) EndSwitch Local $deleteIndex = $yPos * $cols + $xPos If $deleteIndex < 0 Or $deleteIndex >= $oldElements Then Return SetError(3, 0, 0) Local $tNew = DllStructCreate($type & " a[" & $newElements & "]") Local $pNew = DllStructGetPtr($tNew) _MemMoveMemory($pArray, $pNew, $deleteIndex * $elementSize) Local $bytesAfter = ($oldElements - $deleteIndex - 1) * $elementSize _MemMoveMemory($pArray + (($deleteIndex + 1) * $elementSize), $pNew + ($deleteIndex * $elementSize), $bytesAfter) $tStruct = $tNew $pArray = $pNew Return 1 EndFunc Func Print2DArray($t2DArray, $cols, $rows) Local $x, $y, $index For $y = 0 To $rows - 1 For $x = 0 To $cols - 1 $index = $y * $iWidth + $x ConsoleWrite($t2DArray.a($index + 1) & @TAB) Next ConsoleWrite(@CRLF) Next EndFunc
    4 points
  9. I found this on my drive: #include <GUIComboBox.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <FontConstants.au3> #include <BorderConstants.au3> #include <WinAPI.au3> Global Const $ODT_MENU = 1 Global Const $ODT_LISTBOX = 2 Global Const $ODT_COMBOBOX = 3 Global Const $ODT_BUTTON = 4 Global Const $ODT_STATIC = 5 Global Const $ODT_HEADER = 100 Global Const $ODT_TAB = 101 Global Const $ODT_LISTVIEW = 102 Global Const $ODA_DRAWENTIRE = 1 Global Const $ODA_SELECT = 2 Global Const $ODA_FOCUS = 4 Global Const $ODS_SELECTED = 1 Global Const $ODS_GRAYED = 2 Global Const $ODS_DISABLED = 4 Global Const $ODS_CHECKED = 8 Global Const $ODS_FOCUS = 16 Global Const $ODS_DEFAULT = 32 Global Const $ODS_HOTLIGHT = 64 Global Const $ODS_INACTIVE = 128 Global Const $ODS_NOACCEL = 256 Global Const $ODS_NOFOCUSRECT = 512 Global Const $ODS_COMBOBOXEDIT = 4096 Global Const $clrWindowText = _WinAPI_GetSysColor($COLOR_WINDOWTEXT) Global Const $clrHighlightText = _WinAPI_GetSysColor($COLOR_HIGHLIGHTTEXT) Global Const $clrHighlight = _WinAPI_GetSysColor($COLOR_HIGHLIGHT) Global Const $clrWindow = _WinAPI_GetSysColor($COLOR_WINDOW) Global Const $tagDRAWITEMSTRUCT = _ 'uint CtlType;' & _ 'uint CtlID;' & _ 'uint itemID;' & _ 'uint itemAction;' & _ 'uint itemState;' & _ 'hwnd hwndItem;' & _ 'hwnd hDC;' & _ $tagRECT & _ ';ulong_ptr itemData;' Global Const $tagMEASUREITEMSTRUCT = _ 'uint CtlType;' & _ 'uint CtlID;' & _ 'uint itemID;' & _ 'uint itemWidth;' & _ 'uint itemHeight;' & _ 'ulong_ptr itemData;' Global $iItemWidth, $iItemHeight Global $hGUI Global $ComboBox Global $hBrushNorm = _WinAPI_CreateSolidBrush($clrWindow) Global $hBrushSel = _WinAPI_CreateSolidBrush($clrHighlight) GUIRegisterMsg($WM_MEASUREITEM, '_WM_MEASUREITEM') GUIRegisterMsg($WM_DRAWITEM, '_WM_DRAWITEM') ;GUIRegisterMsg($WM_COMMAND, '_WM_COMMAND') $hGUI = GUICreate('Test', 220, 300) $ComboBox = GUICtrlCreateCombo('', 10, 10, 200, 300, BitOR($WS_CHILD, $CBS_OWNERDRAWVARIABLE, $CBS_HASSTRINGS, $CBS_DROPDOWNLIST)) GUICtrlSetData($ComboBox, "Medabi|V!c†o®|joelson0007-|JScript|Belini|Jonatas-|AutoIt v3|www.autoitbrasil.com-|www.autoitscript.com", "Medabi") GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE _WinAPI_DeleteObject($hBrushSel) _WinAPI_DeleteObject($hBrushNorm) GUIDelete() Func _WM_MEASUREITEM($hWnd, $iMsg, $iwParam, $ilParam) Local $stMeasureItem = DllStructCreate($tagMEASUREITEMSTRUCT, $ilParam) If DllStructGetData($stMeasureItem, 1) = $ODT_COMBOBOX Then Local $iCtlType, $iCtlID, $iItemID Local $ComboBoxBox Local $tSize Local $sText $iCtlType = DllStructGetData($stMeasureItem, 'CtlType') $iCtlID = DllStructGetData($stMeasureItem, 'CtlID') $iItemID = DllStructGetData($stMeasureItem, 'itemID') $iItemWidth = DllStructGetData($stMeasureItem, 'itemWidth') $iItemHeight = DllStructSetData($stMeasureItem, "itemHeight", DllStructGetData($stMeasureItem, 'itemHeight') + 4) ;$iItemHeight = DllStructGetData($stMeasureItem, 'itemHeight') $ComboBoxBox = GUICtrlGetHandle($iCtlID) EndIf $stMeasureItem = 0 Return $GUI_RUNDEFMSG EndFunc ;==>_WM_MEASUREITEM Func _WM_DRAWITEM($hWnd, $iMsg, $iwParam, $ilParam) Local $tDIS = DllStructCreate($tagDRAWITEMSTRUCT, $ilParam) Local $iCtlType, $iCtlID, $iItemID, $iItemAction, $iItemState Local $clrForeground, $clrBackground Local $hWndItem, $hDC, $hOldPen, $hOldBrush Local $tRect Local $sText Local $iLeft, $iTop, $iRight, $iBottom $iCtlType = DllStructGetData($tDIS, 'CtlType') $iCtlID = DllStructGetData($tDIS, 'CtlID') $iItemID = DllStructGetData($tDIS, 'itemID') $iItemAction = DllStructGetData($tDIS, 'itemAction') $iItemState = DllStructGetData($tDIS, 'itemState') $hWndItem = DllStructGetData($tDIS, 'hwndItem') $hDC = DllStructGetData($tDIS, 'hDC') $tRect = DllStructCreate($tagRECT) If $iCtlType = $ODT_COMBOBOX And $iCtlID = $ComboBox Then Switch $iItemAction Case $ODA_DRAWENTIRE For $i = 1 To 4 DllStructSetData($tRect, $i, DllStructGetData($tDIS, $i + 7)) Next _GUICtrlComboBox_GetLBText($hWndItem, $iItemID, $sText) Local $iTop = DllStructGetData($tRect, 2), $iBottom = DllStructGetData($tRect, 4) DllStructSetData($tRect, 2, $iTop + 2) DllStructSetData($tRect, 4, $iBottom - 1) If BitAND($iItemState, $ODS_SELECTED) Then $clrForeground = _WinAPI_SetTextColor($hDC, $clrHighlightText) $clrBackground = _WinAPI_SetBkColor($hDC, $clrHighlight) _WinAPI_FillRect($hDC, DllStructGetPtr($tRect), $hBrushSel) Else $clrForeground = _WinAPI_SetTextColor($hDC, $clrWindowText) $clrBackground = _WinAPI_SetBkColor($hDC, $clrWindow) _WinAPI_FillRect($hDC, DllStructGetPtr($tRect), $hBrushNorm) EndIf DllStructSetData($tRect, 2, $iTop) DllStructSetData($tRect, 4, $iBottom) If $sText <> "" Then If StringInStr($sText, "-", 0, -1) Then ; Draw a "line" for a separator item If Not BitAND($iItemState, $ODS_COMBOBOXEDIT) Then DllStructSetData($tRect, 2, $iTop + ($iItemHeight)) _WinAPI_DrawEdge($hDC, DllStructGetPtr($tRect), $EDGE_ETCHED, $BF_TOP) EndIf $sText = StringTrimRight($sText, 1) EndIf DllStructSetData($tRect, 2, $iTop + 4) _WinAPI_DrawText($hDC, $sText, $tRect, $DT_LEFT) _WinAPI_SetTextColor($hDC, $clrForeground) _WinAPI_SetBkColor($hDC, $clrBackground) EndIf _WinAPI_SetBkMode($hDC, $TRANSPARENT) Case $ODA_SELECT, $ODA_FOCUS For $i = 1 To 4 DllStructSetData($tRect, $i, DllStructGetData($tDIS, $i + 7)) Next _GUICtrlComboBox_GetLBText($hWndItem, $iItemID, $sText) Local $iTop = DllStructGetData($tRect, 2), $iBottom = DllStructGetData($tRect, 4) DllStructSetData($tRect, 2, $iTop + 2) DllStructSetData($tRect, 4, $iBottom - 1) If BitAND($iItemState, $ODS_SELECTED) Then $clrForeground = _WinAPI_SetTextColor($hDC, $clrHighlightText) $clrBackground = _WinAPI_SetBkColor($hDC, $clrHighlight) _WinAPI_FillRect($hDC, DllStructGetPtr($tRect), $hBrushSel) Else $clrForeground = _WinAPI_SetTextColor($hDC, $clrWindowText) $clrBackground = _WinAPI_SetBkColor($hDC, $clrWindow) _WinAPI_FillRect($hDC, DllStructGetPtr($tRect), $hBrushNorm) EndIf DllStructSetData($tRect, 2, $iTop) DllStructSetData($tRect, 4, $iBottom) If $sText <> "" Then If StringInStr($sText, "-", 0, -1) Then ; Draw a "line" for a separator item If Not BitAND($iItemState, $ODS_COMBOBOXEDIT) Then DllStructSetData($tRect, 2, $iTop + ($iItemHeight)) _WinAPI_DrawEdge($hDC, DllStructGetPtr($tRect), $EDGE_ETCHED, $BF_TOP) EndIf $sText = StringTrimRight($sText, 1) EndIf DllStructSetData($tRect, 2, $iTop + 4) _WinAPI_DrawText($hDC, $sText, $tRect, $DT_LEFT) _WinAPI_SetTextColor($hDC, $clrForeground) _WinAPI_SetBkColor($hDC, $clrBackground) EndIf _WinAPI_SetBkMode($hDC, $TRANSPARENT) EndSwitch EndIf $tRect = 0 Return $GUI_RUNDEFMSG EndFunc ;==>_WM_DRAWITEM Func _WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg Local $hWndFrom, $iIDFrom, $iCode, $hWndCombo If Not IsHWnd($ComboBox) Then $hWndCombo = GUICtrlGetHandle($ComboBox) $hWndFrom = $ilParam $iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word $iCode = BitShift($iwParam, 16) ; Hi Word Switch $hWndFrom Case $ComboBox, $hWndCombo Switch $iCode Case $CBN_CLOSEUP ; Sent when the list box of a combo box has been closed _DebugPrint("$CBN_CLOSEUP" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $CBN_DBLCLK ; Sent when the user double-clicks a string in the list box of a combo box _DebugPrint("$CBN_DBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $CBN_DROPDOWN ; Sent when the list box of a combo box is about to be made visible _DebugPrint("$CBN_DROPDOWN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $CBN_EDITUPDATE ; Sent when the edit control portion of a combo box is about to display altered text _DebugPrint("$CBN_EDITUPDATE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $CBN_ERRSPACE ; Sent when a combo box cannot allocate enough memory to meet a specific request _DebugPrint("$CBN_ERRSPACE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $CBN_KILLFOCUS ; Sent when a combo box loses the keyboard focus _DebugPrint("$CBN_KILLFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $CBN_SELCHANGE ; Sent when the user changes the current selection in the list box of a combo box _DebugPrint("$CBN_SELCHANGE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; Select Item ;_GUICtrlComboBox_SetCurSel($ComboBox, _GUICtrlComboBox_GetCurSel($ComboBox)) ; no return value Case $CBN_SELENDCANCEL ; Sent when the user selects an item, but then selects another control or closes the dialog box _DebugPrint("$CBN_SELENDCANCEL" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $CBN_SELENDOK ; Sent when the user selects a list item, or selects an item and then closes the list _DebugPrint("$CBN_SELENDOK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $CBN_SETFOCUS ; Sent when a combo box receives the keyboard focus _DebugPrint("$CBN_SETFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>_WM_COMMAND Func _DebugPrint($s_text, $line = @ScriptLineNumber) ConsoleWrite( _ "!===========================================================" & @LF & _ "+======================================================" & @LF & _ "-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _ "+======================================================" & @LF) EndFunc ;==>_DebugPrint It's buried somewhere in this forum...
    4 points
  10. Uploaded a fix for that issue to Beta Tidy v 25.205.1420.6
    4 points
  11. 1.8.6 released! Only one change, the help box that appears when writing function parameters should not dissapear, when adding "," anymore. It took me a while and the solution is not perfect, but it should be better than the previous experience
    3 points
  12. I can only test on my Notebook with Win11 24H2 and the solution was to set parent to the WorkerW handle under Progman. I found also the information after midnight to force WorkerW under Progman using DllCall("user32.dll", "lresult", "SendMessage","hwnd", $hProgman, "uint", 0x052C, "wparam", 0, "lparam", 0) but I was too sleepy to continue. ;Code by UEZ build 2025-07-18 beta #include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ;~ #include <WinAPIGdi.au3> ;~ #include <Array.au3> 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, 0, 0, 250, $SMTO_NORMAL) ;~ DllCall("user32.dll", "lresult", "SendMessage","hwnd", $hProgman, "uint", 0x052C, "wparam", 0, "lparam", 0) ;~ Sleep(250) ;~ $i = 1 ;~ While True ;~ $h = WinGetHandle("[CLASS:WorkerW;INSTANCE:" & $i & "]") ;~ $hWorkerW = _WinAPI_FindWindowEx($hProgman, $h, "WorkerW") ;~ If $hWorkerW Then ExitLoop ;~ $i += 1 ;~ If $i = 100 Then Exit MsgBox(16, "ERROR", "Couldn't find WorkerW under Progman", 30) ;~ WEnd 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) GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg", 0, 0, $aPrimary[4], $aPrimary[5]) _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, 220, $LWA_ALPHA) GUISetState(@SW_SHOWNOACTIVATE, $hGUI) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd 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
    3 points
  13. It provides one of the WorkerW handles, not the WorkerW handle under Progman. 😉 This works for me: ;Code by UEZ build 2025-07-16 beta #include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $hProgman = WinGetHandle("[CLASS:Progman]"), $hWorkerW, $i $i = 1 While True $h = WinGetHandle("[CLASS:WorkerW;INSTANCE:" & $i & "]") $hWorkerW = _WinAPI_FindWindowEx($hProgman, $h, "WorkerW", "") If $hWorkerW Then ExitLoop $i += 1 If $i = 100 Then Exit MsgBox(16, "ERROR", "Couldn't find WorkerW under Progman", 30) WEnd Global $SWP = BitOR($SWP_NOMOVE, $SWP_NOSIZE, $SWP_NOACTIVATE) $hGUI = GUICreate("Overlay", 400, 300, 10, 10, $WS_POPUP, $WS_EX_TOOLWINDOW) GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg", 0, 0, 400, 300) _WinAPI_SetParent($hGUI, $hWorkerW) _WinAPI_SetWindowPos($hGUI, $HWND_BOTTOM, 0,0,0,0, $SWP) _WinAPI_SetWindowLong($hGUI, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($hGUI, $GWL_EXSTYLE), $WS_EX_LAYERED, $WS_EX_TRANSPARENT)) _WinAPI_SetLayeredWindowAttributes($hGUI, 0, 220, $LWA_ALPHA) GUISetState(@SW_SHOWNOACTIVATE, $hGUI) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd 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
    3 points
  14. I've created a label based solution for a simple status bar. May be it's interesting 4u. https://github.com/BugFix/AutoIt-Scripts/blob/main/Statusbar/statusbar_small.md#gallery
    3 points
  15. This works on my Win10 machine. #include <GUIConstantsEx.au3> #include <WinApi.au3> #include <WindowsConstants.au3> Global $hDeskWin = _WinGetDesktopHandle() Global $h_Desktop_SysListView32 = HWnd(@extended) Main() Func Main() Local $this = GUICreate("", 400, 400, @DesktopWidth - (400) - 20, 100, $WS_POPUP, $WS_EX_NOACTIVATE + $WS_EX_TRANSPARENT) _WinAPI_SetParent($this, $h_Desktop_SysListView32) Local $iPic = GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg", 0, 0, 400, 400) ;GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) WinSetTrans($this, "", 200) _GuiRoundCorners($this, 16, 16) _WinAPI_SetWindowLong($this, $GWL_HWNDPARENT, ControlGetHandle("[CLASS:Progman]", "", "SysListView321")) ;hide in taskbar GUISetState(@SW_SHOWNOACTIVATE, $this) ;_WinAPI_SetWindowPos($this, $HWND_BOTTOM, Default, Default, Default, Default, BitOR($SWP_NOACTIVATE, $SWP_SHOWWINDOW, $SWP_NOMOVE, $SWP_NOSIZE )) ;not worked While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($this) EndFunc ;==>Main Func _GuiRoundCorners($h_win, $ixR, $iyR) Local $aPos = WinGetPos($h_win) If @error Then Return 0 Local $iW = $aPos[2] Local $iH = $aPos[3] Local $hRgn = _WinAPI_CreateRoundRectRgn(0, 0, $iW, $iH, $ixR, $iyR) _WinAPI_SetWindowRgn($h_win, $hRgn) EndFunc ;==>_GuiRoundCorners ; http://www.autoitscript.com/forum/topic/119783-desktop-class-workerw/page__view__findpost__p__903081 ; =============================================================================================================================== ; <_WinGetDesktopHandle.au3> ; ; Function to get the Windows' Desktop Handle. ; Since this is no longer a simple '[CLASS:Progman]' on Aero-enabled desktops, this method uses a slightly ; more involved method to find the correct Desktop Handle. ; ; Author: Ascend4nt, credits to Valik for pointing out the Parent->Child relationship: Desktop->'SHELLDLL_DefView' ; =============================================================================================================================== ; Example use: #cs #include <GuiListView.au3> $iTimer = TimerInit() $hDeskWin = _WinGetDesktopHandle() $hListView = HWnd(@extended) ConsoleWrite("Time elapsed:" & TimerDiff($iTimer) & " ms" & @CRLF) $iDeskItems = _GUICtrlListView_GetItemCount($hListView) ConsoleWrite("Handle to desktop: " & $hDeskWin & ", Title: '" & WinGetTitle($hDeskWin) & "', Handle to Listview: " & $hListView & ", # Items:" & $iDeskItems & ", Title: " & WinGetTitle($hListView) & @CRLF) MsgBox(0, "Desktop handle (with ListView) found", "Handle to desktop: " & $hDeskWin & ", Title: '" & WinGetTitle($hDeskWin) & "'," & @CRLF & "Handle to Listview: " & $hListView & @CRLF & "# Desktop Items:" & $iDeskItems) #ce Func _WinGetDesktopHandle() Local $i, $hDeskWin, $hSHELLDLL_DefView, $hListView ; The traditional Windows Classname for the Desktop, not always so on newer O/S's $hDeskWin = WinGetHandle("[CLASS:Progman]") ; Parent->Child relationship: Desktop->SHELLDLL_DefView $hSHELLDLL_DefView = ControlGetHandle($hDeskWin, '', '[CLASS:SHELLDLL_DefView; INSTANCE:1]') ; No luck with finding the Desktop and/or child? If $hDeskWin = '' Or $hSHELLDLL_DefView = '' Then ; Look through a list of WorkerW windows - one will be the Desktop on Windows 7+ O/S's $aWinList = WinList("[CLASS:WorkerW]") For $i = 1 To $aWinList[0][0] $hSHELLDLL_DefView = ControlGetHandle($aWinList[$i][1], '', '[CLASS:SHELLDLL_DefView; INSTANCE:1]') If $hSHELLDLL_DefView <> '' Then $hDeskWin = $aWinList[$i][1] ExitLoop EndIf Next EndIf ; Parent->Child relationship: Desktop->SHELDLL_DefView->SysListView32 $hListView = ControlGetHandle($hSHELLDLL_DefView, '', '[CLASS:SysListView32; INSTANCE:1]') If $hListView = '' Then Return SetError(-1, 0, '') Return SetExtended($hListView, $hDeskWin) EndFunc ;==>_WinGetDesktopHandle
    3 points
  16. Using Melba23 post here as a guide (Thanks for the enlightenment) I managed to get this far A Autocomplete selector for existing tags #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <WinAPI.au3> #include <GuiListBox.au3> ; Global Variables Global $g_hMainGUI Global $g_idEditInputTags Global $g_idListboxSuggestions Global $g_hListboxSuggestionsHWND Global $g_aAvailableTags Global $g_iCurrentSuggestionIndex = -1 ; Dummy control IDs for accelerators (Listbox Navigation Key) Global $g_idAccelUp, $g_idAccelDown, $g_idAccelEnter, $g_idAccelEscape ; Load all unique tags from database $g_aAvailableTags = _GetAllUniqueTags() If @error Then MsgBox(16, "Error", "Failed to load unique tags from database.") _CreateGUI() ; Create Main GUI Exit ;--------------------------------------------------------------------------------------- Func _GetAllUniqueTags() ; This function should retrieve your actual unique tags from a database or file. ; For demonstration, it reads words from a text file. Local $sString = StringLower(FileRead("C:\Program Files (x86)\AutoIt3\SciTE\SciTE Jump\License.txt")) ; matches sequences of letters that are at least 4 characters long Local $aWords = StringRegExp($sString, '[a-zA-Z]{4,}', 3) $aWords = _ArrayUnique($aWords) ; This removes the count element from the array returned by StringRegExp with flag 3. If UBound($aWords) > 0 Then _ArrayDelete($aWords, 0) _ArraySort($aWords) Return $aWords EndFunc ;==>_GetAllUniqueTags ;--------------------------------------------------------------------------------------- Func _CreateGUI() $g_hMainGUI = GUICreate("Main GUI", 700, 300) GUICtrlCreateLabel("Title:", 10, 20, 50, 20) Local $idTitle = GUICtrlCreateInput("", 70, 20, 600, 25) GUICtrlCreateLabel("Tags:", 10, 60, 50, 20) $g_idEditInputTags = GUICtrlCreateInput("", 70, 60, 600, 25, $ES_AUTOVSCROLL) GUICtrlSetLimit($g_idEditInputTags, 250) Local $aPos = ControlGetPos($g_hMainGUI, "", $g_idEditInputTags) If @error Then Exit MsgBox(16, "Error", "Failed to get position of Tags input control. Exiting.") ; Suggestions Listbox $g_idListboxSuggestions = GUICtrlCreateList("", $aPos[0], $aPos[1] + $aPos[3], $aPos[2], 150, BitOR($LBS_NOTIFY, $WS_VSCROLL, $WS_BORDER, $WS_TABSTOP)) GUICtrlSetState($g_idListboxSuggestions, $GUI_HIDE) $g_hListboxSuggestionsHWND = GUICtrlGetHandle($g_idListboxSuggestions) GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND_Handler") GUIRegisterMsg($WM_MOUSEWHEEL, "_WM_MOUSEWHEEL_Handler") $g_idAccelUp = GUICtrlCreateDummy() $g_idAccelDown = GUICtrlCreateDummy() $g_idAccelEnter = GUICtrlCreateDummy() $g_idAccelEscape = GUICtrlCreateDummy() Local $AccelKeys[4][2] = [ _ ["{UP}", $g_idAccelUp], _ ["{DOWN}", $g_idAccelDown], _ ["{ENTER}", $g_idAccelEnter], _ ["{ESCAPE}", $g_idAccelEscape] _ ] GUISetAccelerators($AccelKeys) Local $idExit = GUICtrlCreateButton("Exit", 300, 250, 100, 30) GUISetState(@SW_SHOW) Local $iMsg While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE, $idExit ExitLoop Case $g_idAccelUp _ListboxNavigationKey($g_idAccelUp) Case $g_idAccelDown _ListboxNavigationKey($g_idAccelDown) Case $g_idAccelEnter _ListboxNavigationKey($g_idAccelEnter) Case $g_idAccelEscape _ListboxNavigationKey($g_idAccelEscape) EndSwitch WEnd GUIDelete($g_hMainGUI) EndFunc ;==>_CreateGUI ;--------------------------------------------------------------------------------------- Func _ApplySelectedTag($sSelectedTag) If $sSelectedTag = "" Then Return Local $sCurrentTags = GUICtrlRead($g_idEditInputTags) If @error Then Return Local $iLastCommaPos = StringInStr($sCurrentTags, ",", 0, -1) ; Find the last comma Local $sPrefixToKeep = "" If $iLastCommaPos > 0 Then $sPrefixToKeep = StringLeft($sCurrentTags, $iLastCommaPos) $sPrefixToKeep = StringStripWS($sPrefixToKeep, $STR_STRIPTRAILING) & " " EndIf Local $sNewTags = $sPrefixToKeep & $sSelectedTag & ", " GUICtrlSetData($g_idEditInputTags, $sNewTags) If @error Then Return _HideSuggestions() GUICtrlSetState($g_idEditInputTags, $GUI_FOCUS) If @error Then Return _WinAPI_PostMessage(GUICtrlGetHandle($g_idEditInputTags), $EM_SETSEL, StringLen($sNewTags), StringLen($sNewTags)) $g_iCurrentSuggestionIndex = -1 EndFunc ;==>_ApplySelectedTag ;--------------------------------------------------------------------------------------- Func _ShowSuggestions($sCurrentInput) Local $sTrimmedInput = StringStripWS($sCurrentInput, $STR_STRIPLEADING + $STR_STRIPTRAILING) If $sTrimmedInput = "" Then Return _HideSuggestions() Local $aInputParts = StringSplit($sTrimmedInput, ",", $STR_NOCOUNT) Local $sLastPart = "" If UBound($aInputParts) > 0 Then $sLastPart = StringStripWS($aInputParts[UBound($aInputParts) - 1], $STR_STRIPLEADING + $STR_STRIPTRAILING) Else $sLastPart = $sTrimmedInput EndIf If $sLastPart = "" Then Return _HideSuggestions() Local $aFilteredSuggestions[0] Local $iCount = 0 Local $iLenLastPart = StringLen($sLastPart) For $sTag In $g_aAvailableTags If $sTag <> "" And StringLen($sTag) >= $iLenLastPart And StringLeft($sTag, $iLenLastPart) = $sLastPart Then _ArrayAdd($aFilteredSuggestions, $sTag) $iCount += 1 EndIf Next If $iCount > 0 Then GUICtrlSendMsg($g_idListboxSuggestions, $LB_RESETCONTENT, 0, 0) For $sSuggestion In $aFilteredSuggestions If $sSuggestion <> "" Then GUICtrlSendMsg($g_idListboxSuggestions, $LB_ADDSTRING, 0, $sSuggestion) EndIf Next GUICtrlSetState($g_idListboxSuggestions, $GUI_SHOW) GUICtrlSendMsg($g_idListboxSuggestions, $LB_SETCURSEL, 0, 0) GUICtrlSendMsg($g_idListboxSuggestions, $LB_SETTOPINDEX, 0, 0) $g_iCurrentSuggestionIndex = 0 Else _HideSuggestions() EndIf EndFunc ;==>_ShowSuggestions ;--------------------------------------------------------------------------------------- Func _HideSuggestions() GUICtrlSetState($g_idListboxSuggestions, $GUI_HIDE) GUICtrlSendMsg($g_idListboxSuggestions, $LB_RESETCONTENT, 0, 0) $g_iCurrentSuggestionIndex = -1 EndFunc ;==>_HideSuggestions ;--------------------------------------------------------------------------------------- Func _ListboxNavigationKey($idKey) If Not BitAND(GUICtrlGetState($g_idListboxSuggestions), $GUI_SHOW) Then Return Local $iCount = GUICtrlSendMsg($g_idListboxSuggestions, $LB_GETCOUNT, 0, 0) If $iCount = 0 Then Return Switch $idKey Case $g_idAccelUp If $g_iCurrentSuggestionIndex <= 0 Then $g_iCurrentSuggestionIndex = $iCount - 1 Else $g_iCurrentSuggestionIndex -= 1 EndIf GUICtrlSendMsg($g_idListboxSuggestions, $LB_SETCURSEL, $g_iCurrentSuggestionIndex, 0) GUICtrlSendMsg($g_idListboxSuggestions, $LB_SETTOPINDEX, $g_iCurrentSuggestionIndex, 0) Case $g_idAccelDown If $g_iCurrentSuggestionIndex >= $iCount - 1 Then $g_iCurrentSuggestionIndex = 0 Else $g_iCurrentSuggestionIndex += 1 EndIf GUICtrlSendMsg($g_idListboxSuggestions, $LB_SETCURSEL, $g_iCurrentSuggestionIndex, 0) GUICtrlSendMsg($g_idListboxSuggestions, $LB_SETTOPINDEX, $g_iCurrentSuggestionIndex, 0) Case $g_idAccelEnter Local $iIndex = GUICtrlSendMsg($g_idListboxSuggestions, $LB_GETCURSEL, 0, 0) If $iIndex <> $LB_ERR Then Local $sSelectedTag = _GUICtrlListBox_GetText($g_idListboxSuggestions, $iIndex) If $sSelectedTag <> "" Then _ApplySelectedTag($sSelectedTag) EndIf Else _HideSuggestions() EndIf $g_iCurrentSuggestionIndex = -1 Case $g_idAccelEscape _HideSuggestions() $g_iCurrentSuggestionIndex = -1 EndSwitch EndFunc ;==>_ListboxNavigationKey ;--------------------------------------------------------------------------------------- Func _WM_COMMAND_Handler($hWnd, $iMsg, $wParam, $lParam) Local $iControlID = _WinAPI_LoWord($wParam) Local $iNotificationCode = _WinAPI_HiWord($wParam) Switch $iMsg Case $WM_COMMAND Switch $iControlID Case $g_idEditInputTags Switch $iNotificationCode Case $EN_CHANGE Local $sCurrentInput = GUICtrlRead($g_idEditInputTags) _ShowSuggestions($sCurrentInput) Case $EN_KILLFOCUS Sleep(50) Local $hFocusedWindow = _WinAPI_GetFocus() Local $hListboxSuggestionsHandle = GUICtrlGetHandle($g_idListboxSuggestions) Local $hEditInputTagsHandle = GUICtrlGetHandle($g_idEditInputTags) If $hFocusedWindow <> $hListboxSuggestionsHandle And $hFocusedWindow <> $hEditInputTagsHandle Then _HideSuggestions() Local $sCurrentTags = GUICtrlRead($g_idEditInputTags) If StringRight($sCurrentTags, 2) = ", " Then GUICtrlSetData($g_idEditInputTags, StringTrimRight($sCurrentTags, 2)) ElseIf StringRight($sCurrentTags, 1) = "," Then GUICtrlSetData($g_idEditInputTags, StringTrimRight($sCurrentTags, 1)) EndIf EndIf EndSwitch Case $g_idListboxSuggestions Switch $iNotificationCode Case $LBN_SELCHANGE Local $iIndex = GUICtrlSendMsg($g_idListboxSuggestions, $LB_GETCURSEL, 0, 0) If $iIndex <> $LB_ERR Then Local $sSelectedTag = _GUICtrlListBox_GetText($g_idListboxSuggestions, $iIndex) If $sSelectedTag <> "" Then _ApplySelectedTag($sSelectedTag) EndIf EndIf Case $LBN_DBLCLK Local $iIndex = GUICtrlSendMsg($g_idListboxSuggestions, $LB_GETCURSEL, 0, 0) If $iIndex <> $LB_ERR Then Local $sSelectedTag = _GUICtrlListBox_GetText($g_idListboxSuggestions, $iIndex) If $sSelectedTag <> "" Then _ApplySelectedTag($sSelectedTag) EndIf EndIf EndSwitch EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>_WM_COMMAND_Handler ;--------------------------------------------------------------------------------------- Func _WM_MOUSEWHEEL_Handler($hWnd, $iMsg, $wParam, $lParam) ; Using GUIGetCursorInfo to find the control under the mouse Local $aCursorInfo = GUIGetCursorInfo($g_hMainGUI) ; Check if the mouse is over the suggestions ListBox and if the ListBox is visible If Not @error And IsArray($aCursorInfo) And UBound($aCursorInfo) >= 5 And $aCursorInfo[4] = $g_idListboxSuggestions And BitAND(GUICtrlGetState($g_idListboxSuggestions), $GUI_SHOW) Then Local $iDelta = _WinAPI_HiWord($wParam) ; How much the wheel turned (120 for a "click" up, -120 for a "click" down) Local $iNumLinesToScroll = 1 ; We scroll one line at a time with the wheel Local $iCurrentSelection = GUICtrlSendMsg($g_idListboxSuggestions, $LB_GETCURSEL, 0, 0) Local $iTotalItems = GUICtrlSendMsg($g_idListboxSuggestions, $LB_GETCOUNT, 0, 0) If $iTotalItems <= 0 Then Return 1 ; No items, nothing to scroll or select If $iDelta > 0 Then ; Scroll Up (wheel up) If $iCurrentSelection > 0 Then $g_iCurrentSuggestionIndex = $iCurrentSelection - $iNumLinesToScroll If $g_iCurrentSuggestionIndex < 0 Then $g_iCurrentSuggestionIndex = 0 Else $g_iCurrentSuggestionIndex = 0 ; Already at the top EndIf Else ; Scroll Down (wheel down) If $iCurrentSelection < $iTotalItems - 1 Then $g_iCurrentSuggestionIndex = $iCurrentSelection + $iNumLinesToScroll If $g_iCurrentSuggestionIndex >= $iTotalItems Then $g_iCurrentSuggestionIndex = $iTotalItems - 1 Else $g_iCurrentSuggestionIndex = $iTotalItems - 1 ; Already at the bottom EndIf EndIf ; We define the new option GUICtrlSendMsg($g_idListboxSuggestions, $LB_SETCURSEL, $g_iCurrentSuggestionIndex, 0) ; Also, make the selected element visible (if it isn't already) GUICtrlSendMsg($g_idListboxSuggestions, $LB_SETTOPINDEX, $g_iCurrentSuggestionIndex, 0) Return 1 ; Message has been handled EndIf Return $GUI_RUNDEFMSG ; Let AutoIt handle the message for other controls EndFunc ;==>_WM_MOUSEWHEEL_Handler Please, every comment is appreciated! leave your comments and experiences here! Thank you very much
    3 points
  17. I tried to add these 2 controls (combo & input box) to my script found in this post with good results, on a maximizable / resizable GUI : These are the lines modified / added to the script, so you can try them too : 1) Lines modified : ; Local $iW = 300, $iH = 100 Local $iW = 600, $iH = 200 ; Local $aParts[3] = [90, 180, 280] Local $aParts[3] = [200, 400, 580] ; Local $idChangeText = GUICtrlCreateLabel("Change Text", 110, 25, 80, 30, $SS_CENTER + $SS_CENTERIMAGE), $iInc Local $idChangeText = GUICtrlCreateLabel("Change Text", $iW / 2 - 40, 50, 80, 30, $SS_CENTER + $SS_CENTERIMAGE), $iInc 2) Lines added : #include <ComboConstants.au3> ... Local $idComboBox = GUICtrlCreateCombo("Install", 100, 180, 100, 18, $CBS_DROPDOWNLIST) GUICtrlSetData($idComboBox, "Uninstall") GUICtrlSetBkColor(-1, 0xFF0000) ; red _WinAPI_SetParent(GUICtrlGetHandle($idComboBox), $g_hGUI) Local $idInput = GUICtrlCreateInput("Input in part 1", 300, 181, 100, 18) GUICtrlSetBkColor(-1, 0x00FF00) ; green _WinAPI_SetParent(GUICtrlGetHandle($idInput), $g_hGUI) * Please create $idComboBox and $idInput just after the label $idChangeText * IIRC your StatusBar height got a higher value, so you'll probably have to lower a bit the Y coord of both controls * Lucky me, I tried the _WinAPI_SetParent() on each control (combo & input), indicating... the GUI as parent and it "woke" them up both. Without this instruction, they didn't react, as you indicated. Hope it will work on your side, fingers crossed
    3 points
  18. WildByDesign

    DwmColorBlurMica

    I promised myself that I was not going to make another GUI because the attention to detail drives me a little crazy. 🙃 But here we are. This was especially complicated because I wanted to make a GUI that was 100% receptive to the features that DwmColorBlurMica represents. It had to have transparent controls to show the underlying backdrop material (Mica, Acrylic, Blur, etc.) through the controls. This meant making custom ComboBox because AutoIt ComboBox are not normally transparent. Anyway, I think I am around 50% complete with the GUI. Below is a W.I.P. screenshot of where I am at right now: It works better than I expected. There are color pickers too. I will probably get rid of the menubar. I will likely add a custom transparent statusbar to show all of the Global settings to compare to the per-app settings. Lots of things to consider still. I hate making GUIs.
    3 points
  19. Updated to WebP v0.3.7 build 2025-07-03 beta You can now create WebP anim files from WebP image files and you can extract frames from a WebP anim file to WebP image file format. Supported GDIPlus image formats: "bmp", "gif", "jpg", "tif", "png"
    3 points
  20. Updated to: WebP v0.3.5 build 2025-06-27 beta You can now create WebP animated files. Examples8 encodes GDI+ supported image files to an animation. Example9 captures the desktop screen to an WebP anim file.
    3 points
  21. You can simply try this code: It uses GDI+ to draw a red circle with centered text, creates a 32-bit ARGB icon, and sets it as a taskbar overlay using ITaskbarList3::SetOverlayIcon. It updates the icon every second. You can easily adjust it to fit your own needs. Let me know if it works for you! #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WinAPIIcons.au3> Global $oError = ObjEvent("AutoIt.Error", "_ErrFunc") Func _ErrFunc() ConsoleWrite("! COM Error ! Number: 0x" & Hex($oError.number, 8) & " Line: " & $oError.scriptline & " - " & $oError.windescription & @CRLF) EndFunc ; Define ITaskbarList3 COM interface Global Const $sCLSID_TaskbarList = "{56FDF344-FD6D-11D0-958A-006097C9A090}" Global Const $sIID_ITaskbarList3 = "{EA1AFB91-9E28-4B86-90E9-9E9F8A5EEFAF}" Global Const $tagITaskbarList3 = _ "HrInit hresult();" & _ "AddTab hresult(hwnd);" & _ "DeleteTab hresult(hwnd);" & _ "ActivateTab hresult(hwnd);" & _ "SetActiveAlt hresult(hwnd);" & _ "MarkFullscreenWindow hresult(hwnd;boolean);" & _ "SetProgressValue hresult(hwnd;uint64;uint64);" & _ "SetProgressState hresult(hwnd;int);" & _ "RegisterTab hresult(hwnd;hwnd);" & _ "UnregisterTab hresult(hwnd);" & _ "SetTabOrder hresult(hwnd;hwnd);" & _ "SetTabActive hresult(hwnd;hwnd;dword);" & _ "ThumbBarAddButtons hresult(hwnd;uint;ptr);" & _ "ThumbBarUpdateButtons hresult(hwnd;uint;ptr);" & _ "ThumbBarSetImageList hresult(hwnd;ptr);" & _ "SetOverlayIcon hresult(hwnd;ptr;wstr);" & _ "SetThumbnailTooltip hresult(hwnd;wstr);" & _ "SetThumbnailClip hresult(hwnd;ptr);" ; Global variables Global $hGraphic, $hTextBrush, $hFormat, $hFamily, $hFont, $hBackgroundBrush, $hPen Global $oList, $hWnd Global $iWidth = 32, $iHeight = 32, $iFontSize = 12 Global $iCounter = 0 Main() Func Main() _GDIPlus_Startup() $hWnd = GUICreate("Taskbar Overlay Icon Test", 400, 300) Local $label = GUICtrlCreateLabel("Starting...", 10, 10, 380, 100) GUISetState() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd) $hTextBrush = _GDIPlus_BrushCreateSolid(0xFFFFFFFF) $hFormat = _GDIPlus_StringFormatCreate() $hFamily = _GDIPlus_FontFamilyCreate("Arial") $hFont = _GDIPlus_FontCreate($hFamily, $iFontSize) $hBackgroundBrush = _GDIPlus_BrushCreateSolid(0xFFFF0000) $hPen = _GDIPlus_PenCreate(0xFF000000, 2) $oList = ObjCreateInterface($sCLSID_TaskbarList, $sIID_ITaskbarList3, $tagITaskbarList3) If Not IsObj($oList) Then MsgBox(16, "Error", "Failed to initialize ITaskbarList3.") Exit EndIf $oList.HrInit() If @error Then MsgBox(16, "Error", "HrInit failed: " & @error) Exit EndIf GUICtrlSetData($label, "$oList.AddTab") $oList.AddTab($hWnd) If @error Then MsgBox(16, "Error", "Failed to add taskbar tab: " & @error) Exit EndIf _UpdateOverlayIcon($iCounter) GUICtrlSetData($label, "Overlay icon initialized with counter: " & $iCounter) Local $hTimer = TimerInit() While 1 If TimerDiff($hTimer) > 1000 Then $iCounter += 1 If $iCounter > 99 Then $iCounter = 99 _UpdateOverlayIcon($iCounter) GUICtrlSetData($label, "Counter: " & $iCounter) $hTimer = TimerInit() EndIf If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop Sleep(10) WEnd GUICtrlSetData($label, "Removing overlay icon and tab") _Taskbar_SetOverlayIcon($oList, $hWnd, Null, "") $oList.DeleteTab($hWnd) $oList = 0 _GDIPlus_FontDispose($hFont) _GDIPlus_PenDispose($hPen) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BrushDispose($hTextBrush) _GDIPlus_BrushDispose($hBackgroundBrush) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndFunc Func _UpdateOverlayIcon($iCount) Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight, $GDIP_PXF32ARGB) Local $hGraphicBitmap = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hGraphicBitmap, 2) _GDIPlus_GraphicsClear($hGraphicBitmap, 0x00000000) _GDIPlus_GraphicsFillEllipse($hGraphicBitmap, 0, 0, $iWidth - 2, $iHeight - 2, $hBackgroundBrush) _GDIPlus_GraphicsDrawEllipse($hGraphicBitmap, 0, 0, $iWidth - 2, $iHeight - 2, $hPen) Local $tLayout = _GDIPlus_RectFCreate(2, 2, $iWidth - 4, $iHeight - 8) DrawStringCentered($hGraphicBitmap, $iCount, $hFont, $tLayout, $hFormat, $hTextBrush) Local $hIcon = _GDIPlus_HICONCreateFromBitmap($hBitmap) If @error Then MsgBox(16, "Error", "Failed to create HICON: " & @error) Exit EndIf _Taskbar_SetOverlayIcon($oList, $hWnd, $hIcon, "Counter: " & $iCount) _WinAPI_DestroyIcon($hIcon) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hGraphicBitmap) EndFunc Func DrawStringCentered($hGraphic, $iIndex, $hFont, $tLayout, $hFormat, $hTextBrush) Local $aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $iIndex, $hFont, $tLayout, $hFormat) Local $tIndex = $aInfo[0] $tIndex.X = $tLayout.X + (($tLayout.Width - $tIndex.Width) / 2) $tIndex.Y = $tLayout.Y + (($tLayout.Height - _GDIPlus_FontGetHeight($hFont, $hGraphic)) / 2) _GDIPlus_GraphicsDrawStringEx($hGraphic, $iIndex, $hFont, $tIndex, $hFormat, $hTextBrush) EndFunc Func _Taskbar_SetOverlayIcon(ByRef $oTB, $hWnd, $hIcon, $sAltText = "") Local $vRet = $oTB.SetOverlayIcon($hWnd, $hIcon, $sAltText) If @error Then Return SetError(@error, @extended, False) If $vRet = 0 Then Return True Return SetError($vRet, 0, False) EndFunc
    3 points
  22. I have thought again and this is simpler and the better solution. #NoTrayIcon ;#RequireAdmin #include <WinAPISys.au3> #include <GDIPlus.au3> #include <WinAPIShellEx.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include <StaticConstants.au3> Example() Func Example() Local $hGUI, $hGraphic, $hIcon, $hBitmap, $iX = 768, $iY = 525 $hGUI = GUICreate("GDI+", $iX, $iY) _GDIPlus_Startup() ; Create GUI Global $idPic = GUICtrlCreatePic("", 0, 0, $iX, $iY) Global $sFileName = @ScriptDir& "\MAIN.png" $hImage = _GDIPlus_ImageLoadFromFile($sFileName) $iX = _GDIPlus_ImageGetWidth($hImage) $iY = _GDIPlus_ImageGetHeight($hImage) $hBGImage = _GDIPlus_BitmapCreateFromScan0($iX, $iY) $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBGImage) _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0) $btnx = 250 $btny = 150 ;_GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF) $hIcon = _WinAPI_ShellExtractIcon(@SystemDir & '\shell32.dll', 221, 48, 48) $hBitmap = _GDIPlus_BitmapCreateFromHICON32($hIcon) _GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, $btnx, $btny) $shBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBGImage) _WinAPI_DeleteObject(GUICtrlSendMsg($idPic, 0x0172, 0, $shBitmap)) ; STM_SETIMAGE = 0x0172, $IMAGE_BITMAP = 0 GUICtrlSetState($idPic, $gui_disable) GUICtrlSetState(-1, $GUI_ONTOP) GUICtrlSetCursor(-1, 0) $hIcon = GUICtrlCreateIcon(@SystemDir & '\shell32.dll', -1, $btnx, $btny, 48, 48, BitOR($SS_NOTIFY, $SS_BLACKRECT)) GUISetState() ; Loop until user exits Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $hIcon ConsoleWrite("Icon clicked" & @CRLF) EndSwitch Until False ; Clean up resources _WinAPI_DestroyIcon($hIcon) _WinAPI_DeleteObject($shBitmap) _GDIPlus_BitmapDispose($hImage) _GDIPlus_BitmapDispose($hBGImage) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndFunc ;==>Example
    3 points
  23. ioa747

    _Msg

    _Msg($iUI, $sText, $sTitle = @ScriptName, $iTimeout = 3, $iOption = 0) Displays a message using different UI elements based on the specified $iUI parameter. ; https://www.autoitscript.com/forum/topic/212945-_msg/ #include <MsgBoxConstants.au3> #include <TrayConstants.au3> #include <AutoItConstants.au3> ; #FUNCTION# ==================================================================================================================== ; Name...........: _Msg ; Description....: Displays a message using different UI elements based on the specified $iUI parameter. ; Syntax.........: _Msg($iUI, $sText, $sTitle = @ScriptName, $iTimeout = 3, $iOption = 0) ; Parameters.....: $iUI - Specifies the UI element to use: ; 0 - Return - nothing ; 1 - ConsoleWrite ; 2 - MsgBox ; 3 - ToolTip ; 4 - TrayTip ; $sText - The message text to be displayed. ; $sTitle - [optional] The title of the UI element. (Default is @ScriptName) ; $iTimeout - [optional] Timeout in seconds for displaying the message. (Default is 3) ; $iOption - [optional] Options for MsgBox, ToolTip, and TrayTip. (Default is 0) ; Return values .: Success: No specific return value, function exits after display. ; Failure: None ; Example .......: _Msg(1, "Hello, this is a test message.", @ScriptName, 5) ; =============================================================================================================================== Func _Msg($iUI, $sText, $sTitle = Default, $iTimeout = 3, $iOption = 0) If $sTitle = Default Then $sTitle = @ScriptName Switch $iUI Case 0 ; ### 0 Return - Does nothing, just exits the function. Return Case 1 ; ### 1 ConsoleWrite ConsoleWrite($sTitle & ": " & $sText & @CRLF) Case 2 ; ### 2 MsgBox MsgBox($iOption, $sTitle, $sText, $iTimeout) Case 3 ; ### 3 ToolTip ToolTip($sText, Default, Default, $sTitle, $iOption) Sleep($iTimeout * 1000) ; ToolTip doesn't have built-in timeout, so we use Sleep ToolTip("") ; Clear the tooltip after the timeout Case 4 ; ### 4 TrayTip TrayTip($sTitle, $sText, $iTimeout, $iOption) Sleep($iTimeout * 1000) ; give time to display it Case Else ; ### Else case - Does nothing, just exits the function. Return EndSwitch EndFunc ;==>_Msg ; Example Usage of _Msg Function ; ### ConsoleWrite ############################################### ; ConsoleWrite Example _Msg(1, "This message appears in the AutoIt console.", "Console Output") ; ConsoleWrite Example - Information-sign icon consisting of an 'i' in a circle _Msg(1, "This is an informational message.", "> Info") ; ConsoleWrite Example - Stop-sign icon _Msg(1, "This is a error message.", "! Error") ; ConsoleWrite Example - Question-mark icon _Msg(1, "This is a question message.", "+ Question") ; ConsoleWrite Example - Exclamation-point icon _Msg(1, "This is a warning message.", "- Warning") ; ### MsgBox ############################################### ; MsgBox Example - Information-sign icon consisting of an 'i' in a circle _Msg(2, "This is an informational message box.", "Info", 3, $MB_ICONINFORMATION) ; MsgBox Example - Stop-sign icon _Msg(2, "This is a error message box.", "Error", 3, $MB_ICONERROR) ; MsgBox Example - Question-mark icon _Msg(2, "This is a question message box.", "Question", 3, $MB_ICONQUESTION) ; MsgBox Example - Exclamation-point icon _Msg(2, "This is a warning message box.", "Warning", 3, $MB_ICONWARNING) ; ### ToolTip ############################################### ; ToolTip Example - no icon _Msg(3, "This is a question ToolTip.", "noicon", 3, $TIP_NOICON) ; ToolTip Example - Information-sign icon consisting of an 'i' in a circle _Msg(3, "This is an informational ToolTip.", "Info", 3, $TIP_INFOICON) ; ToolTip Example - error icon _Msg(3, "This is a error ToolTip.", "Error", 3, $TIP_ERRORICON) ; ToolTip Example - Warning icon _Msg(3, "This is a warning ToolTip.", "Warning", 3, $TIP_WARNINGICON) ; ### TrayTip ############################################### ; TrayTip Example - no icon _Msg(4, "This is a question TrayTip.", "noicon", 3, $TIP_ICONNONE) ; TrayTip Example - Information-sign icon consisting of an 'i' in a circle _Msg(4, "This is an informational TrayTip.", "Info", 3, $TIP_ICONASTERISK) ; TrayTip Example - error icon _Msg(4, "This is a error TrayTip.", "Error", 3, $TIP_ICONHAND) ; TrayTip Example - Warning icon _Msg(4, "This is a warning TrayTip.", "Warning", 3, $TIP_ICONEXCLAMATION) ; ################################################## ; Return Example (does nothing visible) _Msg(0, "This message will not be displayed.", "No Output") ; MsgBox Example $iTimeout = 0 _Msg(2, "All message examples have been executed.", "Examples Finished", 0)
    3 points
  24. Added an example how to play a webp animation on the desktop background behind the icons -> WebP See WebP Example14.au3. You need beside the appropriate _WebP_x??.dll also "Rostislav Uzunov Animation 480x270@30FPS.webp". Exit of the script only from the taskbar yet. It is very CPU intensive.
    2 points
  25. Here is initial version. Coordinates are wrong. I need to do other things now. #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WinAPITheme.au3> #include "GUIDarkMode_v0.02mod.au3" #include "ModernMenuRaw.au3" #include <GuiMenu.au3> #include <Array.au3> #include <WinAPIDiag.au3> #include <WinAPIConv.au3> #include <WinAPIGdiDC.au3> DllCall("User32.dll", "bool", "SetProcessDpiAwarenessContext", "HWND", "DPI_AWARENESS_CONTEXT" - 4) _SetMenuBkColor(0x202020) _SetMenuIconBkColor(0x202020) _SetMenuIconBkGrdColor(0x202020) _SetMenuSelectBkColor(0x202020) _SetMenuSelectRectColor(0x202020) _SetMenuSelectTextColor(0xFFFFFF) _SetMenuTextColor(0xFFFFFF) Example() Func Example() $hGUI = GUICreate("My GUI", 300, 200) ;Local $idFileMenu = GUICtrlCreateMenu("&File") Local $idFileMenu = _GUICtrlCreateODTopMenu("&File", $hGUI) GUICtrlCreateMenuItem("&Open", $idFileMenu) GUICtrlCreateMenuItem("&Save", $idFileMenu) GUICtrlCreateMenuItem("", $idFileMenu) Local $idOptionsMenu = GUICtrlCreateMenu("O&ptions", $idFileMenu) GUICtrlCreateMenuItem("View", $idOptionsMenu) GUICtrlCreateMenuItem("", $idOptionsMenu) GUICtrlCreateMenuItem("Tools", $idOptionsMenu) GUICtrlCreateMenuItem("", $idFileMenu) Local $idExitItem = GUICtrlCreateMenuItem("&Exit", $idFileMenu) ;Local $idHelpMenu = GUICtrlCreateMenu("&?") Local $idHelpMenu = _GUICtrlCreateODTopMenu("&?", $hGUI) Local $idAboutItem = GUICtrlCreateMenuItem("&About", $idHelpMenu) Local $idEndBtn = GUICtrlCreateButton("End", 110, 140, 70, 20) GuiDarkmodeApply($hGUI) GUISetState(@SW_SHOW) $aMenuBarInfo = _GUICtrlMenu_GetMenuBarInfo($hGUI, 0, 1) _ArrayDisplay($aMenuBarInfo) $rcClient = _WinAPI_GetClientRect($hGUI) _WinAPI_DisplayStruct($rcClient, $tagRECT,"rcClinet before") ;CHAT GPT Local $aCall = DllCall("user32.dll", "int", "MapWindowPoints", _ "hwnd", $hGUI, _ ; hWndFrom "hwnd", 0, _ ; hWndTo "ptr", DllStructGetPtr($rcClient), _ "uint", 2) ;number of points - 2 for RECT structure If @error Then MsgBox($MB_ICONERROR, "Error", @error) Exit EndIf _WinAPI_DisplayStruct($rcClient, $tagRECT,"rcClinet after") $rcWindow = _WinAPI_GetWindowRect($hGUI) _WinAPI_OffsetRect($rcClient, -$rcWindow.left, -$rcWindow.top) $rcAnnoyingLine = DllStructCreate($tagRECT) $rcAnnoyingLine.left = $rcClient.left $rcAnnoyingLine.top = $rcClient.top $rcAnnoyingLine.right = $rcClient.right $rcAnnoyingLine.bottom = $rcClient.bottom ;~ _WinAPI_DisplayStruct($rcAnnoyingLine, $tagRECT) $rcAnnoyingLine.bottom = $rcAnnoyingLine.top $rcAnnoyingLine.top = $rcAnnoyingLine.top - 1 ;~ _WinAPI_DisplayStruct($rcAnnoyingLine, $tagRECT,"annoying line") $hDC = _WinAPI_GetDC($hGUI) $hSolidBrush=_WinAPI_CreateBrushIndirect($BS_SOLID, 0xFF00FF) _WinAPI_FillRect($hDC, $rcAnnoyingLine, $hSolidBrush) _WinAPI_ReleaseDC($hGUI, $hDC) _WinAPI_DisplayStruct($rcAnnoyingLine, $tagRECT,"annoying line") Local $idMsg ; Loop until the user exits. While 1 $idMsg = GUIGetMsg() Switch $idMsg Case $idExitItem, $idEndBtn, $GUI_EVENT_CLOSE _WinAPI_DeleteObject($hSolidBrush) ExitLoop Case $idAboutItem MsgBox($MB_SYSTEMMODAL, "About...", "Colored menu sample") EndSwitch WEnd EndFunc ;==>Example
    2 points
  26. Technically, it can be launched separately without geckodriver, but the correct parameters need to be utilized so that it behaves the same as when launched via the webdriver. I don't remember the exact parameters, but I used to do this so I know it is possible. I think a search of the forum (and maybe the wiki) would provide the information.
    2 points
  27. I set a good challenge, it's giving good results I told @UEZ to come, he comes in like Superman 🤣
    2 points
  28. I've come this far, I'm struggling to figure out how to set the transparency. Testet in Win10 22H2 #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WinAPISysInternals.au3> #include <WindowsConstants.au3> ; Getting the right WorkerW window Global $hWorkerW = _FindWorkerW_WithStyles() ConsoleWrite("$hWorkerW=" & $hWorkerW & @CRLF) If Not $hWorkerW Then Exit ConsoleWrite("! Error Could not find WorkerW window." & @CRLF) Main() Func Main() Local $this = GUICreate("", 400, 400, @DesktopWidth - (400) - 20, 100, $WS_POPUP, $WS_EX_NOACTIVATE) ;~ WinSetTrans($this, "", 200) ; not working GUISetBkColor(0x000000) Local $iPic = GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg", 0, 0, 0, 0) GUISetState(@SW_SHOW) ; Changes the parent window _WinAPI_SetParent($this, $hWorkerW) WinSetTrans($this, "", 100) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($this) EndFunc ;==>Main Func _FindWorkerW_WithStyles($iWidth = @DesktopWidth, $iHeight = @DesktopHeight) ; Getting the right WorkerW window with criteria ; size: 1920, 1080 ; visible: Yes ; style: Popup,Tool Window,Transparent Local $aList = WinList("[CLASS:WorkerW]") For $i = 1 To $aList[0][0] Local $hWnd = $aList[$i][1] If Not IsHWnd($hWnd) Then ContinueLoop ; Get visibility If Not BitAND(WinGetState($hWnd), 2) Then ContinueLoop ; Get position and size Local $aPos = WinGetPos($hWnd) If @error Then ContinueLoop If $aPos[2] <> $iWidth Or $aPos[3] <> $iHeight Then ContinueLoop ; Get styles Local $nStyle = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE) ; $GWL_STYLE Local $nExStyle = _WinAPI_GetWindowLong($hWnd, $GWL_EXSTYLE) ; $GWL_EXSTYLE ; Check for required style flags If BitAND($nStyle, $WS_POPUP) = $WS_POPUP _ And BitAND($nExStyle, $WS_EX_TOOLWINDOW) = $WS_EX_TOOLWINDOW _ And BitAND($nExStyle, $WS_EX_TRANSPARENT) = $WS_EX_TRANSPARENT Then Return $hWnd EndIf Next Return 0 ; Not found EndFunc ;==>_FindWorkerW_WithStyles
    2 points
  29. Programming is a problem-solving challenge. Exactly as in the example, I need to display an image under the desktop icons, unfortunately the icons are placed under the application and cause user objections. This image could be a local calendar display. The idea of producing a unified background as suggested by "KaFu" was my first alternative solution, but I am looking for a solution to the problem as much as possible. For example, until some time ago, the code sample that "Nine" shared with the title "Create an Application Bar recognized by the system" was perhaps impossible. Nine, that code sample was very usefull, thank you very much for that code. 🥰 I did not even see a standard function or solution for sending the application to the lowest display layer, such as the functions that keep the application in the highest display layer. I'm just wondering why UEZ hasn't commented yet ?! He usually comes in with something magical like Superman.🤩😁
    2 points
  30. The idea is to be able to share information in the forum when a struct data needs to be shared among us. As an example, lets say that we wanna share what comes out of $tagOSVERSIONINFOEX. We could just run: #include <WinAPIMisc.au3> #include <WinAPIDiag.au3> #include <Debug.au3> #include <Sqlite.au3> Exit GetOs() Func GetOs() Local $tOSVERSIONINFOEX = DllStructCreate($tagOSVERSIONINFOEX) DllStructSetData($tOSVERSIONINFOEX, 1, DllStructGetSize($tOSVERSIONINFOEX)) Local $aCall = DllCall('kernel32.dll', 'bool', 'GetVersionExW', 'struct*', $tOSVERSIONINFOEX) If @error Or Not $aCall[0] Then Return SetError(@error, @extended, 0) Local $aArray = _WinAPI_DisplayStruct_mod($tOSVERSIONINFOEX, $tagOSVERSIONINFOEX, '', 0, 0, 0, True, 0, 1) Local $sText = _SQLite_Display2DResult($aArray, 0, True) ConsoleWrite(@CRLF & $sText & @CRLF & @CRLF) ; for those outside the editor Local $iW = 600, $iH = 300, $hGui = GUICreate(@ScriptName, $iW, $iH) GUISetFont(10, 400, 0, "Terminal") Local $idEdit = GUICtrlCreateEdit($sText, 0, 0, $iW, $iH) GUISetState() While GUIGetMsg() <> -3 WEnd GUIDelete($hGui) EndFunc ;==>GetOs ... ... and share the text that comes out: - - 0x0125DC18 <struct> 0 - 1 OSVersionInfoSize 0 DWORD 4 284 2 MajorVersion 4 DWORD 4 10 3 MinorVersion 8 DWORD 4 0 4 BuildNumber 12 DWORD 4 22631 5 PlatformId 16 DWORD 4 2 6 CSDVersion 20 WCHAR[128] 256 7 ServicePackMajor 276 USHORT 2 0 8 ServicePackMinor 278 USHORT 2 0 9 SuiteMask 280 USHORT 2 256 10 ProductType 282 BYTE 1 1 11 Reserved 283 BYTE 1 - - - 0x0125DD34 <endstruct> 284 - So the mod. I made to _WinAPI_DisplayStruct() is here ( with the complete running example from above ) This way is easier to share such. I know this is a lazy way to do it but, is a fast mod. and does what is needed to get the data as text.
    2 points
  31. This did it. This solved my problem. It's funny, too, because _WinAPI_SetParent() was problematic at one point causing issues by destroying the theming. And now here comes _WinAPI_SetParent() to save the day by restoring the lovely theming. It blows my mind! Thank you so much for your help and for your time with this. I appreciate it, as always. You've saved me a few times now already. Now I can move on to the not-so-fun DPI awareness control sizing stuff.
    2 points
  32. ...so, yes. It should work everywhere. When he claimed that something changed drastically ( not sure what ) I jumped into getting the latest to test and not make a fool of my self calling Bill to give him a piece of my mind !. Fortunately, I didn't have to 😇
    2 points
  33. Hi @pixelsearch thank again for your feedback. Regarding 1) my bad. The example 08 doesn't contain a check if creation fails - it just proceeds. Easy to fix: Global $sFile = @ScriptDir & "\TestAnim.webp" Global $iResult = WebP_CreateWebPCreateAnim($aFrames, $sFile) If $iResult < 1 Or @error Then ConsoleWrite($iResult & " / " & @error & @CRLF) _GDIPlus_Shutdown() Exit MsgBox($MB_ICONERROR, "Error", "Something went wrong creating the animation!") EndIf 2) to be honest - I'm too lazy to create a GUI with all parameters. I'm not sure if all the parameters are required or will ever be needed, but I'm happy to include this as Example08.1.au3. It would only make sense if the value range per parameter was listed in the GUI. The ranges should be described in the UDF header.
    2 points
  34. Updated to v0.3.8 build 2025-07-04 beta added loop count parameter for the 3 animation functions. Default = 0 which is endless. added WebP_GetImagesDiffFromFile() which can compare two WebP files which same dimension
    2 points
  35. There are some great responses and creative ideas here. Thank you all so much. I apologize for my delay in responding. I hope that I don’t seem rude for the delay. I had moved forward with other parts of the GUI while my mind (and ideas) was fresh. Later today I am going to return to this important part of my GUI and I will try the various ideas. Once I get a chance to try them, I will respond here to each of your ideas. As always, I am grateful for your time and your help.
    2 points
  36. following the instructions of argumentum I got this far #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> Global $g_idListView Global $g_bListViewVisible = False Global $g_InputCombo _MainGUI() Func _MainGUI() Local $hGUI = GUICreate("fake combo", 364, 250) Local $iX = 65, $iY = 30, $iW = 150, $iH = 21 ; fake combo $g_InputCombo = GUICtrlCreateInput("", $iX, $iY, $iW, $iH) Local $idBtnCombo = GUICtrlCreateButton("🔻", $iX + $iW, $iY - 1, $iH + 2, $iH + 2) ; ListView $g_idListView = GUICtrlCreateListView("", $iX, $iY + $iH, $iW + $iH, 180, BitOR($LVS_NOCOLUMNHEADER, $LVS_REPORT), BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_TRACKSELECT)) GUICtrlSetState($g_idListView, $GUI_HIDE) ; hidden ; Add columns _GUICtrlListView_AddColumn($g_idListView, "", $iW) ; Enable group view _GUICtrlListView_EnableGroupView($g_idListView) ; Group 1 _GUICtrlListView_InsertGroup($g_idListView, -1, 1, "Fruits") _GUICtrlListView_AddItem($g_idListView, "Apple") _GUICtrlListView_SetItemGroupID($g_idListView, _GUICtrlListView_GetItemCount($g_idListView) - 1, 1) _GUICtrlListView_AddItem($g_idListView, "Banana") _GUICtrlListView_SetItemGroupID($g_idListView, _GUICtrlListView_GetItemCount($g_idListView) - 1, 1) ; Group 2 _GUICtrlListView_InsertGroup($g_idListView, -1, 2, "Vegetables") _GUICtrlListView_AddItem($g_idListView, "Carrot") _GUICtrlListView_SetItemGroupID($g_idListView, _GUICtrlListView_GetItemCount($g_idListView) - 1, 2) _GUICtrlListView_AddItem($g_idListView, "Spinach") _GUICtrlListView_SetItemGroupID($g_idListView, _GUICtrlListView_GetItemCount($g_idListView) - 1, 2) ; Group 3 _GUICtrlListView_InsertGroup($g_idListView, -1, 3, "Dairy") _GUICtrlListView_AddItem($g_idListView, "Milk") _GUICtrlListView_SetItemGroupID($g_idListView, _GUICtrlListView_GetItemCount($g_idListView) - 1, 3) ; Register the message handler GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $idBtnCombo ; Toggle ListView visibility If Not $g_bListViewVisible Then GUICtrlSetState($g_idListView, $GUI_SHOW + $GUI_FOCUS) $g_bListViewVisible = True Else GUICtrlSetState($g_idListView, $GUI_HIDE) $g_bListViewVisible = False EndIf EndSwitch WEnd EndFunc ;==>_MainGUI ;--------------------------------------------------------------------------------------- Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $hWndListView = GUICtrlGetHandle($g_idListView) Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam) Local $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) Local $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $NM_CLICK Local $iIndex = _GUICtrlListView_GetSelectionMark($g_idListView) ; Get the index of the last selected item ; Ensure a valid item was selected If $iIndex <> -1 Then Local $sItemText = _GUICtrlListView_GetItemText($g_idListView, $iIndex, 0) If $sItemText <> "" Then GUICtrlSetData($g_InputCombo, $sItemText) GUICtrlSetState($g_idListView, $GUI_HIDE) GUICtrlSetState($g_InputCombo, $GUI_FOCUS) $g_bListViewVisible = False EndIf EndIf Return 0 Case $NM_DBLCLK Return 0 EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY ;--------------------------------------------------------------------------------------- Edit: Normally it would require handling $WM_KILLFOCUS and keyboard navigation, but the code would grow. Just the central idea
    2 points
  37. Hello everyone, I'm pleased to share a UDF I developed to work with IWICImagingFactory from the Windows Imaging Component (WIC), focused exclusively on reading and writing image metadata. 🔍 Why this UDF? IWICImagingFactory is a powerful API but can also be particularly confusing when working with metadata. Its layers of abstraction, data formats, and interface complexity can easily distract you from your goals without a clear structure. 🧩 Key Features: 🔄 Read and write metadata using WIC interfaces (IWICMetadataQueryReader, IWICMetadataQueryWriter) 💾 Supports common formats (JPEG, PNG, TIFF, etc.) 🧠 Built using an object-oriented model via AutoItObject to encapsulate complexity and avoid side effects ⚠️ Full support for PROPVARIANT and VARIANT types, essential for COM interaction 🔗 Handles the WIC metadata query language (e.g., /app1/ifd/exif:{ushort=36867} for Date Taken) 📜 Works with WIC-compliant hierarchical metadata queries 🧠 Prerequisites / Recommended Knowledge Solid understanding of COM programming in AutoIt Familiarity with PROPVARIANT/VARIANT (types, conversion, init/cleanup) Knowledge of WIC metadata schema and hierarchy Comfortable with object-oriented programming in AutoIt (using AutoItObject) 🧪 Why use an object-oriented approach? IWICImagingFactory is as flexible as it is tricky. Exploring it directly can lead to unexpected behaviors or technical detours. The object-oriented approach helps contain this complexity, structure features properly, and avoid common pitfalls when dealing with raw COM interfaces. 📁 What’s Included in the UDF A main object WICImageMeta (or similar) that encapsulates the image, reader/writer, and associated interfaces Straightforward methods like .ReadMeta($sPath), .WriteMeta($sPath, $vValue, $sType), .Save($sDest), etc. Automatic resource management (Release, Cleanup) Examples for reading/writing EXIF, XMP, and other metadata 📷 Quick Usage Example #include <MsgBoxConstants.au3> #include <WinAPI.au3> #include <Array.au3> #include "IWICImagingMetadata.au3" ; This is your custom UDF for WIC metadata ; Path to a test image (replace with your own file path) Local $sFilename = @DesktopDir & "\screenshot.png" ; === 1. Create the WIC Imaging Factory === ; This is the entry point for all WIC operations Local $oFactory = _WIC_ImagingFactory() If Not IsObj($oFactory) Then MsgBox(0, "Error", "Failed to create WIC Imaging Factory") Exit EndIf ; === 2. Create a decoder from the image file === ; This will analyze the image format and prepare for frame extraction Local $oDecoder = $oFactory.createDecoderFromFileName($sFilename) If Not IsObj($oDecoder) Then MsgBox(0, "Error", "Failed to create image decoder: @error=" & @error) $oFactory = 0 Exit EndIf ; === 3. Get the first frame of the image === ; Most still images have a single frame; this retrieves it from the decoder Local $oFrame = $oFactory.createBitmapFrameDecode($oDecoder) If Not IsObj($oFrame) Then MsgBox($MB_ICONERROR, "Error", "Failed to retrieve image frame: @error=" & @error) $oDecoder = 0 $oFactory = 0 Exit EndIf ; === 4. Get a metadata query reader from the frame === ; This reader allows you to query metadata values using WIC metadata paths Local $oQueryReader = $oFactory.getMetadataQueryReader($oFrame) If Not IsObj($oQueryReader) Then MsgBox(0, "Error", "Failed to get metadata query reader: @error=" & @error) $oFrame = 0 $oDecoder = 0 $oFactory = 0 Exit EndIf ; === 5. Enumerate available metadata names === ; This step is crucial to explore what metadata is actually present. ; It returns an array of metadata query paths that can be used. Local $aNames = $oFactory.enumerateMetaDataNames($oQueryReader) If @error Then ConsoleWrite("Error: Failed to enumerate metadata names: @error=" & @error & @CRLF) Else ConsoleWrite("Available metadata names: " & _ArrayToString($aNames, "|") & @CRLF) EndIf ; === 6. Read a specific metadata value === ; In this case, we're trying to read a textual field: "Creation Time" in a PNG tEXt chunk Local $sQuery = "/tEXt/{str=Creation Time}" Local $vData = $oFactory.queryMetadataByName($oQueryReader, $sQuery) If Not @error Then ConsoleWrite("Metadata read: " & $sQuery & " = " & $vData & @CRLF) Else ConsoleWrite("Error: Failed to read " & $sQuery & " : @error=" & @error & @CRLF) EndIf ; === NOTE === ; If your query selects a metadata **block**, then `vData` may be another IWICMetadataQueryReader object. ; In that case, you must call `queryMetadataByName` again, passing this sub-reader to reach nested values. 💬 Conclusion If you've worked with image metadata using WIC before, you know it's a technical challenge. This UDF aims to simplify the process while preserving full control for those who need fine-grained access. Feel free to try it out, give feedback, or suggest improvements. Enjoy digging into the hidden data of your images! 📸 IWICImagingMetadata.au3
    2 points
  38. Updated to WebP v0.3.6 build 2025-07-02 beta -> you can convert now GIF animated files to WebP animated files (see Example10.au3 on my 1Drv).
    2 points
  39. One way to launch other tools while a compiled program is running would be to use a tool like this: Scite Plusbar
    2 points
  40. Understand the request, but this is how the internals work in SciTE to be able to capture the output generated by the Script. These are things I won't be trying to change unless it is changed in the Core version supported by Neil.
    2 points
  41. Yes, I forgot to removed these lines for the other functions but I need to add the code also for the other function with callbacks. Currently only function "WebP_CreateWebPCreateAnimFromScreenCapture" in the dll is implemented (example 9) for callback but it should be easy to add also for the other functions. I think tomorrow I will add it to the other functions, too.
    2 points
  42. vs. If you would like to pin the script to the taskbar ( or the start menu ), it can be done with a link. This script is an example and demonstration. The way that I go about it, is to have the script and icon with the same name. The easiest way to test this is if the post had it all in a ZIP file so, there: Example AutoIt v3 Script_v2.zip Also, it's easier to find in task manager given that you can see your icon.
    2 points
  43. Jon

    GimageX updates

    I've updated GImageX with the latest version of the ADK. (Dec 2024 version). Don't think the ADK version was the OP's issue. But updated it anyway.
    2 points
  44. I dont see $btny used anywhere, $btnx appears to be used for both X and Y positions.
    2 points
  45. I misunderstood the value but it's easy, too: Local $iIntensity = '80' ;% of the alpha channel Local $iTintColor = '0x0078D4' $iIntensity = Int($iIntensity) * 255 / 100 Local $iColor = BitOR(BitShift($iIntensity > 255 ? 255 : $iIntensity < 0 ? 0: $iIntensity, -24), Int($iTintColor)) ConsoleWrite(Hex($iColor, 8) & @CRLF) _WinAPI_DwmEnableBlurBehindWindow10($hGUI, True, $iColor)
    2 points
  46. If all this is for coloring, there is code for all that in https://www.autoitscript.com/forum/files/file/489-my-fine-tuned-high-contrast-theme/ If is for Hex, do give the user 255% because, why not. It'd simplify your code, enlighten the user, and gives fine control ( other wise you'd have to calculate "value * 2.55" each step ) for those that are very picky with colors. I look at it as from zero to Maximum Effort !
    2 points
  47. Would it instead be possible to have some sort of state such that you enable or disable the possibility of having ".Property" as valid? It seems like nested rules would be much more difficult/annoying to implement. Then again, I know very little of parsers having only ever made ~1/2 to 3/4 of one myself After skimming your parser: I might look up PegJS later tonight, but I don't think that my idea will work there. This. Is. Fantastic! 1.8.5 does fix my issue, thank you!
    2 points
  48. ConsoleWrite(percentageOfAlpha(80, 0xFF1234FF) & @CRLF) ConsoleWrite(percentageOfAlpha(80, '0xFF0000FF') & @CRLF) ConsoleWrite(percentageOfAlpha(80, 0x0000FF) & @CRLF) ConsoleWrite(percentageOfAlpha(80, '0x0000FF') & @CRLF) Func percentageOfAlpha($iVal, $iColor) Return "0x" & percentageOfHex($iVal) & Hex($iColor, 6) ;~ Local $a = StringSplit(Hex($iColor, 6), "", 0) ;~ Return "0x" & percentageOfHex($iVal) & $a[$a[0] - 5] & $a[$a[0] - 4] & $a[$a[0] - 3] & $a[$a[0] - 2] & $a[$a[0] - 1] & $a[$a[0] - 0] EndFunc ;==>percentageOfAlpha Func percentageOfHex($iVal) $iVal = Int($iVal > 99 ? 100 : ($iVal < 1 ? 0 : $iVal)) ; no more than 100% or less than 0% Return Hex(Ceiling(($iVal * 100) * (2.55 * 100) / (100 * 100)), 2) ; calculate in integers, as floating point numbers suck in a CPU EndFunc ;==>percentageOfHex gotta say, my math is exquisite
    1 point
  49. Hi @WildByDesign 👋 , this is one of rar good examples on when to use AI (in my opinion). Please have a look: https://chatgpt.com/share/68593c0e-abac-800f-b469-a29209d5d520 I really just copy and paste your question and already got an idea of how an approach could look like. I don't suggest to use AI to generate AutoIt code, becauce AutoIt code examples are not listed/progressed enough in the most LLMs, but I suggest to get the idea (which is close to your thoughts above) and then come up with the code/solution in AutoIt for yourself or by us as community 😀 . Hopefully this is a good starting point. Best regards Sven
    1 point
  50. WildByDesign

    DwmColorBlurMica

    I had some users mention that my compiled binary (last bunch of releases) gets labelled as a virus. Out of all of the AVs out there, only 1 is doing this and of course it happens to be Microsoft. They call it "Trojan:Win32/Sabsik.FL.A!ml" in client version of Defender and "Trojan:Win32/Wacatac.B!ml" with their cloud AV on VirusTotal. I have submitted it to Microsoft as a false positive in hopes that it gets analyzed and removed sometime in the future but I am not holding my breath. From my security industry work, I know that the main reason why they do this is to encourage developers to purchase expensive code signing certificates. I don't know if this detection is AutoIt-related or not. Some of my other projects are getting flagged as well. Does anybody have any experience with this? EDIT: I am reading through the 15 page ( ) thread now but I don't know how much of that is current information or outdated.
    1 point
×
×
  • Create New...