Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation since 09/23/2025 in Posts

  1. So maybe i just haven't been looking hard enough, but i could not find how to make toast notifications in win8+ from AutoIt. I looked at it on and off, and finally made some progress. Github repository: https://github.com/genius257/au3toast Zip download: https://github.com/genius257/au3toast/archive/refs/tags/1.0.0.zip Enjoy!
    7 points
  2. V1.0.0 released! 🎊 Event on toast interaction now works! 🎉
    6 points
  3. Released v1.1.0 yesterday! Added Support for running the Format Document command via the Command Palette or hotkey using Tidy.exe on scripts, including automatic formatting on save Jest testing framework with test suite for language features and services Changed Refactored monolithic command code Upgraded build toolchain Diagnostic system overhaul with encoding handling and problem script source tracking Fixed Restored Go to Definition functionality for symbols declared outside of current script Restored Open Include file (Alt+i) functionality Path handling improvements Completion provider accuracy with user-defined functions View and Rate on VSCode Marketplace View and Rate on OpenVSX Star, Submit Issues, and Contribute on GitHub
    6 points
  4. Added File path validation to prevent path traversal attacks Parameter safety warnings for autoit.consoleParams to detect potentially dangerous shell metacharacters Workspace symbol performance optimizations with batch processing to prevent UI freezing on large projects Configuration options autoit.workspaceSymbolMaxFiles (default: 500) and autoit.workspaceSymbolBatchSize (default: 10) Configuration option autoit.symbolMaxLines (default: 50000) to control maximum lines processed for symbol information Warning message when files exceed symbol processing limit with actionable instructions Comprehensive unit tests for completion provider with 8 test cases Comprehensive README documentation improvements with installation guide, quick start section, platform support matrix, troubleshooting guide, and reorganized configuration Distribution scripts for packaging the extension to multiple marketplaces: package-all.js for simultaneous packaging to VS Code Marketplace and OpenVSX package-openvsx.js for OpenVSX-specific packaging with publisher name handling Fixed Command injection risk in registry update functionality by replacing exec with execFile for safer argument handling Multiple global output panels opening for AutoIt on startup Memory leak in completion provider where include cache grew indefinitely across document switches Incorrect array comparison logic in completion cache invalidation Cross-document contamination of completion items from include files Changed Simplified ESLint configuration by using globals package and removing redundant rules Workspace symbol cache now uses incremental updates instead of full invalidation on file changes Completion provider now uses per-document Map-based caching with LRU eviction (50 document limit) Include cache automatically cleans up when documents are closed Symbol processing limit increased from hardcoded 10,000 to configurable 50,000 lines by default Removed The unused autoit.YAML-tmLanguage file Rate and View on VS Code Marketplace Star & Submit Issues on GitHub
    5 points
  5. Hi @Gianni, Thanks you, glad to see the interest in the code Yes, the $data variable contains a pointer to a array of NOTIFICATION_USER_INPUT_DATA elements. The length of the array is given via the $count variable. Something like this should do it (not tested yet) $pData = $data For $i = 1 To $count $tData = DllStructCreate('PTR Key;PTR Value;', $pData) $key = _WinAPI_GetString($tData.Key) $value = _WinAPI_GetString($tData.Value) ConsoleWrite(StringFormat('"%s"="%s"\n', $key, $value)) $pData += DllStructGetSize($tData) Next I think I'll update the example with inputs to demonstrate later, and I'll also add a helper function to convert the data array into a Map I'll update the post later, when i have time to test the code, if something does not work
    4 points
  6. Hi @genius257, Very cool, I'm not familiar with this stuff, but it looks interesting. You've done a great job implementing it in AutoIt! I tried creating some simple test toasts in XML, but not all the tags work correctly at the moment (for example, the <image> tag doesn't display the image if the "src=" parameter is a URL...). Furthermore, it's mandatory to specify the activationType="background" parameter in the initial <toast...> tag... To generate my test toasts in XML, I installed this app (which also has ready-made templates): https://apps.microsoft.com/detail/9nblggh5xsl1 then, to insert the generated XML code into your example listing in AutoIt, I copy the generated code to the clipboard (select the listing and press Ctrl-C), and immediately run this little script (F5 in SciTE), which adapts it and puts it back in the clipboard. I then paste it into the AutoIt listing. Local $sVarName = "$sToast" Local $aStr = StringSplit(ClipGet(), @CRLF, 1) ; get the clipboard content Local $sListing ; = "Func " & $sFuntionName & "()" & @CRLF $sListing &= 'Local ' & $sVarName & ' = ""' & @CRLF For $i = 1 To $aStr[0] $sListing &= $sVarName & ' &= "' & StringReplace($aStr[$i], '"', '""') & '" ' & @CRLF Next ClipPut($sListing) ConsoleWrite($sListing) This is an example of output (which I later modified a bit) to insert into the example script. Local $sToast = "" $sToast &= "<toast activationType=""background"" launch=""action=viewAlarm&amp;alarmId=3"" scenario=""alarm"">" $sToast &= "" $sToast &= " <visual>" $sToast &= " <binding template=""ToastGeneric"">" $sToast &= " <text>Time to wake up!</text>" $sToast &= " <text>To prove you're awake, select which of the following fruits is yellow...</text>" $sToast &= ' <image placement="appLogoOverride" src="file://' & @TempDir & '\e21cd29c9fb51c3a5b82f009ec33fc997d2edd1ece931e8568f37e205c445778.jpeg" hint-crop="circle"/>' $sToast &= " </binding>" $sToast &= " </visual>" $sToast &= "" $sToast &= " <actions>" $sToast &= "" $sToast &= " <input id=""answer"" type=""selection"" defaultInput=""wrongDefault"">" $sToast &= " <selection id=""wrong"" content=""Orange""/>" $sToast &= " <selection id=""wrongDefault"" content=""Blueberry""/>" $sToast &= " <selection id=""right"" content=""Banana""/>" $sToast &= " <selection id=""wrong"" content=""Avacado""/>" $sToast &= " <selection id=""wrong"" content=""Cherry""/>" $sToast &= " </input>" $sToast &= "" $sToast &= " <action" $sToast &= " activationType=""system""" $sToast &= " arguments=""snooze""" $sToast &= " content=""""/>" $sToast &= "" $sToast &= " <action" $sToast &= " activationType=""background""" $sToast &= " arguments=""dismiss""" $sToast &= " content=""Dismiss""/>" $sToast &= "" $sToast &= " </actions>" $sToast &= ' <audio src=''ms-winsoundevent:Notification.Looping.Alarm'' loop=''false''/>' $sToast &= "</toast>" .. I hope you can implement support for events too... Bye and thanks! P.S. There was a notification "emulator" at this link:: Notifications UDF - Desktop notifications 1.2 (updated Mai 1st) - AutoIt Example Scripts - AutoIt Forums
    4 points
  7. Progress! ... Click the form button beside of the cursor button (more than once if you want to). Now the windows are clipped to the left too! #include-once Opt("WinTitleMatchMode", 4) ; advanced Opt("MouseCoordMode" , 2) #include <WindowsStylesConstants.au3> #include <ButtonConstants.au3> #include <GuiConstantsEx.au3> Global $formList[], $formCount = 0 Global Const $main_width = 815 Global Const $main_height = 860 Global Const $main_left = (@DesktopWidth / 2) - ($main_width / 2) Global Const $main_top = (@DesktopHeight / 2) - ($main_height / 2) Global Const $guiCanvas = GuiCreate("GUI Canvas", $main_width, $main_height, $main_left, $main_top) Global Const $canvas = GuiCreate('', ($main_width - 105), ($main_height - 35), 95, 5, $WS_CHILD, $WS_EX_OVERLAPPEDWINDOW, $guiCanvas) GUISetFont(10, -1, -1, "Segoe UI", $guiCanvas) #region ; menu items Global Const $menu_file = GUICtrlCreateMenu ("File") Global Const $menu_save_definition = GUICtrlCreateMenuitem("Save", $menu_file) ; Roy add-on Global Const $menu_load_definition = GUICtrlCreateMenuitem("Load", $menu_file) ; Roy add-on GUICtrlCreateMenuitem('' , $menu_file) ; Roy add-on Global Const $menu_exit = GUICtrlCreateMenuitem("Exit", $menu_file) Global Const $menu_edit = GUICtrlCreateMenu ("Edit") Global Const $menu_vals = GUICtrlCreateMenuitem("Vals" , $menu_edit) ; added by: TheSaint Global Const $menu_wipe = GUICtrlCreateMenuitem("Clear all controls", $menu_edit) Global Const $menu_about = GUICtrlCreateMenuitem("About" , $menu_edit) ; added by: TheSaint GUICtrlSetState($menu_wipe, $GUI_DISABLE) Global Const $menu_settings = GUICtrlCreateMenu ("Settings") Global Const $menu_show_grid = GUICtrlCreateMenuItem("Show grid" , $menu_settings) Global Const $menu_grid_snap = GUICtrlCreateMenuItem("Snap to grid" , $menu_settings) Global Const $menu_paste_pos = GUICtrlCreateMenuItem("Paste at mouse position" , $menu_settings) Global Const $menu_show_ctrl = GUICtrlCreateMenuItem("Show control when moving", $menu_settings) Global Const $menu_show_hidden = GUICtrlCreateMenuItem("Show hidden controls" , $menu_settings) GUICtrlSetState($menu_show_grid , $GUI_CHECKED ) GUICtrlSetState($menu_grid_snap , $GUI_CHECKED ) GUICtrlSetState($menu_paste_pos , $GUI_CHECKED ) GUICtrlSetState($menu_show_ctrl , $GUI_CHECKED ) GUICtrlSetState($menu_show_hidden, $GUI_UNCHECKED) #endregion ; menu items #region ; toolbar Global Const $default_cursor = CreateToolButton("Cursor" , 5, 5) Global Const $toolForm = CreateToolButton("Form" , 45, 5) Global Const $toolGroup = CreateToolButton("Group" , 5, 45) Global Const $toolButton = CreateToolButton("Button" , 45, 45) Global Const $toolCheckbox = CreateToolButton("Checkbox" , 5, 85) Global Const $toolRadio = CreateToolButton("Radio" , 45, 85) Global Const $toolEdit = CreateToolButton("Edit" , 5, 125) Global Const $toolInput = CreateToolButton("Input" , 45, 125) Global Const $toolLabel = CreateToolButton("Label" , 5, 165) Global Const $toolUpDown = CreateToolButton("UpDown" , 45, 165) Global Const $toolList = CreateToolButton("List" , 5, 205) Global Const $toolCombo = CreateToolButton("Combo" , 45, 205) Global Const $toolDate = CreateToolButton("Date" , 5, 245) Global Const $toolTreeview = CreateToolButton("Treeview" , 45, 245) Global Const $toolProgress = CreateToolButton("Progress" , 5, 285) Global Const $toolAvi = CreateToolButton("Avi" , 45, 285) Global Const $toolIcon = CreateToolButton("Icon" , 5, 325) Global Const $toolPic = CreateToolButton("Pic" , 45, 325) Global Const $toolSlider = CreateToolButton("Slider" , 5, 365) Global Const $toolMenu = CreateToolButton("Menu" , 45, 365) Global Const $toolContextMenu = CreateToolButton("Context Menu", 5, 405) Global Const $toolTab = CreateToolButton("Tab" , 45, 405) #endregion ; toolbar main() Func main() GUISetState(@SW_SHOWNORMAL, $guiCanvas) GUISetState(@SW_SHOWNORMAL, $canvas) Local $msg Do $msg = GUIGetMsg($GUI_EVENT_ARRAY) Switch $msg[1] Case $guiCanvas Switch $msg[0] Case $toolForm CreateForm() Case $GUI_EVENT_CLOSE Exit EndSwitch EndSwitch Until False EndFunc Func CreateForm() GUISwitch($canvas) $formCount += 1 Local Const $form = GuiCreate("Form " & $formCount, 400, 600, 5, 5, BitOR($WS_CHILD, $WS_OVERLAPPEDWINDOW), -1, $canvas) $formList["Form" & $formCount] = $form GUISetState(@SW_SHOWNORMAL, $form) GUISwitch($guiCanvas) Return $form EndFunc Func CreateToolButton(Const $name, Const $left, Const $top) Local Const $tool = GUICtrlCreateRadio($name, $left, $top, 40, 40, BitOR($BS_PUSHLIKE, $BS_ICON)) GUICtrlSetImage($tool, @ScriptDir & "\resources\Icons\" & $name & ".ico") GUICtrlSetTip($tool, $name) Return $tool EndFunc
    3 points
  8. I just wanted to take a moment to thank everyone again who helped with this issue. I've completed the part of the project that relates to the menubar. I actually ended up coloring that line in such a way that it gives the GUI some depth and also made the statusbar sizing and style to match it. When I started learning AutoIt a little over a year ago, I never thought that such beautiful GUIs could be made. I was able to make that line semi-transparent along with the rest of the GUI so that it does the blur behind well and also the Windows 11 materials (Mica, Acrylic, etc.) Cheers everyone! 🍷
    3 points
  9. I am sure he's happy after 5 years!!! 😉
    3 points
  10. That's a very good point. I shouldn't have used a hardcoded path like that. I like the creative way that you used the @AutoItExe macro to get the AutoIt install directory. Thanks for sharing. This was a really fun example. Thanks for sharing. I didn't expect that a child GUI would work in this type of situation, so that was a neat surprise.
    3 points
  11. to test different patterns simultaneously ; https://www.autoitscript.com/forum/topic/212981-move-window-behind-desktop-icons/page/2/#findComment-1544444 #include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("MustDeclareVars", True) Example() Func Example() Local $hWorkerW = _GetDesktopWorkerW() If @error Then Exit MsgBox(16, @ScriptName, "! Error - Couldn't find WorkerW under Progman", 30) ConsoleWrite("WorkerW = " & $hWorkerW & @CRLF) ; Overlay GUICreate Local $hGUI = GUICreate("Overlay", @DesktopWidth, @DesktopHeight, -1, -1, $WS_POPUP, $WS_EX_TOOLWINDOW) Local $BkColor = 0x000000 GUISetBkColor($BkColor, $hGUI) GUISetFont(12) _WinAPI_SetParent($hGUI, $hWorkerW) _WinAPI_SetWindowLong($hGUI, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($hGUI, $GWL_EXSTYLE), $WS_EX_LAYERED)) _WinAPI_SetLayeredWindowAttributes($hGUI, 0, 150, $LWA_ALPHA) GUISetState(@SW_SHOWNOACTIVATE) Local $aChildGui[10] = [9], $aLbl[10] = [9] Local $iW = @DesktopWidth * 0.33, $iH = @DesktopHeight * 0.33, $iX = 0, $iY = 20, $iCnt = 0 For $i = 1 To 3 For $j = 1 To 3 $iCnt += 1 $aChildGui[$iCnt] = GUICreate("Child_" & $iCnt, $iW, $iH, $iX, $iY, $WS_CHILD, $WS_EX_TOOLWINDOW, $hGUI) $BkColor = "0x" & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2) ConsoleWrite("$BkColor=" & $BkColor & @CRLF) GUISetBkColor($BkColor, $aChildGui[$iCnt]) $aLbl[$iCnt] = GUICtrlCreateLabel("Child_" & $iCnt & ", BkColor:" & $BkColor, 0, 0, $iW, 25) GUICtrlSetFont(-1, 18) GUISetState(@SW_SHOWNOACTIVATE) $iX += $iW Next $iX = 0 $iY += $iH Next $iCnt = 0 While GUIGetMsg() <> $GUI_EVENT_CLOSE Sleep(50) $iCnt += 1 If $iCnt > 40 Then $iCnt = 0 For $i = 1 To $aChildGui[0] $BkColor = "0x" & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2) GUISetBkColor($BkColor, $aChildGui[$i]) GUICtrlSetData($aLbl[$i], "Child_" & $i & ", BkColor:" & $BkColor) Next EndIf WEnd EndFunc ;==>Example Func _GetDesktopWorkerW() Local $hWorkerW = 0, $hProgman = _WinAPI_GetShellWindow() _WinAPI_SendMessageTimeout($hProgman, 0x052C, 0, 0, 3000, $SMTO_NORMAL) ; same as _SendMessage() Local $aEnumWindows = WinList("[CLASS:WorkerW]") For $n = 1 To $aEnumWindows[0][0] Local $hWnd = $aEnumWindows[$n][1] If _WinAPI_GetParent($hWnd) = $hProgman Then Return SetError(0, $hProgman, $hWnd) Next Return SetError(1, $hProgman, 0) EndFunc ;==>_GetDesktopWorkerW
    3 points
  12. I was so grouchy at the thought of blasting away my Windows partition to reinstall Windows but thankfully I figured it out before I got that far. In Advanced System Properties (SystemPropertiesAdvanced.exe) in the Performance settings dialog - Visual Effects tab, there is a checkbox labelled "Animate controls and element inside windows". Apparently that simple little checkbox controls whether or not a WorkerW window is even allowed to be created under Progman. I have always disabled any and all animation effects in Windows for years. And this was one of them. After checking this box, WorkerW is able to be created under Progman and all is good now. All examples work on my machine now. I would have reinstalled Windows and it still would have failed because disabling animation effects is one of the first things that I do after a clean install. 😄
    3 points
  13. wakillon

    SlidingToolbar

    No need to click for see it, just put your mouse on the left side of your screen Why on the left? Because the taskbar is already crowded, on the right side we scroll, and at the top when we use our browser tab by tab, it's not convenient to have a GUI in the way. You can add Shortcut, InternetShortcut, Files, and Folder by drag and drop on any button (special folders not supported) Right click menu on it for delete item See tray menu for options To exit, click on the InfoBar at the bottom of the GUI or by tray menu SlidingToolbar.7z
    3 points
  14. UEZ

    AutoIt Snippets

    I don't know if something like this has already been posted. DarkMode API Calls (undocumented): ;Coded by UEZ build 2025-10-10 ;IMMERSIVE_HC_CACHE_MODE Enum $IHCM_USE_CACHED_VALUE, $IHCM_REFRESH Enum $Default, $AllowDark, $ForceDark, $ForceLight, $Max ;$iPreferredAppMode ;~ Enum $DWMWA_USE_IMMERSIVE_DARK_MODE = (@OSBuild <= 18985) ? 19 : 20 Func _WinAPI_ShouldAppsUseDarkMode() Local $aResult = DllCall("UxTheme.dll", "bool", 132) If @error Then Return SetError(1, 0, False) Return ($aResult[0] <> 0) EndFunc ;==>_WinAPI_ShouldAppsUseDarkMode Func _WinAPI_AllowDarkModeForWindow($hWND, $bAllow = True) Local $aResult = DllCall("UxTheme.dll", "bool", 133, "hwnd", $hWND, "bool", $bAllow) If @error Then Return SetError(1, 0, False) Return ($aResult[0] <> 0) EndFunc ;==>_WinAPI_AllowDarkModeForWindow Func _WinAPI_AllowDarkModeForApp($bAllow = True) ;Windows 10 Build 17763 Return _WinAPI_SetPreferredAppMode($bAllow ? 1 : 0) ; 1 = AllowDark, 0 = Default EndFunc ;==>_WinAPI_AllowDarkModeForApp Func _WinAPI_SetPreferredAppMode($iPreferredAppMode) ;Windows 10 Build 18362+ Local $aResult = DllCall("UxTheme.dll", "long", 135, "long", $iPreferredAppMode) If @error Then Return SetError(1, 0, False) Return $aResult[0] EndFunc ;==>_WinAPI_SetPreferredAppMode Func _WinAPI_FlushMenuThemes() Local $aResult = DllCall("UxTheme.dll", "none", 136) If @error Then Return SetError(1, 0, False) Return True EndFunc ;==>_WinAPI_FlushMenuThemes Func _WinAPI_RefreshImmersiveColorPolicyState() Local $aResult = DllCall("UxTheme.dll", "none", 104) If @error Then Return SetError(1, 0, False) Return True EndFunc ;==>_WinAPI_RefreshImmersiveColorPolicyState Func _WinAPI_IsDarkModeAllowedForWindow($hWND) Local $aResult = DllCall("UxTheme.dll", "bool", 137, "hwnd", $hWND) If @error Then Return SetError(1, 0, False) Return ($aResult[0] <> 0) EndFunc ;==>_WinAPI_IsDarkModeAllowedForWindow Func _WinAPI_GetIsImmersiveColorUsingHighContrast($iIMMERSIVE_HC_CACHE_MODE) Local $aResult = DllCall("UxTheme.dll", "bool", 106, "long", $iIMMERSIVE_HC_CACHE_MODE) If @error Then Return SetError(1, 0, False) Return ($aResult[0] <> 0) EndFunc ;==>_WinAPI_GetIsImmersiveColorUsingHighContrast Func _WinAPI_OpenNcThemeData($hWND, $tClassList) Local $aResult = DllCall("UxTheme.dll", "hwnd", 49, "hwnd", $hWND, "struct*", $tClassList) If @error Then Return SetError(1, 0, False) Return $aResult[0] EndFunc ;==>_WinAPI_OpenNcThemeData Func _WinAPI_ShouldSystemUseDarkMode() Local $aResult = DllCall("UxTheme.dll", "bool", 138) If @error Then Return SetError(1, 0, False) Return ($aResult[0] <> 0) EndFunc ;==>_WinAPI_ShouldSystemUseDarkMode Func _WinAPI_IsDarkModeAllowedForApp() Local $aResult = DllCall("UxTheme.dll", "bool", 139) If @error Then Return SetError(1, 0, False) Return ($aResult[0] <> 0) EndFunc ;==>_WinAPI_IsDarkModeAllowedForApp Requires OSBuild > 17762! API may change in next Windows updates! PS: I've reinvented the wheel ->
    3 points
  15. Several adjustments were made within the UDF. 1. Writing Excel function cells _xlsx_WriteFromArray() can now write Excel functions. For this, the element value in the input array must be a string that starts with `=`. The string itself is then interpreted as an Excel function. Example: =IF(F2>E2,"yes","no") Note: For Excel to interpret this correctly, only the English notation is permitted. If you need to write a string that starts with `=` but should not be interpreted as a function, escape the first `=` by doubling it (`==`). 2. Smallest possible .xlsx output files The .xlsx file generated with _xlsx_WriteFromArray() has been consistently optimized for minimal size. Files produced this way are close to the minimum possible for the format given the data. Sample dataset: [[1,2,3],[4,5,6]] Excel: 8.45 KB _xlsx_WriteFromArray(): 1.23 KB 3. Formatting of date and time If an element value in the input array for _xlsx_WriteFromArray() contains a date or time, the cell in the .xlsx file is formatted accordingly as date, time, or date/time style. The string format for these cells must be as follows: Date: YYYY-MM-DD Time: HH:MM[:SS[.mmmmmm]] Date + Time: YYYY-MM-DD[T ]HH:MM[:SS[.mmmmmm]] Note: Date and Date+Time remain as string values. A pure time, however, is encoded as a number (Excel notation where 24h = 1.0). Bug fixes and style _xlsx_2Array() can now also handle files whose sharedstrings.xml elements have a prefix (= higher compatibility). _xlsx_2Array() now also reads files that skip empty rows (= higher compatibility). Au3Check no longer emits (partly incorrect) warnings when using the UDF.
    3 points
  16. here is a simple powershell command I use to set an ignore exclusion in Defender for a specific folder Run(@ComSpec & ' /c powershell -Command Add-MpPreference -ExclusionPath ' & '"' & @ScriptDir & '"' & ' -Force', @ScriptDir, @SW_HIDE) Use this command where ever your compiled script is to be created. By changing the word Add to Remove, it will remove the set exclusion. This script will require Administrative rights to be able to perform its function(s).
    3 points
  17. UEZ's solution is better - but I did the work so... Technically it'll be in the ttf/otf itself in the name table #include <AutoitConstants.au3> #include <FileConstants.au3> Local $hFontFile = FileOpen("C:\Windows\Fonts\wingding.ttf", $FO_BINARY) Local $tagTTCHeader = "align 4; uint sfntVersion; ushort numTables; ushort searchRange; ushort entrySelector; ushort rangeShift" Local $tTTCHeader = DllStructCreate($tagTTCHeader) Local $iTTCHeaderLen = DllStructGetSize($tTTCHeader) Local $tTTCHeaderBuff = DllStructCreate(StringFormat("byte data[%d]", $iTTCHeaderLen), DllStructGetPtr($tTTCHeader)) $tTTCHeaderBuff.Data = FileRead($hFontFile, $iTTCHeaderLen) Local $iNumTables = _ByteSwap($tTTCHeader.numTables, 16) Local $tagTableRecord = "align 4; char tag[4]; uint checksum; uint offset; uint length" Local $tTableRecord = DllStructCreate($tagTableRecord) Local $iTableRecordLen = DllStructGetSize($tTableRecord) Local $tTableRecordBuff = DllStructCreate(StringFormat("byte data[%d]", $iTableRecordLen), DllStructGetPtr($tTableRecord)) Local $iNameTabOffset, $iNameTabTotalLen For $i = 1 To $iNumTables $tTableRecordBuff.Data = FileRead($hFontFile, $iTableRecordLen) ConsoleWrite(StringFormat("table: %s Offset: %08x Length: %08x\r\n", _ $tTableRecord.tag, _ByteSwap($tTableRecord.Offset), _ByteSwap($tTableRecord.Length))) If $tTableRecord.tag = "name" Then $iNameTabOffset = _ByteSwap($tTableRecord.Offset) $iNameTabLen = _ByteSwap($tTableRecord.Length) ExitLoop EndIf Next FileSetPos($hFontFile, $iNameTabOffset, $FILE_BEGIN) Local $tagNameTable = "align 4; ushort version; ushort count; ushort storageOffset" Local $tNameTable = DllStructCreate($tagNameTable) Local $iNameTabLen = DllStructGetSize($tNameTable) Local $tNameTableBuff = DllStructCreate(StringFormat("byte data[%d]", $iNameTabLen), DllStructGetPtr($tNameTable)) $tNameTableBuff.data = FileRead($hFontFile, $iNameTabLen) Local $iNameRecordCount = _ByteSwap($tNameTable.count, 16) Local $iNameStorageOffset = _ByteSwap($tNameTable.storageOffset, 16) Local $tagNameRecord = "align 4; ushort platformID; ushort encodingID; ushort languageID; ushort nameID; ushort length; ushort stringOffset;" Local $tNameRecord = DllStructCreate($tagNameRecord) Local $iNameRecordLen = DllStructGetSize($tNameRecord) Local $tNameRecordBuff = DllStructCreate(StringFormat("byte data[%d]", $iNameRecordLen), DllStructGetPtr($tNameRecord)) Local $iFontFamilyNameOffset, $iFontFamilyNameLen For $i = 1 To $iNameRecordCount $tNameRecordBuff.data = FileRead($hFontFile, $iNameRecordLen) ConsoleWrite(StringFormat("NameRecord: nameID: %04x length %04x offset %04x", _ _ByteSwap($tNameRecord.nameID, 16), _ByteSwap($tNameRecord.length, 16), _ByteSwap($tNameRecord.stringOffset, 16)) & @CRLF) If _ByteSwap($tNameRecord.nameID, 16) = 1 Then ; Font Family name. $iFontFamilyNameLen = _ByteSwap($tNameRecord.length, 16) $iFontFamilyNameOffset = _ByteSwap($tNameRecord.stringOffset, 16) ExitLoop EndIf Next FileSetPos($hFontFile, $iNameTabOffset + $iNameStorageOffset + $iFontFamilyNameOffset, $FILE_BEGIN) Local $tFontFamilyName = DllStructCreate(StringFormat("char Name[%d]", $iFontFamilyNameLen)) Local $tFontFamilyNameBuff = DllStructCreate(StringFormat("byte data[%d]", $iFontFamilyNameLen), DllStructGetPtr($tFontFamilyName)) $tFontFamilyNameBuff.Data = FileRead($hFontFile, $iFontFamilyNameLen) MsgBox(0, "Font Family Name", $tFontFamilyName.Name) FileClose($hFontFile) Func _ByteSwap($iInt, $iSize = 32) Switch $iSize Case 16 Return BitAND(0xFFFF, BitOR(BitAND(0xFF00, BitShift($iInt, -8)), BitShift($iInt, 8))) Case 32 Local $tBuff = DllStructCreate("byte[4]") For $i = 1 To 4 DllStructSetData($tBuff, 1, BitAND($iInt, 0xFF), 5-$i) $iInt = BitShift($iInt, 8) Next Local $tInt = DllStructCreate("int", DllStructGetPtr($tBuff)) Return DllStructGetData($tInt, 1) EndSwitch EndFunc
    3 points
  18. _DTFormat Formats a given date/time string according to the specified format. _DTFormat($sDate, $sFormat [, $iLcid = $LOCALE_USER_DEFAULT]) $sDate - The date string to be formatted "[YYYY/MM/DD][ HH:MM:SS [ tt]]" $sFormat - A string containing the desired format for the date and time. Supported tokens are: Date and/or Time Date: d, dd = day; ddd, dddd = day of week; M= month; y = year Time: h= hour m= minute s = second (long time only) tt= AM. or P.M. h/H = 12/24 hour hh, mm, ss = display leading zero h, m, s = do not display leading zero Tokens can be separated by '|' to specify different formats for date and time. $iLcid - [optional] The locale identifier. Defaults to the user's default locale (default is $LOCALE_USER_DEFAULT). ; https://www.autoitscript.com/forum/topic/213249-free-style-datetimeformat/ ;---------------------------------------------------------------------------------------- ; Title...........: _DTFormat.au3 ; Description.....: Formats a given date/time string according to the specified format. ; AutoIt Version..: 3.3.16.1 Author: ioa747 Script Version: 0.1 ; Note............: Testet in Win10 22H2 Date:07/10/2025 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <Date.au3> Example() ; Function to demonstrate the use of _DTFormat Func Example() ; https://help.tradestation.com/10_00/eng/tsdevhelp/elobject/class_el/lcid_values.htm ; Example using specific LCID (German=1031, English=1033, Spain=1034, France=1036) ConsoleWrite("- German : " & _DTFormat("2025/09/01 08:30:00 PM", "dddd, d MMMM yyyy|, HH:mm", 1031) & @CRLF) ConsoleWrite("- English : " & _DTFormat("2025/09/01 08:30:00 PM", "dddd, d MMMM yyyy|, HH:mm", 1033) & @CRLF) ConsoleWrite("- Spain : " & _DTFormat("2025/09/01 08:30:00 PM", "dddd, d MMMM yyyy|, HH:mm", 1034) & @CRLF) ConsoleWrite("- France : " & _DTFormat("2025/09/01 08:30:00 PM", "dddd, d MMMM yyyy|, HH:mm", 1036) & @CRLF) ConsoleWrite("-" & @CRLF) ; Example using the default User Locale LCID ConsoleWrite("- User Locale : " & _DTFormat("2025/09/01 20:30:00", "dddd, d MMMM yyyy|, hh:mm tt") & @CRLF) ConsoleWrite("- MMMM yyyy : " & _DTFormat("2025/09/01", "MMMM yyyy") & @CRLF) ConsoleWrite("- Date & Time : " & _DTFormat("2025/09/01 20:30:00", "'Date:' dddd d|, 'Time:' HH:mm") & @CRLF) ConsoleWrite("-" & @CRLF) ; More Example ConsoleWrite("- only Time : " & _DTFormat("08:30:00 PM", "HH:mm:ss") & @CRLF) ConsoleWrite("- only Date : " & _DTFormat("2025/09/01", "dddd, d MMMM yyyy") & @CRLF) ConsoleWrite("-" & @CRLF) ConsoleWrite("- _NowCalc() : " & _NowCalc() & @CRLF) ConsoleWrite("- only Time : " & _DTFormat(_NowCalc(), "|HH:mm:ss") & @CRLF) ConsoleWrite("- only Date : " & _DTFormat(_NowCalc(), "dddd, d MMMM yyyy|") & @CRLF) ConsoleWrite("-" & @CRLF) ConsoleWrite("- ! HH with tt: " & _DTFormat("08:30:00 PM", "HH:mm tt") & @CRLF) ConsoleWrite("- Now Stamp : " & _DTFormat(_NowCalc(), "yyyy_MM_dd|_HH_mm_ss_" & @MSEC) & @CRLF) ConsoleWrite("-" & @CRLF) EndFunc ;==>Example ; #FUNCTION# ==================================================================================================================== ; Name...........: _DTFormat ; Description....: Formats a given date/time string according to the specified format. ; Syntax.........: _DTFormat($sDate, $sFormat [, $iLcid = $LOCALE_USER_DEFAULT]) ; Parameters.....: $sDate - The date string to be formatted "[YYYY/MM/DD][ HH:MM:SS [ tt]]". ; $sFormat - A string containing the desired format for the date and time. ; Supported tokens are: Date and/or Time ; Date: ; d, dd = day; ddd, dddd = day of week; M= month; y = year ; Time: ; h= hour m= minute ; s = second (long time only) ; tt= AM. or P.M. ; h/H = 12/24 hour ; hh, mm, ss = display leading zero ; h, m, s = do not display leading zero ; Tokens can be separated by '|' to specify different formats for date and time. ; $iLcid - [optional] The locale identifier. Defaults to the user's default locale (default is $LOCALE_USER_DEFAULT). ; Return values .: Success: Returns the formatted date string. ; Failure: Returns an empty string and set the @error flag to non-zero. ; @error: ; 1 - Error date is not valid. ; 2 - Error in splitting the date string ; 3 - Error in encoding SystemTime ; 4 - Error in time formatting ; 5 - Error in date formatting ; Author ........: ioa747 ; Modified ......: ; Remarks .......: This function uses the Windows API to format date and time according to the specified locale. ; Related .......: _Date_Time_EncodeSystemTime, _WinAPI_GetDateFormat, _WinAPI_GetTimeFormat, _WinAPI_GetLocaleInfo ; Link ..........: https://learn.microsoft.com/en-us/windows/win32/intl/day--month--year--and-era-format-pictures ; Example .......: MsgBox(0, "Formatted Date", _DTFormat("2023/10/05 14:30:00", "MM/DD/YYYY|, HH:MM:SS")) ; =============================================================================================================================== Func _DTFormat($sDate, $sFormat, $iLcid = $LOCALE_USER_DEFAULT) Local $asDatePart[4], $asTimePart[4] Local $sTempDate = "", $sTempTime = "" Local $sAM, $sPM, $sTempString = "" Local $bDate = True ; If there is no date, add a dummy one (2000/01/01) If StringInStr($sDate, "/") = 0 And Not @error Then $bDate = False $sDate = "2000/01/01 " & $sDate Else ; Verify If InputDate is valid If Not _DateIsValid($sDate) Then Return SetError(1, 0, "") ; Error date is not valid. EndIf ; Split the date and time into arrays _DateTimeSplit($sDate, $asDatePart, $asTimePart) If @error Then Return SetError(2, @error, "") ; Error in splitting the date string Local $aPart = StringSplit($sFormat, "|") If $bDate Then $sTempDate = $aPart[1] $sTempTime = "" If $aPart[0] = 2 Then $sTempTime = $aPart[2] Else $sTempTime = $aPart[1] EndIf ; If time parts exist, check for AM/PM and convert to 24-hour format If $asTimePart[0] > 1 Then ; Get locale's AM designator, or AM $sTempString = _WinAPI_GetLocaleInfo($iLcid, $LOCALE_S1159) ; AM designator. If Not @error And Not ($sTempString = '') Then $sAM = $sTempString Else $sAM = "AM" EndIf ; Get locale's PM designator, or PM $sTempString = _WinAPI_GetLocaleInfo($iLcid, $LOCALE_S2359) ; PM designator. If Not @error And Not ($sTempString = '') Then $sPM = $sTempString Else $sPM = "PM" EndIf ; Convert 12-hour clock (with PM) to 24-hour clock If (StringInStr($sDate, 'pm') > 0) Or (StringInStr($sDate, $sPM) > 0) Then If $asTimePart[1] < 12 Then $asTimePart[1] += 12 ; Convert 12-hour clock (with AM) to 24-hour clock (handle 12 AM midnight case) ElseIf (StringInStr($sDate, 'am') > 0) Or (StringInStr($sDate, $sAM) > 0) Then If $asTimePart[1] = 12 Then $asTimePart[1] = 0 EndIf EndIf ; Remove ' tt' if hour is in format H/24 hour If StringInStr($sTempTime, "H", 1) > 0 Then $sTempTime = StringReplace($sTempTime, " tt", "") ; Encode a system time structure (required by WinAPI date/time functions) Local $tSystem = _Date_Time_EncodeSystemTime($asDatePart[2], $asDatePart[3], $asDatePart[1], $asTimePart[1], $asTimePart[2], $asTimePart[3]) If @error Then Return SetError(3, @error, "") ; Error in encoding SystemTime Local $sfinalTime = _WinAPI_GetTimeFormat($iLcid, $tSystem, 0, $sTempTime) If @error Then Return SetError(4, @error, "") ; Error in time formatting ; Force AM/PM if the format string contains 'tt' but regional settings didn't include it If StringInStr($sTempTime, "tt") Then If (StringInStr($sfinalTime, 'pm') = 0) And (StringInStr($sfinalTime, $sPM) = 0) And _ (StringInStr($sfinalTime, 'am') = 0) And (StringInStr($sfinalTime, $sAM) = 0) Then If $asTimePart[1] < 12 Then $sfinalTime &= " " & $sAM Else $sfinalTime &= " " & $sPM EndIf EndIf EndIf Local $sResult = "" If $sTempDate <> "" Then $sResult &= _WinAPI_GetDateFormat($iLcid, $tSystem, 0, $sTempDate) If @error Then Return SetError(5, @error, "") ; Error in date formatting If $sTempTime <> "" Then $sResult &= $sfinalTime Return $sResult EndFunc ;==>_DTFormat Please, every comment is appreciated! leave your comments and experiences here! Thank you very much
    3 points
  19. Just a little program I whipped up today. If like me, you connect to the web via LAN, but don't always like your PC to be connected all the time, especially at boot up, then you might find my script handy. Basically I use it to turn my Ethernet connection off. A fairly simple affair, and the state persists after shutdown. BIG THANKS to jguinch for the Network configuration UDF. My script uses and requires the Network.au3 include file from the first post of that topic. My script runs with Admin Rights, as per the first line of the script. Show Adapters.au3 NOTE - On my system, some adapters have a CRLF in the middle of the returned entry. My script changes that, within program, to a backward slash (\) for ease of use etc. As can be noted in the screenshot, the second portion, after the backslash, is the actual adapter name used for ENABLE and DISABLE and getting INFO. To work with the same adapter by default, you can SAVE a selected entry as the one, which can appear selected at startup after first being checked. Enjoy!
    3 points
  20. ioa747

    _LinksInspector

    Links Inspector This AutoIt script designed to scan a text-based file (e.g., TXT, HTML, XML, MD) for URLs and check their current HTTP status code. (to see if the link is active) (The tool is a "Public Link Accessibility Checker" and not a full HTTP client with authentication capabilities.) Results can be filtered to show: All links '*' All non-200 codes '!' Specific codes e.g. '404, 503, 301' HTTP response status codes _LinksInspector.au3 ; https://www.autoitscript.com/forum/topic/213221-_linksinspector/ ;---------------------------------------------------------------------------------------- ; Title...........: _LinksInspector.au3 ; Description.....: Searches a file for URLs and checks their status codes. ; AutoIt Version..: 3.3.16.1 Author: ioa747 Script Version: 0.4 ; Note............: Testet in Win10 22H2 Date:03/10/2025 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #NoTrayIcon #include <GuiListView.au3> #include <GUIConstants.au3> #include <WinAPIShellEx.au3> ; Constants for Filtering Global Const $LINKS_BROKEN = "0, 404, 500, 501, 502, 503, 504" Global Const $LINKS_NEEDS_REVIEW = "301, 302, 307, 400, 401, 403" ; (Redirections, Unauthorized, Forbidden) ; Constant for WinHttp Options Global Const $WinHttpRequestOption_EnableRedirects = 6 ; Global variable Global $g_hListView, $g_iListIndex = -1 Global $g_ObjErr = ObjEvent("AutoIt.Error", "__ObjAutoItErrorEvent") Global $g_aLastComError[0] ; Global variable to store the last COM error: [Description, Number, Source, ScriptLine] Global $g_oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1") If Not IsObj($g_oHTTP) Then MsgBox(16, "Error", "Failed to create WinHttp.WinHttpRequest.5.1 COM object.") Exit EndIf ; #FUNCTION# ==================================================================================================================== ; Name...........: _LinksInspector ; Description....: Searches a file for URLs and checks their status codes, filtering based on specified criteria. ; Syntax.........: _LinksInspector($sFilePath [, $sFilter = "*" [, $bAttribOnly = False [, $idProgress = 0]]]) ; Parameters.....: $sFilePath - The path to the file containing the text to be searched. ; $sFilter - [Optional] Filtering mode: ; "*": Show all results (default for full review). ; "!": Show all except 200 (i.e., all errors and redirects). ; "400, 404": Show only the specific comma-separated status codes. ; $bAttribOnly - [Optional] True = Search ONLY for URLs within HTML/XML attributes (e.g., href="..."). (Default = False) ; : $idProgress - [Optional] The control ID of the progress bar to update, if there is a GUI. Default 0 (no update). ; Return values..: Success - Returns a 2D array: [LineNumbers (delimited by ';'), StatusCode, StatusText, URL]. ; Failure - Returns a empty 2D array and sets @error: ; 1 - The specified file path is invalid. ; 2 - No links found in the file content. ; Author ........: ioa747 ; Modified ......: ; Remarks .......: This function it uses the WinHttp.WinHttpRequest.5.1 COM object for efficient and reliable network requests. ; Checks each unique URL only once, regardless of how many times it appears in the file. ; Uses the HEAD method to retrieve status codes without downloading the full page content. ; Automatically follows redirects (3xx codes) to find the final status (e.g., 200 or 404). ; Utilizes ObjEvent to silently capture and log COM errors (like timeouts or DNS failures) as Status Code 0. ; Related .......: __CheckLinkStatus, __ObjAutoItErrorEvent ; Link ..........: https://www.autoitscript.com/forum/topic/213221-_linksinspector/ ; https://learn.microsoft.com/en-us/windows/win32/winhttp/winhttprequest ; https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status ; Example .......: _LinksInspector("C:\example.txt", "400, 404") ; to find and check URLs with specific status codes. ; =============================================================================================================================== Func _LinksInspector($sFilePath, $sFilter = "*", $bAttribOnly = False, $idProgress = 0) Local $aResults[0][4] Local $aUniqueLinks[0][2] ; [URL, Line_Numbers_String (e.g., "12;24")] ; Define Regex Patterns based on the optional flag ; Pattern for ATTRIBUTE SEARCH (Higher precision for HTML/XML): Finds URLs starting after =" or =' Local $sPatternAttrib = '(?i)[=""''](https?:\/\/[^""''\s<>]+)' ; Pattern for FULL SEARCH (Includes Attributes and Plain Text): The original broad pattern Local $sPatternFull = '(?i)(https?:\/\/[^""''\s<>]+)' Local $aFileLines = FileReadToArray($sFilePath) If @error Then MsgBox(16, "Error", "Failed to read file: " & $sFilePath) Return SetError(1, 0, $aResults) EndIf ; Filter Preprocessing (Logic remains the same) $sFilter = StringStripWS($sFilter, 8) Local $bFilterAll = ($sFilter = "*") Local $bFilterExclude200 = ($sFilter = "!") Local $aFilterCodes = 0 If Not $bFilterAll And Not $bFilterExclude200 Then $aFilterCodes = StringSplit($sFilter, ",", 2) EndIf Local $iLineCount = UBound($aFileLines) ; Select the appropriate pattern Local $sPattern = $sPatternFull If $bAttribOnly Then $sPattern = $sPatternAttrib EndIf ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; STAGE 1: Extract all links and record all lines where they appear (Handling Duplicates) ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For $i = 0 To $iLineCount - 1 Local $sLine = $aFileLines[$i] Local $iLineNum = $i + 1 ; Use the selected pattern to find links Local $aLinks = StringRegExp($sLine, $sPattern, 3) If Not @error And IsArray($aLinks) Then For $j = 0 To UBound($aLinks) - 1 Local $sCleanURL = StringReplace($aLinks[$j], "&amp;", "&") $sCleanURL = StringRegExpReplace($sCleanURL, '[\)\(\"''<>,\.]$', "") $sCleanURL = StringStripWS($sCleanURL, 3) ; Find if the URL already exists in our unique list Local $iIndex = _ArraySearch($aUniqueLinks, $sCleanURL, 0, 0, 0, 0, 1, 0) If $iIndex = -1 Then ; URL is new, add it to the unique list _ArrayAdd($aUniqueLinks, $sCleanURL & "|" & $iLineNum, "|") Else ; URL already exists, append the current line number to the string $aUniqueLinks[$iIndex][1] = $aUniqueLinks[$iIndex][1] & ";" & $iLineNum EndIf Next EndIf Next If UBound($aUniqueLinks) = 0 Then Return SetError(2, 0, $aResults) ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; STAGE 2: Check the status of each UNIQUE link and apply filter ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Local $iUniqueCount = UBound($aUniqueLinks) For $i = 0 To $iUniqueCount - 1 ; *** Update GUI only if a valid Progress Bar ID is given *** If $idProgress <> 0 Then Local $iPercent = Int((($i + 1) / $iUniqueCount) * 100) GUICtrlSetData($idProgress, $iPercent) Sleep(10) ; Short pause for GUI response EndIf Local $sURL = $aUniqueLinks[$i][0] Local $sLineNums = $aUniqueLinks[$i][1] Local $aStatus = __CheckLinkStatus($sURL) Local $iStatusCode = $aStatus[0] ; Filtering Logic Local $bAddResult = False If $bFilterAll Then $bAddResult = True ElseIf $bFilterExclude200 Then If $iStatusCode <> 200 Then $bAddResult = True ElseIf IsArray($aFilterCodes) Then If _ArraySearch($aFilterCodes, $iStatusCode) <> -1 Then $bAddResult = True EndIf If $bAddResult Then _ArrayAdd($aResults, $sLineNums & "|" & $iStatusCode & "|" & $aStatus[1] & "|" & $sURL) EndIf ; for debugging purposes only ConsoleWrite(($bAddResult ? "+ " : "- ") & $sLineNums & " |> " & $aStatus[1] & " |> " & $sURL & @CRLF) Next If UBound($aResults) = 0 Then Return SetError(2, 0, $aResults) Return $aResults EndFunc ;==>_LinksInspector ;--------------------------------------------------------------------------------------- Func __CheckLinkStatus($sURL) Local $iStatusCode = 0 Local $sStatusText = "Failed - Connection/Timeout Error" ; Set timeouts for the current request ; ResolveTimeout: 5 sec ; ConnectTimeout: 5 sec ; SendTimeout: 10 sec ; ReceiveTimeout: 10 sec $g_oHTTP.SetTimeouts(5000, 5000, 10000, 10000) ; *** WinHttp will follow up to 10 redirects to find the final code ($200 or $404). $g_oHTTP.SetOption($WinHttpRequestOption_EnableRedirects, True) ; Clear the global COM error log before the call ReDim $g_aLastComError[0] ; Open and Send the Request $g_oHTTP.Open("HEAD", $sURL, False) $g_oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36") ; If a COM error occurs here (e.g. DNS fail), it will fill $g_aLastComError, ; but the script flow will continue without a MsgBox. $g_oHTTP.Send() ; Check the global COM error log immediately after the call If UBound($g_aLastComError) > 0 Then ; A COM errors $iStatusCode = 0 $sStatusText = "Failed - COM Error: (" & StringReplace($g_aLastComError[0], @CRLF, " ") & ")" ElseIf @error Then ; AutoIt errors $iStatusCode = 0 $sStatusText = "Failed - AutoIt Error (" & @error & ")" Else ; The call was successful, retrieve the HTTP status $iStatusCode = $g_oHTTP.Status $sStatusText = $g_oHTTP.StatusText EndIf ; Process Status Text for final output Select Case $iStatusCode == 0 ; Status text is already set Case $iStatusCode == 200 $sStatusText = "Alive - OK" Case $iStatusCode >= 300 And $iStatusCode < 400 ; With automatic tracking, 3xx codes will rarely appear here, ; unless 10 redirects are exceeded. $sStatusText = "Redirected (Needs Review)" Case $iStatusCode == 404 $sStatusText = "Not Found" Case $iStatusCode >= 400 And $iStatusCode < 500 $sStatusText = "Client Error" Case $iStatusCode >= 500 And $iStatusCode < 600 $sStatusText = "Server Error" Case Else If StringStripWS($sStatusText, 3) == "" Then $sStatusText = "Unknown Status (" & $iStatusCode & ")" EndSelect Local $aResults = [$iStatusCode, $sStatusText] Return $aResults EndFunc ;==>__CheckLinkStatus ;--------------------------------------------------------------------------------------- Func __ObjAutoItErrorEvent() If IsObj($g_ObjErr) Then ; This filters out false positives with an empty description. If $g_ObjErr.Number <> 0 And StringStripWS($g_ObjErr.Description, 3) <> "" Then ; Store the error details in the global array (instead of showing MsgBox) ReDim $g_aLastComError[4] $g_aLastComError[0] = $g_ObjErr.description $g_aLastComError[1] = Hex($g_ObjErr.Number, 8) ; $g_ObjErr.Number $g_aLastComError[2] = $g_ObjErr.Source $g_aLastComError[3] = $g_ObjErr.ScriptLine ; ConsoleWrite('@@(' & $g_aLastComError[3] & ') :: COM Error Logged: Desc.: "' & StringReplace($g_aLastComError[0], @CRLF, " ") & '"' & @CRLF) EndIf ; Clear the properties of ObjEvent $g_ObjErr.Description = "" $g_ObjErr.Number = 0 EndIf EndFunc ;==>__ObjAutoItErrorEvent ;--------------------------------------------------------------------------------------- Func _LinksInspectorGUI($sFilePath = "") ; Function to create the main graphical user interface _WinAPI_SetCurrentProcessExplicitAppUserModelID(StringTrimRight(@ScriptName, 4)) Local $hGUI = GUICreate("Links Inspector", 700, 500) GUISetIcon(@SystemDir & "\shell32.dll", -136) GUICtrlCreateLabel("File Path:", 10, 15, 50, 20) ; *** Local $idInputFile = GUICtrlCreateInput($sFilePath, 60, 10, 530, 24) Local $idBtnBrowse = GUICtrlCreateButton("Browse", 600, 10, 90, 24) GUICtrlCreateLabel("Filter:", 60, 45, 30, 20) ; *** GUICtrlSetTip(-1, " '*' Show all results" & @CRLF & " '!' Show all except 200" & @CRLF & " '400, 404' Show only the specific status codes.") Local $idInputFilter = GUICtrlCreateInput("*", 90, 40, 200, 24) ; *** GUICtrlSetFont(-1, 12) Local $idCheckboxAttrib = GUICtrlCreateCheckbox("Attribute Search Only", 310, 43, 150, 20) ; *** Local $idBtnInspect = GUICtrlCreateButton("Start Inspection", 600, 40, 90, 24) Local $idBtnSaveReport = GUICtrlCreateButton("Save Report", 500, 40, 90, 24) GUICtrlSetState(-1, $GUI_DISABLE) Local $idIconInfo = GUICtrlCreateIcon("wmploc.dll", -60, 20, 44, 16, 16) $g_hListView = _GUICtrlListView_Create($hGUI, "", 10, 80, 680, 380) Local $iExListViewStyle = BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER, $LVS_EX_INFOTIP) _GUICtrlListView_SetExtendedListViewStyle($g_hListView, $iExListViewStyle) Local $idProgress = GUICtrlCreateProgress(10, 470, 680, 20) GUISetState(@SW_SHOW) _GUICtrlListView_RegisterSortCallBack($g_hListView, 0) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") ; Add columns to $g_hListView "Line(s)|Code|Status|URL" _GUICtrlListView_AddColumn($g_hListView, "Line(s)", 50) _GUICtrlListView_AddColumn($g_hListView, "Code", 40) _GUICtrlListView_AddColumn($g_hListView, "Status", 80) _GUICtrlListView_AddColumn($g_hListView, "URL", 500) Local $mCODES[] Local $aHTTP_STATUS = _HTTP_STATUS($mCODES) Local $nMsg, $aResults, $iLastStatusID, $sTipTitle, $sTipText, $iLastIndex = -1 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $idBtnBrowse $sFilePath = FileOpenDialog("Select File to Inspect", @ScriptDir, "All Files (*.*)", 1, GUICtrlRead($idInputFile)) If @error Then ContinueLoop GUICtrlSetData($idInputFile, $sFilePath) _GUICtrlListView_DeleteAllItems($g_hListView) ; Clear Listview GUICtrlSetState($idBtnSaveReport, $GUI_DISABLE) ; disable the Save_Report button $aResults = 0 Case $idBtnInspect ; Reset UI elements _GUICtrlListView_DeleteAllItems($g_hListView) ; Clear Listview GUICtrlSetData($idProgress, 0) GUICtrlSetState($idBtnSaveReport, $GUI_DISABLE) ; disable the Save_Report button $aResults = 0 ; Get user input $sFilePath = GUICtrlRead($idInputFile) Local $sFilter = GUICtrlRead($idInputFilter) Local $bAttribOnly = GUICtrlRead($idCheckboxAttrib) = $GUI_CHECKED ; Input validation If Not FileExists($sFilePath) Then MsgBox(48, "Error", "File not found: " & $sFilePath) ContinueLoop EndIf GUICtrlSetState($idBtnInspect, $GUI_DISABLE) ; Temporarily disable the Inspect button during inspection $aResults = _LinksInspector($sFilePath, $sFilter, $bAttribOnly, $idProgress) ; Handle results If @error = 1 Then ; Error 1 is already handled inside _LinksInspector (FileReadToArray error) ElseIf @error = 2 Then MsgBox(64, "Info", "No links found matching the criteria in the file.") Else ; Add results to Listview _GUICtrlListView_SetItemCount($g_hListView, UBound($aResults)) _GUICtrlListView_AddArray($g_hListView, $aResults) ; MsgBox(64, "Success", "Inspection complete. Found " & $iCount & " results.") EndIf Sleep(500) ; give some time to show the ProgressBar GUICtrlSetData($idProgress, 0) ; Update progress bar to 0% GUICtrlSetState($idBtnInspect, $GUI_ENABLE) ; enable Inspect button If UBound($aResults) > 0 Then GUICtrlSetState($idBtnSaveReport, $GUI_ENABLE) ; enable Save_Report button Case $idBtnSaveReport Local $sReportPath = FileSaveDialog("Save LinksInspector Report", @ScriptDir, _ "Text Files (*.txt)", 1, "LinksInspector Report.txt") If Not @error And $sReportPath <> "" Then If FileExists($sReportPath) Then If MsgBox($MB_YESNO + $MB_ICONWARNING, "File already exists", $sReportPath & @CRLF & _ "Do you want to replace it?") = $IDNO Then ContinueLoop FileDelete($sReportPath) EndIf Local $sReportData = _ArrayToString($aResults) $sReportData = "Line(s)|Code|Status|URL" & @CRLF & $sReportData FileWrite($sReportPath, $sReportData) EndIf EndSwitch ; Update the ToolTip of the info icon If $iLastIndex <> $g_iListIndex Then $iLastIndex = $g_iListIndex ; ConsoleWrite("$iLastIndex=" & $iLastIndex & @CRLF) $iLastStatusID = Int(_GUICtrlListView_GetItemText($g_hListView, $iLastIndex, 1)) If $iLastStatusID = 0 Then $sTipTitle = "(0) COM Error" $sTipText = _GUICtrlListView_GetItemText($g_hListView, $iLastIndex, 2) Else $sTipTitle = "" $sTipText = "" If MapExists($mCODES, $iLastStatusID) Then $sTipTitle = "(" & $aHTTP_STATUS[$mCODES[$iLastStatusID]][0] & ") " & $aHTTP_STATUS[$mCODES[$iLastStatusID]][1] $sTipText = StringFormat($aHTTP_STATUS[$mCODES[$iLastStatusID]][2]) EndIf EndIf GUICtrlSetTip($idIconInfo, $sTipText, $sTipTitle, $TIP_INFOICON) EndIf WEnd EndFunc ;==>_LinksInspectorGUI ;--------------------------------------------------------------------------------------- Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $hWndFrom, $iCode, $tNMHDR, $tInfo, $index, $subitem, $sURL $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $g_hListView Switch $iCode Case $LVN_COLUMNCLICK $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) ;$index = DllStructGetData($tInfo, "Index") $subitem = DllStructGetData($tInfo, "SubItem") ; Kick off the sort callback _GUICtrlListView_SortItems($hWndFrom, $subitem) ; No return value Case $NM_DBLCLK $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) $index = DllStructGetData($tInfo, "Index") $subitem = DllStructGetData($tInfo, "SubItem") $g_iListIndex = $index $sURL = _GUICtrlListView_GetItemText($g_hListView, $index, 3) If $subitem = 3 Then ShellExecute($sURL) ; No return value Case $NM_CLICK $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) $index = DllStructGetData($tInfo, "Index") ;$subitem = DllStructGetData($tInfo, "SubItem") $g_iListIndex = $index ; ConsoleWrite("$g_iListIndex=" & $g_iListIndex & @CRLF) ; No return value EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY ;--------------------------------------------------------------------------------------- Func _HTTP_STATUS(ByRef $mMap) Local $aHTTP_STATUS_CODES[63][3] = [ _ [100, "Continue", "This interim response indicates that the client \nshould continue the request or \nignore the response if the request is already finished."], _ [101, "Switching Protocols", "This code is sent in response to \nan Upgrade request header from the \nclient and indicates the protocol the server is switching to."], _ [102, "Processing Deprecated", "This code was used in WebDAV contexts to indicate \nthat a request has been received by the server, \nbut no status was available at the time of the response."], _ [103, "Early Hints", "This status code is primarily intended to be used with the Link header, \nletting the user agent start preloading resources while the server \nprepares a response or preconnect to an origin from which the page will need resources."], _ [200, "OK", "The request succeeded. The result and meaning of 'success' depends on the HTTP method:\nGET: The resource has been fetched and transmitted in the message body.\nHEAD: Representation headers are included in the response without any message body.\nPUT or POST: The resource describing the result of the action is transmitted in the message body. \nTRACE: The message body contains the request as received by the server."], _ [201, "Created", "The request succeeded, \nand a new resource was created as a result. \nThis is typically the response sent after POST requests, \nor some PUT requests."], _ [202, "Accepted", "The request has been received but not yet acted upon. \nIt is noncommittal, since there is no way in HTTP to later send an \nasynchronous response indicating the outcome of the request. \nIt is intended for cases where another process \nor server handles the request, or for batch processing."], _ [203, "Non-Authoritative Information", "This response code means the returned metadata \nis not exactly the same as is available from the origin server, \nbut is collected from a local or a third-party copy. \nThis is mostly used for mirrors or backups of another resource. \nExcept for that specific case, the 200 OK response is preferred to this status."], _ [204, "No Content", "There is no content to send for this request, but the headers are useful. \nThe user agent may update its cached headers for this resource with the new ones."], _ [205, "Reset Content", "Tells the user agent to reset the document which sent this request."], _ [206, "Partial Content", "This response code is used in response to a range request \nwhen the client has requested a part or parts of a resource."], _ [207, "Multi-Status (WebDAV)", "Conveys information about multiple resources, \nfor situations where multiple status codes might be appropriate."], _ [208, "Already Reported (WebDAV)", "Used inside a <dav:propstat> response element to avoid \nrepeatedly enumerating the internal members of multiple bindings to the same collection."], _ [226, "IM Used (HTTP Delta encoding)", "The server has fulfilled a GET request for the resource, \nand the response is a representation of the result of one or more \ninstance-manipulations applied to the current instance."], _ [300, "Multiple Choices", "In agent-driven content negotiation, \nthe request has more than one possible response and \nthe user agent or user should choose one of them. \nThere is no standardized way for clients to automatically \nchoose one of the responses, so this is rarely used."], _ [301, "Moved Permanently", "The URL of the requested resource has been changed permanently. \nThe new URL is given in the response."], _ [302, "Found", "This response code means that the URI of \nrequested resource has been changed temporarily. \nFurther changes in the URI might be made in the future, \nso the same URI should be used by the client in future requests."], _ [303, "See Other", "The server sent this response to direct the client \nto get the requested resource at another URI with a GET request."], _ [304, "Not Modified", "This is used for caching purposes. \nIt tells the client that the response has not been modified, \nso the client can continue to use the same cached version of the response."], _ [305, "Use Proxy Deprecated", "Defined in a previous version of the HTTP specification \nto indicate that a requested response must be accessed by a proxy. \nIt has been deprecated due to security concerns regarding in-band configuration of a proxy."], _ [306, "unused", "This response code is no longer used; \nbut is reserved. It was used in a previous version of the HTTP/1.1 specification."], _ [307, "Temporary Redirect", "The server sends this response to direct the client to get the requested resource \nat another URI with the same method that was used in the prior request. \nThis has the same semantics as the 302 Found response code, \nwith the exception that the user agent must not change the HTTP method used: \nif a POST was used in the first request, a POST must be used in the redirected request."], _ [308, "Permanent Redirect", "This means that the resource is now permanently located at another URI, \nspecified by the Location response header. \nThis has the same semantics as the 301 Moved Permanently HTTP response code, \nwith the exception that the user agent must not change the HTTP method used: \nif a POST was used in the first request, \na POST must be used in the second request."], _ [400, "Bad Request", "The server cannot or will not process the request due \nto something that is perceived to be a client error \n(e.g., malformed request syntax, invalid request message framing, \nor deceptive request routing)."], _ [401, "Unauthorized", "Although the HTTP standard specifies 'unauthorized', \nsemantically this response means 'unauthenticated'. \nThat is, the client must authenticate itself to get the requested response."], _ [402, "Payment Required", "The initial purpose of this code was for digital payment systems, \nhowever this status code is rarely used and no standard convention exists."], _ [403, "Forbidden", "The client does not have access rights to the content; \nthat is, it is unauthorized, so the server is refusing \nto give the requested resource. \nUnlike 401 Unauthorized, \nthe client's identity is known to the server."], _ [404, "Not Found", "The server cannot find the requested resource. \nIn the browser, this means the URL is not recognized. \nIn an API, this can also mean that the endpoint is valid but the resource itself does not exist. \nServers may also send this response instead of 403 Forbidden \nto hide the existence of a resource from an unauthorized client. \nThis response code is probably the most well known \ndue to its frequent occurrence on the web."], _ [405, "Method Not Allowed", "The request method is known by the server \nbut is not supported by the target resource. \nFor example, an API may not allow DELETE on a resource, \nor the TRACE method entirely."], _ [406, "Not Acceptable", "This response is sent when the web server, \nafter performing server-driven content negotiation, \ndoesn't find any content that conforms to the criteria \ngiven by the user agent."], _ [407, "Proxy Authentication Required", "This is similar to 401 Unauthorized but \nauthentication is needed to be done by a proxy."], _ [408, "Request Timeout", "This response is sent on an idle connection by some servers, \neven without any previous request by the client. \nIt means that the server would like to shut down this unused connection. \nThis response is used much more since some browsers use HTTP pre-connection mechanisms to speed up browsing. \nSome servers may shut down a connection without sending this message."], _ [409, "Conflict", "This response is sent when a request conflicts with the current state of the server. \nIn WebDAV remote web authoring, \n409 responses are errors sent to the client so that a user might be \nable to resolve a conflict and resubmit the request."], _ [410, "Gone", "This response is sent when the requested content has been \npermanently deleted from server, \nwith no forwarding address. \nClients are expected to remove their caches and links to the resource. \nThe HTTP specification intends this status code to be used for 'limited-time, \npromotional services'. \nAPIs should not feel compelled to indicate resources \nthat have been deleted with this status code."], _ [411, "Length Required", "Server rejected the request because \nthe Content-Length header field is not defined and \nthe server requires it."], _ [412, "Precondition Failed", "In conditional requests, \nthe client has indicated preconditions in its headers \nwhich the server does not meet."], _ [413, "Content Too Large", "The request body is larger than limits defined by server. \nThe server might close the connection or \nreturn an Retry-After header field."], _ [414, "URI Too Long", "The URI requested by the client is \nlonger than the server is willing to interpret."], _ [415, "Unsupported Media Type", "The media format of the requested data is not supported by the server, \nso the server is rejecting the request."], _ [416, "Range Not Satisfiable", "The ranges specified by the Range header field in the request cannot be fulfilled. \nIt's possible that the range is outside the size of the target resource's data."], _ [417, "Expectation Failed", "This response code means the expectation indicated by \nthe Expect request header field cannot be met by the server."], _ [418, "I'm a teapot", "The server refuses the attempt to brew coffee with a teapot."], _ [421, "Misdirected Request", "The request was directed at a server that is not able to produce a response. \nThis can be sent by a server that is not configured \nto produce responses for the combination of scheme and \nauthority that are included in the request URI."], _ [422, "Unprocessable Content (WebDAV)", "The request was well-formed but was unable to be followed due to semantic errors."], _ [423, "Locked (WebDAV)", "The resource that is being accessed is locked."], _ [424, "Failed Dependency (WebDAV)", "The request failed due to failure of a previous request."], _ [425, "Too Early Experimental", "Indicates that the server is unwilling to \nrisk processing a request that might be replayed."], _ [426, "Upgrade Required", "The server refuses to perform the request using the current protocol but \nmight be willing to do so after the client upgrades to a different protocol. \nThe server sends an Upgrade header in a 426 response to indicate the required protocol(s)."], _ [428, "Precondition Required", "The origin server requires the request to be conditional. \nThis response is intended to prevent the 'lost update' problem, \nwhere a client GETs a resource's state, \nmodifies it and PUTs it back to the server, \nwhen meanwhile a third party has modified the state on the server, \nleading to a conflict."], _ [429, "Too Many Requests", "The user has sent too many requests in a given amount of time (rate limiting)."], _ [431, "Request Header Fields Too Large", "The server is unwilling to process the request because its header fields are too large. \nThe request may be resubmitted after reducing the size of the request header fields."], _ [451, "Unavailable For Legal Reasons", "The user agent requested a resource that cannot legally be provided, \nsuch as a web page censored by a government."], _ [500, "Internal Server Error", "The server has encountered a situation it does not know how to handle. \nThis error is generic, indicating that the server cannot find \na more appropriate 5XX status code to respond with."], _ [501, "Not Implemented", "The request method is not supported by the server and cannot be handled. \nThe only methods that servers are required to support \n(and therefore that must not return this code) are GET and HEAD."], _ [502, "Bad Gateway", "This error response means that the server, \nwhile working as a gateway to get a response needed to handle the request, \ngot an invalid response."], _ [503, "Service Unavailable", "The server is not ready to handle the request. \nCommon causes are a server that is down for maintenance or that is overloaded. \nNote that together with this response, \na user-friendly page explaining the problem should be sent. \nThis response should be used for temporary conditions and the Retry-After HTTP header should, \nif possible, contain the estimated time before the recovery of the service. \nThe webmaster must also take care about the caching-related headers that are sent along with this response, \nas these temporary condition responses should usually not be cached."], _ [504, "Gateway Timeout", "This error response is given when the server is \nacting as a gateway and cannot get a response in time."], _ [505, "HTTP Version Not Supported", "The HTTP version used in the request is not supported by the server."], _ [506, "Variant Also Negotiates", "The server has an internal configuration error: during content negotiation, \nthe chosen variant is configured to engage in content negotiation itself, \nwhich results in circular references when creating responses."], _ [507, "Insufficient Storage (WebDAV)", "The method could not be performed on the resource because the server is unable \nto store the representation needed to successfully complete the request."], _ [508, "Loop Detected (WebDAV)", "The server detected an infinite loop while processing the request."], _ [510, "Not Extended", "The client request declares an HTTP Extension (RFC 2774) that should be used to process the request, \nbut the extension is not supported."], _ [511, "Network Authentication Required", "Indicates that the client needs to authenticate to gain network access."] _ ] Local $m[] Local $STATUS_CODES For $i = 0 To UBound($aHTTP_STATUS_CODES) - 1 $STATUS_CODES = Int($aHTTP_STATUS_CODES[$i][0]) $m[$STATUS_CODES] = $i Next $mMap = $m Return $aHTTP_STATUS_CODES EndFunc ;==>_HTTP_STATUS ;--------------------------------------------------------------------------------------- ; ##### Example Usage demonstrating filters ##### ;--------------------------------------------------------------------------------------- _Example() Func _Example() Local $sTestFilePath = @ScriptDir & "\links_test.txt" ; With GUI _LinksInspectorGUI($sTestFilePath) ; or just as function Local $aLinks ;~ $aLinks = _LinksInspector($sTestFilePath, "*") ; Show ALL links ;~ $aLinks = _LinksInspector($sTestFilePath, "*", True) ; Show ALL, but ONLY for URLs within HTML/XML attributes (e.g., href="..."). ;~ $aLinks = _LinksInspector($sTestFilePath, "!") ; Show ALL results except 200 ;~ $aLinks = _LinksInspector($sTestFilePath, "400, 404") ; Show ONLY the 400 and 404 ;~ $aLinks = _LinksInspector($sTestFilePath, $LINKS_BROKEN) ; Show $LINKS_BROKEN = "0, 404, 500, 501, 502, 503, 504" ;~ $aLinks = _LinksInspector($sTestFilePath, $LINKS_NEEDS_REVIEW) ; Show $LINKS_NEEDS_REVIEW = "301, 302, 307, 400, 401, 403" _ArrayDisplay($aLinks, "$aLinks", "", 0, Default, "Line(s)|Code|Status|URL") EndFunc ;==>_Example Please, every comment is appreciated! leave your comments and experiences here! Thank you very much
    3 points
  21. Hi @donnyh13, One of the changes in in v1.0.14 is the minimum supported vscode engine, from 1.52.0 to 1.96.0. relevant commit here: https://github.com/loganch/AutoIt-VSCode/commit/ede5ceab464f74149f5f46a2741f6536ae7664d4 I'm pretty sure this is what is preventing you from installing, since version 1.70.3 is the last vscode version that supports windows7. source: https://code.visualstudio.com/updates/v1_70 I would argue that a change in supported vscode engine version should require a release version to bump the major version number, this was released as part of a patch version. Self promotion 😛: my extension should still work, since my vscode engine version is on 1.61.0 as it was since the beginning
    3 points
  22. You're perfectly right. Relevant neurons fixed!
    3 points
  23. I could install Win7 in a VM but am clueless to all VSCode. I don't use it. Would not know what works and what don't. If you don't have a Win7 ISO, go to torrent-land and get an up to date one. I'll retire the day I die. Maybe even after ! I loved WinXP but time moves forward. Win11 ain't bad ( after you tweak the heck out of it ). I install Windows on any language is not because am a polyglot, but because everything is always pretty much the same in the same place, same icons. Remember: Your feet don't stay on the ground because of gravity. The whole planet stick to your feet because of your gravitas 🙇
    3 points
  24. @water... I'll get me some cafe, take a walk, ..something. I edited my post above. I took everything out of context. My brain is hooked on a work project and I can not do more than one thing at the time Ok. That addition to the Date.au3 UDF, was right there for the taking. All I did was to add the strings for options 6 and 7 ... Case 6 If $asTimePart[0] > 1 Then $sTempTime = "hh:mm tt" EndIf Case 7 If $asTimePart[0] > 1 Then $sTempTime = "hh:mm:ss tt" EndIf ... Now including the AM/PM to it, ...I'll need to be in a happy place ( no pressure ) to get my brain in gear for that. Now any and every one, is welcomed to present a _DateTimeFormat() that includes that. I'll ( well, the MVPs ) will look at it and say "yey/ney". Remember ( not just you ), that all these UDFs were scripts users of the forum coded and expanded with the participation of everyone. Don't be shy. Your nationforum needs you !. ( nowalways recruiting coders )
    3 points
  25. Tremendous! Thank you, this gives me something to tinker with!
    2 points
  26. User Interface Builder Overview Use this tool to visually design Windows applications with a focus on Metro windows, standard windows, and Tool windows. This is for users who want a faster and simpler development tool. Drag-and-drop GUI creation, code generation, and easy control alignment tools. No more clicking through property sheets to set variable names, sizes, and the control’s text. Please replace "MetroUDF-Required\SSCtrlHover.au3" within the metro UDF files to see more meaningful messages in the console. The following line was inserted into the function. This prevents crashing on syntax and logical errors while Metro buttons are in use. Func _cHvr_Register($idCtrl, $fnHovOff = '', $fnHoverOn = '', $fnClick = '', $fnDblClk = '', $HoverData = 0,$ClickData = 0,$fnRightClick = '') If $BLOCK_HOVER_REGISTRATION Then Return Unfortunately, the following will have to added to your scripts if you already use Metro UDF and you replace "SSCtrlHover.au3". Global $BLOCK_HOVER_REGISTRATION = False #include "MetroGUI_UDF.au3" #include "MetroGUI_UDF_xpk.au3" #include "_GUIDisable.au3" ; For dim effects when msgbox is displayed Features Metro Controls for all window types WYSIWYG real-time preview Generates AutoIt GUI and message loop code Multiple control selection and manipulation Make additional selections with the CTRL key Accelerated control movements with the SHIFT key Change controls position with mouse or arrow keys Double click a control to precisely set its size and text Save/load GUI layouts and Control layouts to files Custom styles/themes and Controls using Metro Snap-to-guide, and toolbar alignment aids Drag down guides from the top and left sides of the Designer window Copy-n-paste between different window types Technical Details .Gui/.Ctrls file is a simple delimited text file Copy-n-paste is a similar file without the window specifications The application is meant to be portable, so it is one file The only Custom UDFs in use is Metro 5.1, and my Metro Expansion pack The script uses Label controls for everything. No GDI was used. Every control handle is saved in an array Maps are used in Metro and in future UDFs containing new controls You need Metro 5.1 UDF Limitations and known issues Resizing the Metro window with the mouse is flaky Changing control and window styles is not implemented Window size cannot be changed precisely Undo functionality might cause problems with code generation No Redo implemented Thank you BB19 and everyone that contributed to Metro UDF. MetroGUI_UDF_xpk.au3 SSCtrlHover.au3 UserInterfaceBuilder.au3
    2 points
  27. Finally! Latest version in the OP. Huge shoutout to Jos because I leaned very heavily on his AutoItGotoDefinition (you did write that I assume?).
    2 points
  28. You're supposed to be able to set #AutoIt3Wrapper_AU3Check_Parameters with the flags you want (which would be -w- 4 for turning off the local in global scope warning) but turns out there's a bug with reading them in for the diagnostics that I'm fixing right now. `
    2 points
  29. Hi everyone, that's exactly right ! I found the solution at work this morning! But I couldn't respond. Like you, I considered adding a variable : $iRet_Value, but I tried to overcomplicate things at the beginning and i lost time ! Case $g_idButton4 ConsoleWrite("GUI2: CANCEL=" & $g_idButton4 & @CRLF) $iRet_Value ="KO" ExitLoop and i put : if $iRet_Value ="KO" then return instead : if gui2()... I didn't know this way : Func Traitement_intermediaire()     ; display the listview     If gui2() Then Return     MsgBox(0, "Suite", "cela continue")  ;suite du script     ;.... EndFunc   ;==>Traitement_intermediair Thank you for your help 🙂
    2 points
  30. @pixelsearch thanks for the clarification, because I didn't think about/understand this case question, isn't that enough? Local $aMsg = 0, $iReturn = 0 While 1 $aMsg = GUIGetMsg($GUI_EVENT_ARRAY) Switch $aMsg[1] ; Switch from GUIs Case $g_hGUI2 Switch $aMsg[0] ; Switch from event ID Case $GUI_EVENT_CLOSE, $g_idButton4 ConsoleWrite("GUI2: $GUI_EVENT_CLOSE=" & $GUI_EVENT_CLOSE & @CRLF) If $aMsg[0] = $g_idButton4 Then ConsoleWrite(" with Cancel" & @CRLF) $iReturn = 1 EndIf ExitLoop Case $g_idButton3 ConsoleWrite("GUI2: $g_idButton3=" & $g_idButton3 & @CRLF) MessageBox(2) EndSwitch EndSwitch WEnd GUIDelete($g_hGUI2) GUICtrlSetState($g_idButton2, $GUI_ENABLE) Opt("GUIOnEventMode", 1) ; when out of $g_hGUI2 - enable <<<<<<<<<<<<<<< Return $iReturn EndFunc ;==>gui2 ... Func Traitement_intermediaire() ; display the listview If gui2() Then Return MsgBox(0, "Suite", "cela continue") ;suite du script ;.... EndFunc ;==>Traitement_intermediaire
    2 points
  31. I added some resize code this morning that seems to work well. There are still going to be some differences depending on what DPI scaling the user has set on their system. So I still have to factor DPI into the code at some point. Example with resize:
    2 points
  32. ... Local $sFile = StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", 0, -1) -1 ) & "\Examples\GUI\logo4.gif" Local $hImage = _GDIPlus_ImageLoadFromFile($sFile) ;create an image object based on a file Global $hWorkerW = _WinAPI_FindWindowEx($hProgman, 0, "WorkerW", "") 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 If $hWorkerW = 0 Then Exit MsgBox(16, "ERROR", "Couldn't find WorkerW under Progman", 30) ... OnAutoItExitRegister(CleanupResources) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd CleanupResources() Func CleanupResources() Local Static $iRunOnce = 0 If $iRunOnce Then Return ConsoleWrite('+ Func CleanupResources() - WinExists: ' & WinExists($hGUI) & ' - ' & (IsInt(Execute("@exitCode")) ? 'TrayExit' : 'GuiClosed') & @CRLF) ;cleanup resources _GDIPlus_BrushDispose($hTexture) _GDIPlus_ImageDispose($hImage) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() GUIDelete($hGUI) $iRunOnce = 1 EndFunc ... ...be mindful of everyone and everything ?
    2 points
  33. See example in helpfile for _GDIPlus_TextureCreate()
    2 points
  34. No big deal, just make it simple : use a single underscore, check the help file (while scripting) to make sure the name with underscore doesn't already exists. And if you don't check the help file, then you'll always got one of these 2 errors, for example with this silly script ! #include <Array.au3> Func _ArrayDisplay($aArray) EndFunc * Au3Check (when saving your script) => error: _ArrayDisplay() already defined. * Then if you run the script => Duplicate function name : _ArrayDisplay() No, the loop While...WEnd is provided so the script doesn't end immediately ! Try to comment out the While...WEnd loop and see what happens : $Form1 will be displayed a couple of ms then the script ends. This While...WEnd loop is an endless loop and you're "stuck" inside it while the script is running (when no event is triggered, for example clicking a button etc...) . Just add a counter inside it to see how it goes : Local $iCount = 0 While 1 $iCount +=1 ConsoleWrite($iCount & @CRLF) Sleep(10) ; prevents hogging all the CPU (+++) WEnd See how the counter constantly increases in the Console ? It shows that you're stuck inside this loop (as ConsoleWrite is constantly called) until you choose to exit the script. What do you expect that could happen between functions ? Nothing. When a function ends (EndFunc) then as showed before, you're stuck in the While...WEnd loop, waiting for another event to occur (user closes a GUI, presses a button etc...) $Form2 is hidden because of this line which immediately follows your "9e" comment : GUISetState(@SW_HIDE, $Form2) You don't have to "exit" a window to hide it, you can simply apply a line of code, anywhere in your script, to hide it : that's the purpose of GUISetState(@SW_HIDE, $Form2) In this script (unfortunately) clicking buttons in Form2 and Form3 have the same effect than clicking the {X] button to close their GUI's . It would be better to add some "real action" that will happen when you click the buttons, instead of simply mimicking a Windows Close when you click the buttons. But you'll certainly do this in your final project. GUISetState(@SW_HIDE, $Form2) has nothing to do with the fact that $Form1 is displayed because GUISetState(@SW_HIDE, $Form2) simply hides $Form2, no more, no less. In this script, $Form1 is never hidden but it may be covered by other windows and we probably would like, when needed, to make $Form1 not only "current" (GUISwitch) but also "active" (on top, with focus) using WinActivate (as correctly stated in the help file, topic GUISwitch) To achieve this, I suggest these modifications in functions _ColRow and _CloseForm : Func _ColRow() Switch @GUI_CtrlId Case $sGUI2Button GUISetState(@SW_HIDE, $Form2) GUICtrlSetState($sCol1Row1, $GUI_ENABLE) Case $sGUI3Button GUISetState(@SW_HIDE, $Form3) GUICtrlSetState($sCol1Row2, $GUI_ENABLE) EndSwitch GUISwitch($Form1) If Not WinActive($Form1) Then WinActivate($Form1) EndFunc ;==>_ColRow Func _CloseForm() Switch @GUI_WinHandle Case $Form1 MsgBox($MB_OK, "Exit Main Form", "Exiting...", 1) Exit Case $Form2 GUISetState(@SW_HIDE, $Form2) GUICtrlSetState($sCol1Row1, $GUI_ENABLE) Case $Form3 GUISetState(@SW_HIDE, $Form3) GUICtrlSetState($sCol1Row2, $GUI_ENABLE) EndSwitch GUISwitch($Form1) If Not WinActive($Form1) Then WinActivate($Form1) EndFunc ;==>_CloseForm This will activate $Form1 if it was covered by another window, when you click on buttons or close Form2 / Form3 Of course, if you intentionally minimized $Form1 then it won't have any effect. In this case ($Form1 minimized by the user) then it requires an additional line of code. Hope I answered all your questions, time to rest...
    2 points
  35. some observations #include <WinAPIGdi.au3> ;Coded by WildByDesign 1st post Local $sFontFile = "C:\Windows\Fonts\Rubik-VariableFont_wght.ttf" ConsoleWrite("Title: " & _WinAPI_GetFontResourceInfo($sFontFile, True) & @CRLF) ConsoleWrite(@CRLF) ;Coded by UEZ build 2025-10-07 ;~ Local $sFontFile = FileOpenDialog("Select a font", "", "Fonts (*.ttf)") If $sFontFile = "" Or @error Then Exit ConsoleWrite("Title: " & _WinAPI_GetFontTitle($sFontFile) & @CRLF) Func _WinAPI_GetFontTitle($sFont) If Not _WinAPI_AddFontResourceEx($sFontFile, $FR_PRIVATE) Then Return SetError(1, 0, 0) Local $tFont = DllStructCreate("wchar title[4096]") Local $aRet = DllCall("gdi32.dll", "bool", "GetFontResourceInfoW", "wstr", $sFontFile, "dword*", DllStructGetSize($tFont), "struct*", $tFont, "dword", 1) If @error Or Not $aRet[0] Then _WinAPI_RemoveFontResourceEx($sFontFile, $FR_PRIVATE) Return SetError(2, 0, 0) EndIf _WinAPI_RemoveFontResourceEx($sFontFile, $FR_PRIVATE) Return $tFont.title EndFunc From what I understand, Parsix is looking for this, which WildByDesign already published in the 1st post ;Coded by WildByDesign 1st post #include <WinAPIGdi.au3> Local $sFontFile = "C:\Windows\Fonts\Rubik-VariableFont_wght.ttf" FontGetInfoFromFile($sFontFile, 1, "Font Family name") FontGetInfoFromFile($sFontFile, 4, "Font full name") Func FontGetInfoFromFile($sFile, $n, $sElement) Local $s = _WinAPI_GetFontResourceInfo($sFile, Default, $n) If Not @error And $s Then ConsoleWrite($sElement & " = " & $s & @CRLF) EndFunc ;==>FontGetInfoFromFile WildByDesign the only thing that confused me is the 256 FontGetInfoFromFile($sFile, 256, "Font-specific names") since _WinAPI_GetFontMemoryResourceInfo only shows up to 20 (maybe undocumented)?
    2 points
  36. Hello Here is my network UDF. Do not yell at me if it already exists ... I hope it will be useful to someone. Please, let me know if you have any problem. All functions that perform modifications required administrator rights Functions list : Internal functions only : Examples : #Include "network.au3" ; List of availables connections/cards #Include <array.au3> ; only for _ArrayDisplay() $infos = _GetNetworkAdapterList() _ArrayDisplay($infos) ; Network card informations for the network connection called "Local Area Network" $infos = _GetNetworkAdapterInfos("Local Area Network") _ArrayDisplay($infos) ; Disable a network connection _DisableNetAdapter("Broadcom NetLink (TM) Gigabit Ethernet") ; OR _DisableNetAdapter("Local Area Network") ; Enable a network connection _EnableNetAdapter("Local Area Network") ; OR _EnableNetAdapter("Broadcom NetLink (TM) Gigabit Ethernet") ; Enable DHCP (for IP Address) _EnableDHCP("Broadcom NetLink (TM) Gigabit Ethernet") ; OR _EnableDHCP("Local Area Network") ; Configure a static IP adress _EnableStatic("Broadcom NetLink (TM) Gigabit Ethernet", "192.168.10.11", "255.255.255.0") ; OR _EnableStatic("Local Area Network", "192.168.10.11", "255.255.255.0") ; Configure the default gateway _SetGateways("Broadcom NetLink (TM) Gigabit Ethernet", "192.168.10.1") ; OR _SetGateways("Local Area Network", "192.168.10.1") ; Configure DNS servers Local $DNS_SERVERS[4] = [ "192.168.100.1", "192.168.100.2", "192.168.100.3", "192.168.100.4" ] _SetDNSServerSearchOrder("Local Area Network", $DNS_SERVERS) ; OR _SetDNSServerSearchOrder("Broadcom NetLink (TM) Gigabit Ethernet", $DNS_SERVERS) ; Configure the DNS domain name _SetDNSDomain ("Local Area Network", "mondomain.loc") ; OR _SetDNSDomain ("Broadcom NetLink (TM) Gigabit Ethernet", "mondomain.loc") ; Configure the DNS suffixes for all connections : Local $DNS_SUFFIXES[2] = [ "mondomain.loc", "mydomain.priv" ] _SetDNSSuffixSearchOrder($DNS_SUFFIXES) ; Clear the DNS cache (like ipconfig /flushdns) _FlushDNS() ; Remove an entry from the DNS cache _FlushDNSEntry("www.autoitscript.com") ; Configure the WINS servers (very old, now ...) _SetWINSServer("Local Area Network", "192.168.100.251", "192.168.100.252") ; OR _SetWINSServer("Broadcom NetLink (TM) Gigabit Ethernet", "192.168.100.251", "192.168.100.252") ; Enable the two options : ; - Register this connection's address in DNS ( first parameter) ; - Use this connection's DNS suffix in DNS registration (second parameter) _SetDynamicDNSRegistration("Local Area Network", True, True) ; Release the DHCP lease _ReleaseDHCPLease() ; Renew the DHCP lease _RenewDHCPLease() ; Sets the Private category to the network connection called "LAN" _SetCategory("LAN", 1) Download link : Network.au3
    2 points
  37. wakillon

    _LinksInspector

    Hi ioa747 I have tried your code with an autoitscript.com xml file sitemap and it works pretty well 😉 https://www.autoitscript.com/site/page-sitemap.xml And we can see some 404 error messages there 😅
    2 points
  38. Thanks for the reply and the diagnostics. Yes, I bet you are correct. Looking at Logan’s release notes for the version that is no longer compatible, node.js is the only thing there that would make sense as being the problem. 😂 I think this would be fitting! Thanks everyone for the help. off-topic reply------------------- Best regards,
    2 points
  39. Greetings everyone; I was wondering if some familiar with the English language, in the various flavors, could chip in. To me, the following snippets from the help file are using the wrong word, "Loose" instead of "Lose". Is there some reversal of meaning in other dialects with these words? Between American English and European English, etc.? My understanding is as follows: "Loose" = a loose tooth in your mouth, "Lose" = you lose a tooth, (It has fallen out). Help file snippets: Thanks,
    2 points
  40. Fair enough, understood, thanks. Thanks 👌 . 😂 Maybe you should rename yourself to Philosoph'tum 😆 . Best regards Sven
    2 points
  41. Hi Jos, Not sure if you are wishing for a fix to the comments. But if so: I added to ~Line 105: if string.find(editor:GetLine(Parent_line), "^%s*;") then self:DebugPrint('! Parent Line is a Comment, finding real parent.', "Old Parent line: " .. Parent_line, "New Parent Line: " .. editor.FoldParent[Parent_line]) Parent_line = editor.FoldParent[Parent_line] end And to ~line 228, after: elseif Curr_firstword == "" and Curr_lastword == "" and Parent_line ~= -1 and string.find(',if,do,while,with,for,select,switch,func,volatile,', ',' .. fold_firstword .. ',', nil, true) ~= nil then -- Empty line in a fold, update indent to appropriate parent fold level. editor.LineIndentation[line + 1] = editor.LineIndentation[Parent_line] + editor.Indent self:DebugPrint('- Empty line in a keyword, update indent to Parent + 1 --', editor.LineIndentation[line + 1]) Added the following: elseif (string.find(Curr_firstword, "^;") ~= nil) and Curr_lastword == "" then -- Correct Indent after a comment which may be in the wrong indentation position. if (Parent_line ~= -1) and string.find(',if,do,while,with,for,select,switch,func,volatile,', ',' .. fold_firstword .. ',', nil, true) ~= nil then editor.LineIndentation[line + 1] = editor.LineIndentation[Parent_line] + editor.Indent self:DebugPrint('- New line after a comment, update indent to Parent + 1 --', "New Indent Level: " .. editor.LineIndentation[line + 1]) else editor.LineIndentation[line + 1] = 0 self:DebugPrint('- New line after a comment outside of a fold, update indent to 0 --', "New Indent Level: " .. editor.LineIndentation[line + 1]) end If you're not concerned. You can ignore this. Best regards,
    2 points
  42. Biatu

    Calling 7z.dll

    https://github.com/BiatuAutMiahn/DriverMgr2/blob/main/CPP/7zip/UI/Client7z/Client7z.cpp I franeknstein'd Igor's Client7z implementation so that I could read DriverPack archives, and make a driver database. Cleaned that mess up a bit into this: https://github.com/BiatuAutMiahn/7zip/blob/DriverMgr/CPP/7zip/Common/DriverPackMgr.cpp Then I exported the ddb functionality into a standalone utility for the DriverPackDB creation and hardware matching. https://github.com/BiatuAutMiahn/dpdbutil This is part of a driver framework in my WinPE project for work. Figured this was perfect for adding drivers to WinPE instead of mounting the image and injecting drivers, just look for the DDBs and load them.
    2 points
  43. For me as well ! The regional settings for Germany are fine ! "Thanks" to the post with the patch from @ioa747 added.
    2 points
  44. Wanted something more, added ... ; If $sType < 0 Or $sType > 5 Or Not IsInt($sType) Then If $sType < 0 Or $sType > 7 Or Not IsInt($sType) Then ... Case 6 If $asTimePart[0] > 1 Then $sTempTime = "hh:mm tt" EndIf Case 7 If $asTimePart[0] > 1 Then $sTempTime = "hh:mm:ss tt" EndIf ... If (StringInStr($sDate, 'pm') > 0) Or (StringInStr($sDate, $sPM) > 0) Then If $asTimePart[1] < 12 Then $asTimePart[1] += 12 ElseIf (StringInStr($sDate, 'am') > 0) Or (StringInStr($sDate, $sAM) > 0) Then If $asTimePart[1] = 12 Then $asTimePart[1] = 0 EndIf ... $sDate Input date in the format "YYYY/MM/DD[ HH:MM:SS[ tt]]" ... 4 - Display a time using the 24-hour format (hh:mm). (conversion from am/pm format). 5 - Display a time using the 24-hour format (hh:mm:ss). (conversion from am/pm format). 6 - Display a time using the am/pm format (hh:mm tt). 7 - Display a time using the am/pm format (hh:mm:ss tt). completed New version arrive
    2 points
  45. Ok, am getting better at screwing up 😅 That function ( _DateTimeFormat() ) does not do that. I'd have to look into it. Like my AI tells me: "you think too much of me" I'd have to get my brain in gear for that and am already spread too thin as is right now. @SOLVE-SMART gave him a solution for that in the German forum that works well ? ( haven't tested it ), unless that is not what he needs or you'd like to include that functionality in this function too, to have an all encompassing function to handle everything. Nonetheless your post woke me up to the in the date UDF. Edit: ...I need some cafe...
    2 points
  46. On the german forum there is a guy who needs to translate date/time from AM / PM format to 24 hours format. His problem has already been solved, but I remember your thread in the engl. forum regarding AM / PM output formatting. I searched the forum for code to do the AM /PM > 24 hours translation - without success. So I decided to ask the master of date / time translation
    2 points
  47. Here is a fun example that does the smooth color animation for the border and for the blur behind blend color as well. Mesmerizing! 🤩
    2 points
  48. Unfortunately, in Windows 11 the function to add a shortcut to the taskbar for quick access to desktop icons has been removed and since I relatively often need the desktop icons for daily work, I wrote a small tool to help me access the desktop icons faster which I want to share with you. The tool is written for Windows 11, so on older operating systems the result may differ. #pragma compile(FileVersion, 0.8.3.0) #pragma compile(ProductVersion, 3.3.18.0) #pragma compile(LegalCopyright, "UEZ 2022 - 2025") #pragma compile(CompanyName, "UEZ Software Development") #pragma compile(FileDescription, "Toolbar Desktop.exe - a simple toolbar menu app for Windows 11 to access desktop icons faster.") ;don't change because it is needed #pragma compile(Icon, Shell32_39.ico) ;~ #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_Change2CUI=n #AutoIt3Wrapper_Version=p #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Res_HiDpi=n #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /pe ;/rm ;~ #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_stripped.au3" #include <Array.au3> #include <ButtonConstants.au3> #include <File.au3> #include <FontConstants.au3> #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <GuiImageList.au3> #include <GuiListView.au3> #include <GuiMenu.au3> #include <GuiStatusBar.au3> #include <Misc.au3> #include <StaticConstants.au3> #include <TrayConstants.au3> #include <WinAPIConstants.au3> #include <WinAPIShellEx.au3> #include <WinAPISys.au3> #include <WinAPISysWin.au3> #include <WinAPIvkeysConstants.au3> #include <WindowsConstants.au3> If @OSBuild < 7600 Then Exit MsgBox($MB_ICONERROR, "ERROR", "This app is using the Win7+ API which means that your operation system is not supported!", 10) If @OSBuild < 22000 Then MsgBox($MB_ICONWARNING, "WARNING", "This app is not designed for your operating system." & @CRLF & "The app may not work as intended!", 10) AutoItSetOption("TrayMenuMode", 3) AutoItSetOption("MustDeclareVars", 1) If (Not @Compiled) And (Not FileExists(@ScriptDir & "\_Shell32_39.ico")) Then _Shell32_39ico(True) Global Const $sScriptName = StringTrimRight(@ScriptName, 4) Global Const $sTitle = "Toolbar Desktop ", $sVer = "v0.83 build 2025-10-08 beta" Global $iPID = ProcessExists(@ScriptName) If Not _Singleton(@ScriptName, 1) Or ($iPID <> @AutoItPID And $iPID <> 0) Then Exit MsgBox(16, "ERROR", "An occurence of " & @ScriptName & " is already running!", 20) _GDIPlus_Startup() #OnAutoItStartRegister "OnAutoItStart" Global $__Restart = False ;Const $WH_KEYBOARD_LL = 13 Global $bDarkMode = True #Region DPI Global Enum $DPI_AWARENESS_INVALID = -1, $DPI_AWARENESS_UNAWARE = 0, $DPI_AWARENESS_SYSTEM_AWARE = 1, $DPI_AWARENESS_PER_MONITOR_AWARE = 2 Global Const $DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE = $DPI_AWARENESS_UNAWARE - 3 Global Const $DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = $DPI_AWARENESS_UNAWARE - 4 Global Enum $MDT_EFFECTIVE_DPI = 0, $MDT_ANGULAR_DPI, $MDT_RAW_DPI Global Const $MDT_DEFAULT = $MDT_EFFECTIVE_DPI Global Const $WM_DPICHANGED = 0x02E0 Global $AWARENESS Switch @OSBuild Case 9200 To 13999 $AWARENESS = $DPI_AWARENESS_PER_MONITOR_AWARE Case @OSBuild > 13999 $AWARENESS = $DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 EndSwitch Global $iDPI = _WinAPI_SetDPIAwareness($AWARENESS), $iDPI_def = 96, $g_iDPI_ratio1, $g_iDPI_ratio2, $g_iDPI_Prev = $iDPI, $bSorted = 0 $g_iDPI_ratio1 = $iDPI / $iDPI_def $g_iDPI_ratio2 = $g_iDPI_ratio1 ^ - 1 #EndRegion DPI #Region IUIAutomation MS framework Global Const $TreeScope_Children = 2, $UIA_ControlTypePropertyId = 30003, $UIA_NamePropertyId = 30005, $UIA_ButtonControlTypeId = 50000 Global Const $sCLSID_CUIAutomation = "{FF48DBA4-60EF-4201-AA87-54103EEF594E}" Global Const $sIID_IUIAutomationElement = "{D22108AA-8AC5-49A5-837B-37BBB3D7591E}" Global $dtagIUIAutomationElement = "SetFocus hresult();" & "GetRuntimeId hresult(ptr*);" & "FindFirst hresult(long;ptr;ptr*);" & "FindAll hresult(long;ptr;ptr*);" & "FindFirstBuildCache hresult(long;ptr;ptr;ptr*);" & "FindAllBuildCache hresult(long;ptr;ptr;ptr*);" & "BuildUpdatedCache hresult(ptr;ptr*);" & "GetCurrentPropertyValue hresult(int;variant*);" & "GetCurrentPropertyValueEx hresult(int;long;variant*);" & "GetCachedPropertyValue hresult(int;variant*);" & "GetCachedPropertyValueEx hresult(int;long;variant*);" & "GetCurrentPatternAs hresult(int;none;none*);" & "GetCachedPatternAs hresult(int;none;none*);" & "GetCurrentPattern hresult(int;ptr*);" & "GetCachedPattern hresult(int;ptr*);" & "GetCachedParent hresult(ptr*);" & "GetCachedChildren hresult(ptr*);" & "CurrentProcessId hresult(int*);" & "CurrentControlType hresult(int*);" & "CurrentLocalizedControlType hresult(bstr*);" & "CurrentName hresult(bstr*);" & "CurrentAcceleratorKey hresult(bstr*);" & "CurrentAccessKey hresult(bstr*);" & "CurrentHasKeyboardFocus hresult(long*);" & "CurrentIsKeyboardFocusable hresult(long*);" & "CurrentIsEnabled hresult(long*);" & "CurrentAutomationId hresult(bstr*);" & "CurrentClassName hresult(bstr*);" & "CurrentHelpText hresult(bstr*);" & "CurrentCulture hresult(int*);" & "CurrentIsControlElement hresult(long*);" & "CurrentIsContentElement hresult(long*);" & "CurrentIsPassword hresult(long*);" & "CurrentNativeWindowHandle hresult(hwnd*);" & "CurrentItemType hresult(bstr*);" & "CurrentIsOffscreen hresult(long*);" & "CurrentOrientation hresult(long*);" & "CurrentFrameworkId hresult(bstr*);" & "CurrentIsRequiredForForm hresult(long*);" & "CurrentItemStatus hresult(bstr*);" & "CurrentBoundingRectangle hresult(struct*);" & "CurrentLabeledBy hresult(ptr*);" & "CurrentAriaRole hresult(bstr*);" & "CurrentAriaProperties hresult(bstr*);" & "CurrentIsDataValidForForm hresult(long*);" & "CurrentControllerFor hresult(ptr*);" & "CurrentDescribedBy hresult(ptr*);" & "CurrentFlowsTo hresult(ptr*);" & "CurrentProviderDescription hresult(bstr*);" & "CachedProcessId hresult(int*);" & "CachedControlType hresult(int*);" & "CachedLocalizedControlType hresult(bstr*);" & "CachedName hresult(bstr*);" & "CachedAcceleratorKey hresult(bstr*);" & "CachedAccessKey hresult(bstr*);" & "CachedHasKeyboardFocus hresult(long*);" & "CachedIsKeyboardFocusable hresult(long*);" & "CachedIsEnabled hresult(long*);" & "CachedAutomationId hresult(bstr*);" & "CachedClassName hresult(bstr*);" & "CachedHelpText hresult(bstr*);" & "CachedCulture hresult(int*);" & "CachedIsControlElement hresult(long*);" & "CachedIsContentElement hresult(long*);" & "CachedIsPassword hresult(long*);" & "CachedNativeWindowHandle hresult(hwnd*);" & "CachedItemType hresult(bstr*);" & "CachedIsOffscreen hresult(long*);" & "CachedOrientation hresult(long*);" & "CachedFrameworkId hresult(bstr*);" & "CachedIsRequiredForForm hresult(long*);" & "CachedItemStatus hresult(bstr*);" & "CachedBoundingRectangle hresult(struct*);" & "CachedLabeledBy hresult(ptr*);" & "CachedAriaRole hresult(bstr*);" & "CachedAriaProperties hresult(bstr*);" & "CachedIsDataValidForForm hresult(long*);" & "CachedControllerFor hresult(ptr*);" & "CachedDescribedBy hresult(ptr*);" & "CachedFlowsTo hresult(ptr*);" & "CachedProviderDescription hresult(bstr*);" & "GetClickablePoint hresult(struct*;long*);" Global Const $sIID_IUIAutomationElementArray = "{14314595-B4BC-4055-95F2-58F2E42C9855}" Global $dtagIUIAutomationElementArray = "Length hresult(int*);" & "GetElement hresult(int;ptr*);" Global Const $sIID_IUIAutomationPropertyCondition = "{99EBF2CB-5578-4267-9AD4-AFD6EA77E94B}" Global $dtagIUIAutomationPropertyCondition = "propertyId hresult(int*);" & "PropertyValue hresult(variant*);" & "PropertyConditionFlags hresult(long*);" Global Const $sIID_IUIAutomation = "{30CBE57D-D9D0-452A-AB13-7AC5AC4825EE}" Global $dtagIUIAutomation = "CompareElements hresult(ptr;ptr;long*);" & "CompareRuntimeIds hresult(ptr;ptr;long*);" & "GetRootElement hresult(ptr*);" & "ElementFromHandle hresult(hwnd;ptr*);" & "ElementFromPoint hresult(struct;ptr*);" & "GetFocusedElement hresult(ptr*);" & "GetRootElementBuildCache hresult(ptr;ptr*);" & "ElementFromHandleBuildCache hresult(hwnd;ptr;ptr*);" & "ElementFromPointBuildCache hresult(struct;ptr;ptr*);" & "GetFocusedElementBuildCache hresult(ptr;ptr*);" & "CreateTreeWalker hresult(ptr;ptr*);" & "ControlViewWalker hresult(ptr*);" & "ContentViewWalker hresult(ptr*);" & "RawViewWalker hresult(ptr*);" & "RawViewCondition hresult(ptr*);" & "ControlViewCondition hresult(ptr*);" & "ContentViewCondition hresult(ptr*);" & "CreateCacheRequest hresult(ptr*);" & "CreateTrueCondition hresult(ptr*);" & "CreateFalseCondition hresult(ptr*);" & "CreatePropertyCondition hresult(int;variant;ptr*);" & "CreatePropertyConditionEx hresult(int;variant;long;ptr*);" & "CreateAndCondition hresult(ptr;ptr;ptr*);" & "CreateAndConditionFromArray hresult(ptr;ptr*);" & "CreateAndConditionFromNativeArray hresult(ptr;int;ptr*);" & "CreateOrCondition hresult(ptr;ptr;ptr*);" & "CreateOrConditionFromArray hresult(ptr;ptr*);" & "CreateOrConditionFromNativeArray hresult(ptr;int;ptr*);" & "CreateNotCondition hresult(ptr;ptr*);" & "AddAutomationEventHandler hresult(int;ptr;long;ptr;ptr);" & "RemoveAutomationEventHandler hresult(int;ptr;ptr);" & "AddPropertyChangedEventHandlerNativeArray hresult(ptr;long;ptr;ptr;struct*;int);" & "AddPropertyChangedEventHandler hresult(ptr;long;ptr;ptr;ptr);" & "RemovePropertyChangedEventHandler hresult(ptr;ptr);" & "AddStructureChangedEventHandler hresult(ptr;long;ptr;ptr);" & "RemoveStructureChangedEventHandler hresult(ptr;ptr);" & "AddFocusChangedEventHandler hresult(ptr;ptr);" & "RemoveFocusChangedEventHandler hresult(ptr);" & "RemoveAllEventHandlers hresult();" & "IntNativeArrayToSafeArray hresult(int;int;ptr*);" & "IntSafeArrayToNativeArray hresult(ptr;int*;int*);" & "RectToVariant hresult(struct;variant*);" & "VariantToRect hresult(variant;struct*);" & "SafeArrayToRectNativeArray hresult(ptr;struct*;int*);" & "CreateProxyFactoryEntry hresult(ptr;ptr*);" & "ProxyFactoryMapping hresult(ptr*);" & "GetPropertyProgrammaticName hresult(int;bstr*);" & "GetPatternProgrammaticName hresult(int;bstr*);" & "PollForPotentialSupportedPatterns hresult(ptr;ptr*;ptr*);" & "PollForPotentialSupportedProperties hresult(ptr;ptr*;ptr*);" & "CheckNotSupported hresult(variant;long*);" & "ReservedNotSupportedValue hresult(ptr*);" & "ReservedMixedAttributeValue hresult(ptr*);" & "ElementFromIAccessible hresult(idispatch;int;ptr*);" & "ElementFromIAccessibleBuildCache hresult(iaccessible;int;ptr;ptr*);" #EndRegion IUIAutomation MS framework #Region TichySID Global Const $tagIMAGE_DOS_HEADER = 'WORD e_magic;WORD e_cblp;WORD e_cp;WORD e_crlc;WORD e_cparhdr;WORD e_minalloc;WORD e_maxalloc;WORD e_ss;WORD e_sp;WORD e_csum;WORD e_ip;WORD e_cs;WORD e_lfarlc;WORD e_ovno;WORD e_res[4];WORD e_oemid;WORD e_oeminfo;WORD e_res2[10];LONG e_lfanew;' Global Const $tagIMAGE_FILE_HEADER = 'WORD Machine;WORD NumberOfSections;DWORD TimeDateStamp;DWORD PointerToSymbolTable;DWORD NumberOfSymbols;WORD SizeOfOptionalHeader;WORD Characteristics;' Global $tagIMAGE_OPTIONAL_HEADER = 'WORD Magic;BYTE MajorLinkerVersion;BYTE MinorLinkerVersion;DWORD SizeOfCode;DWORD SizeOfInitializedData;DWORD SizeOfUninitializedData;DWORD AddressOfEntryPoint;DWORD BaseOfCode;DWORD BaseOfData;PTR ImageBase;DWORD SectionAlignment;DWORD FileAlignment;WORD MajorOperatingSystemVersion;WORD MinorOperatingSystemVersion;WORD MajorImageVersion;WORD MinorImageVersion;WORD MajorSubsystemVersion;WORD MinorSubsystemVersion;DWORD Win32VersionValue;DWORD SizeOfImage;DWORD SizeOfHeaders;DWORD CheckSum;WORD Subsystem;WORD DllCharacteristics;PTR SizeOfStackReserve;PTR SizeOfStackCommit;PTR SizeOfHeapReserve;PTR SizeOfHeapCommit;DWORD LoaderFlags;DWORD NumberOfRvaAndSizes;' If @AutoItX64 Then $tagIMAGE_OPTIONAL_HEADER = 'WORD Magic;BYTE MajorLinkerVersion;BYTE MinorLinkerVersion;DWORD SizeOfCode;DWORD SizeOfInitializedData;DWORD SizeOfUninitializedData;DWORD AddressOfEntryPoint;DWORD BaseOfCode;PTR ImageBase;DWORD SectionAlignment;DWORD FileAlignment;WORD MajorOperatingSystemVersion;WORD MinorOperatingSystemVersion;WORD MajorImageVersion;WORD MinorImageVersion;WORD MajorSubsystemVersion;WORD MinorSubsystemVersion;DWORD Win32VersionValue;DWORD SizeOfImage;DWORD SizeOfHeaders;DWORD CheckSum;WORD Subsystem;WORD DllCharacteristics;PTR SizeOfStackReserve;PTR SizeOfStackCommit;PTR SizeOfHeapReserve;PTR SizeOfHeapCommit;DWORD LoaderFlags;DWORD NumberOfRvaAndSizes;' Global Const $tagIMAGE_NT_HEADER = 'DWORD Signature;' & $tagIMAGE_FILE_HEADER & $tagIMAGE_OPTIONAL_HEADER Global Const $tagIMAGE_SECTION_HEADER = 'CHAR Name[8];DWORD VirtualSize;DWORD VirtualAddress;DWORD SizeOfRawData;DWORD PointerToRawData;DWORD PointerToRelocations;DWORD PointerToLinenumbers;WORD NumberOfRelocations;WORD NumberOfLinenumbers;DWORD Characteristics;' Global Const $tagIMAGE_DATA_DIRECTORY = 'DWORD VirtualAddress;DWORD Size;' Global Const $tagIMAGE_BASE_RELOCATION = 'DWORD VirtualAddress;DWORD SizeOfBlock;' Global Const $tagIMAGE_IMPORT_DESCRIPTOR = 'DWORD OriginalFirstThunk;DWORD TimeDateStamp;DWORD ForwarderChain;DWORD Name;DWORD FirstThunk;' Global Const $tagIMAGE_IMPORT_BY_NAME = 'WORD Hint;char Name[1];' Global Const $tagIMAGE_EXPORT_DIRECTORY = 'DWORD Characteristics;DWORD TimeDateStamp;WORD MajorVersion;WORD MinorVersion;DWORD Name;DWORD Base;DWORD NumberOfFunctions;DWORD NumberOfNames;DWORD AddressOfFunctions;DWORD AddressOfNames;DWORD AddressOfNameOrdinals;' Global $_KERNEL32DLL = DllOpen('kernel32.dll') Global $_MFHookPtr, $_MFHookBak, $_MFHookApi = 'LocalCompact' Global Const $tagModule = 'PTR ExportList;PTR CodeBase;PTR ImportList;PTR DllEntry;DWORD Initialized;' Global Const $SID_MEMORY = 1 Global Const $SID_NON_DEFAULT = 2 Global $hTitchysidDll, $iSubsongCount = 0 Global $binSID = _SID_Tune() #EndRegion TichySID Global $aTaskbar = WinGetPos("[CLASS:Shell_TrayWnd;INSTANCE:1]", "") Global $i, $aShortcutDetails, $hIcon, $aFileList = ReadDesktopIcons(), $aFileIcons[$aFileList[0] + 1] If @error Then Dim $aFileList[1] $aFileList[0] = 0 MsgBox($MB_ICONWARNING, "Warning", "No desktop icons!", 15) EndIf Global $iLen = 0, $l For $i = 1 To $aFileList[0] $l = StringLen(StringRegExpReplace($aFileList[$i], ".*\\(.*)\..+", "$1")) $iLen = $l > $iLen ? $l : $iLen Next Global $iW = 0, $iH = 0, $iW_def, $iH_def, $iLVBgColor = $bDarkMode ? 0xD8D8D8 : 0xFFFFFF, $iLVTxtColor = 0x000000, $iColumnWidth, $hHBITMAP, $fIconSize = 16 * $g_iDPI_ratio1, $fLVFontSize = 15.5 * $g_iDPI_ratio1 Global Const $hGUI = GUICreate("Toolbar Desktop by UEZ", $iW, $iH, $aTaskbar[1] ? -1 : -10000, $aTaskbar[1] ? -10000 : -1, BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX), $WS_EX_TOPMOST) GUISetFont(8.5, $FW_NORMAL, $GUI_FONTNORMAL, "Arial", $hGUI, $CLEARTYPE_QUALITY) Global $hLV_Font = _WinAPI_CreateFont($fLVFontSize, 0, 0, 0, $FW_MEDIUM, False, False, False, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $CLEARTYPE_QUALITY, 0, "Segoe UI") Global $hLV = _GUICtrlListView_Create($hGUI, "", 0, 0, 0, 0, BitOR($LVS_SINGLESEL, $LVS_NOCOLUMNHEADER, $LVS_LIST)), $iLV = _WinAPI_GetDlgCtrlID($hLV) GUICtrlSendMsg($hLV, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_ONECLICKACTIVATE, $LVS_EX_TRACKSELECT) ;_GUICtrlListView_SetExtendedListViewStyle($hLV, $LVS_EX_DOUBLEBUFFER) _GUICtrlListView_SetExtendedListViewStyle($hLV, BitOR($LVS_EX_DOUBLEBUFFER, $LVS_EX_ONECLICKACTIVATE, $LVS_EX_TRACKSELECT)) _GUICtrlListView_InsertColumn($hLV, 0, "Desktop App") Global Const $ILC_ORIGINALSIZE = 0x00010000, $ILC_HIGHQUALITYSCALE = 0x00020000 Global $hImageList = DllCall("comctl32.dll", "handle", "ImageList_Create", "int", $fIconSize, "int", $fIconSize, "uint", BitOR($ILC_COLOR32, $ILC_ORIGINALSIZE, $ILC_HIGHQUALITYSCALE), "int", $aFileList[0], "int", $aFileList[0])[0] _GUICtrlListView_SetBkColor($hLV, $bDarkMode ? BitXOR($iLVBgColor, 0xFFFFFF) : $iLVBgColor) ConsoleWrite("Added " & $aFileList[0] & " items to the list" & @CRLF) For $i = 1 To $aFileList[0] $hIcon = _WinAPI_ShellExtractAssociatedIcon($aFileList[$i], True) If $hIcon Then $aFileIcons[$i] = $hIcon $hHBITMAP = _WinAPI_Create32BitHBITMAP($hIcon) _GUIImageList_Add($hImageList, $hHBITMAP) _WinAPI_DeleteObject($hHBITMAP) Else _GUIImageList_Add($hImageList, _GUICtrlListView_CreateSolidBitMap($hLV, 0xFFFFFF, $fIconSize, $fIconSize)) EndIf Next _GUICtrlListView_SetImageList($hLV, $hImageList, 1) Global $aIconAssignment[UBound($aFileList) - 1][3] For $i = 1 To $aFileList[0] If StringInStr(FileGetAttrib($aFileList[$i]), "D") Then If StringRegExp($aFileList[$i], ".+\.\{(.*)\}") Then _GUICtrlListView_AddItem($hLV, StringRegExpReplace($aFileList[$i], ".*\\(.*)\..+", "$1"), $i - 1, $i - 1) Else _GUICtrlListView_AddItem($hLV, StringRegExpReplace($aFileList[$i], ".+\\(.+)", "$1"), $i - 1, $i - 1) EndIf Else _GUICtrlListView_AddItem($hLV, StringRegExpReplace($aFileList[$i], ".*\\(.*)\..+", "$1"), $i - 1, $i - 1) EndIf $aIconAssignment[$i - 1][0] = $i - 1 $aIconAssignment[$i - 1][1] = $aFileList[$i] $aIconAssignment[$i - 1][2] = $aFileIcons[$i] Next Global $aPos = WinGetPos($hGUI), $aWinPos Global $aParts[1] = [1], $hStatusBar $hStatusBar = _GUICtrlStatusBar_Create($hGUI, $aParts) Global Const $iStatusBar = _WinAPI_GetDlgCtrlID($hStatusBar), $iH_SB = _GUICtrlStatusBar_GetHeight($hStatusBar) Global $g_pStatusBarCallback = DllCallbackRegister("_StatusBar_WndProc", "lresult", "hwnd;uint;wparam;lparam") Global $g_pOrigStatusBarProc = _WinAPI_SetWindowLong($hStatusBar, $GWL_WNDPROC, DllCallbackGetPtr($g_pStatusBarCallback)) GUIRegisterMsg($WM_SIZE, "WM_SIZE") If $iW < @DesktopWidth / 2 And BitAND(_WinAPI_GetWindowLong($hLV, $GWL_STYLE), $WS_HSCROLL) = $WS_HSCROLL Then While BitAND(_WinAPI_GetWindowLong($hLV, $GWL_STYLE), $WS_HSCROLL) $iW += 2 $iH += 1 WinMove($hGUI, "", $aPos[0], $aPos[1], $iW * $g_iDPI_ratio1, ($iH + $iH_SB) * $g_iDPI_ratio1) If $iW > @DesktopWidth / 2 Then ExitLoop WEnd EndIf If $iW = 0 Or $iH = 0 Then $iW = 200 $iH = $iW * 8 / 16 WinMove($hGUI, "", $aPos[0], $aPos[1], $iW * $g_iDPI_ratio1, ($iH + $iH_SB + 1) * $g_iDPI_ratio1) _GUICtrlListView_SetColumnWidth($hLV, 0, $iW) EndIf Global $fAdjust = $g_iDPI_ratio1 > 1 ? 1 + $g_iDPI_ratio1 / 10 : 1 $iW_def = $iW * $fAdjust $iH_def = ($iH * $fAdjust + $iH_SB) ConsoleWrite("GUI size: " & ($iW) & " x " & ($iH) & @CRLF) Global $iLV_cw = _GUICtrlListView_GetColumnWidth($hLV, 0) _GUICtrlStatusBar_SetText($hStatusBar, $aFileList[0] & " icons added to the list") Global Const $hMenu_Tray = TrayItemGetHandle(0) Global Const $iTrayRestart = TrayCreateItem("Restart") Global Const $iTrayAutostart = TrayCreateItem("Autostart") Global Const $iTrayDarkmode = TrayCreateItem("Darkmode") Global Const $iTrayAbout = TrayCreateItem("About") TrayCreateItem("") Global Const $iTrayExit = TrayCreateItem("Exit") If @OSBuild < 17763 Then TrayItemSetState($iTrayDarkmode, $TRAY_DISABLE) If RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Run", "Toolbar Desktop") = '"' & @ScriptDir & '\Toolbar Desktop.exe"' Then TrayItemSetState($iTrayAutostart, $TRAY_CHECKED) If $bDarkMode Then TrayItemSetState($iTrayDarkmode, $TRAY_CHECKED) Global $hTmp, $hBMP_Restart, $hBMP_About, $hBMP_Exit, $hBMP_Check, $hBMP_Rect CreateIcons() Global $sRunAsAdmin Global Enum $idRunAsAdmin = 2000, $idAbout, $idSort, $idOpenFL Global Const $hQMenu_LV = _GUICtrlMenu_CreatePopup() _GUICtrlMenu_InsertMenuItem($hQMenu_LV, 0, "Run app as Administrator", $idRunAsAdmin) _GUICtrlMenu_InsertMenuItem($hQMenu_LV, 1, "") _GUICtrlMenu_InsertMenuItem($hQMenu_LV, 2, "Sort List", $idSort) _GUICtrlMenu_InsertMenuItem($hQMenu_LV, 3, "") _GUICtrlMenu_InsertMenuItem($hQMenu_LV, 4, "Open File Location", $idOpenFL) _GUICtrlMenu_SetMenu($hGUI, $hQMenu_LV) Global $hBMP_Shield = _GUICtrlMenu_CreateBitmap(@SystemDir & "\imageres.dll", 73) _GUICtrlMenu_SetItemBmp($hQMenu_LV, 0, $hBMP_Shield) $hTmp = _GDIPlus_BitmapCreateFromMemory(_Sort()) Global Const $hBMP_Sort = _GDIPlus_Convert2HBitmap($hTmp, $COLOR_MENU) _GDIPlus_BitmapDispose($hTmp) _GUICtrlMenu_SetItemBmp($hQMenu_LV, 2, $hBMP_Sort) $hTmp = _GDIPlus_BitmapCreateFromMemory(_OpenFolder()) Global Const $hBMP_OpenFolder = _GDIPlus_Convert2HBitmap($hTmp, $COLOR_MENU) _GDIPlus_BitmapDispose($hTmp) _GUICtrlMenu_SetItemBmp($hQMenu_LV, 4, $hBMP_OpenFolder) Global Const $hMenu_Sys = _GUICtrlMenu_GetSystemMenu($hGUI) _GUICtrlMenu_AppendMenu($hMenu_Sys, $MF_SEPARATOR, 0, 0) _GUICtrlMenu_AppendMenu($hMenu_Sys, $MF_STRING, $idAbout, "About") _GUICtrlMenu_SetItemBmp($hMenu_Sys, 8, $hBMP_About) _WinAPI_DwmSetWindowAttribute($hGUI, $DWMWA_TRANSITIONS_FORCEDISABLED, True) ;disable window animation GUISetState(@SW_SHOWMINIMIZED, $hGUI) If $bDarkMode And @OSBuild > 17762 Then DarkMode($hGUI) _WinAPI_SetWindowTheme_unr($hLV, "", "") GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUIRegisterMsg($WM_EXITSIZEMOVE, "WM_EXITSIZEMOVE") GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUIRegisterMsg($WM_SYSCOMMAND, "WM_SYSCOMMAND") If @OSBuild > 9599 Then GUIRegisterMsg($WM_DPICHANGED, "WM_DPICHANGED") ;requires Win 8.1+ / Server 2012 R2+ Global $bCheck, $px, $py, $tx, $hTaskbar, $iMonitorX, $iMonitorY, $iMonitorW, $iMonitorH, $iTbW, $iTbH, $bManualResized = False Global Const $iWinTitleSize = _WinAPI_GetSystemMetrics($SM_CYSIZE), $iDummy_About = GUICtrlCreateDummy(), $iDummy_Error = GUICtrlCreateDummy() Global Const $iListViewCallback = DllCallbackRegister("LVKeyCallback", "long", "int;wparam;lparam"), _ $hHook_Key = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($iListViewCallback), _WinAPI_GetModuleHandle(0)) Global $oMyError = ObjEvent("AutoIt.Error", "ErrFunc") Global $iFPS = 0, $iShowFPS = 0, $bExit = False, $oShell = ObjCreate("WScript.Shell") Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _Exit() Case $iDummy_About About() Case $iDummy_Error MsgBox(BitOR($MB_TOPMOST, $MB_ICONWARNING), "Warning", "No desktop icons were added to the list!" & @CRLF & "Add at least one icon to the desktop which can be shell executed!", 15, $hGUI) EndSwitch Switch TrayGetMsg() Case $iTrayRestart _ScriptRestart() ;restart script to re-read desktop icons Case $iTrayAutostart $bCheck = BitAND($TRAY_CHECKED, TrayItemGetState($iTrayAutostart)) If $bCheck Then TrayItemSetState($iTrayAutostart, $TRAY_UNCHECKED) AutoStartReg(False) Else TrayItemSetState($iTrayAutostart, $TRAY_CHECKED) AutoStartReg(True) EndIf Case $iTrayDarkmode $bCheck = BitAND($TRAY_CHECKED, TrayItemGetState($iTrayDarkmode)) If $bCheck Then TrayItemSetState($iTrayDarkmode, $TRAY_UNCHECKED) $bDarkMode = False Else TrayItemSetState($iTrayDarkmode, $TRAY_CHECKED) $bDarkMode = True EndIf $iLVBgColor = $bDarkMode ? 0xD8D8D8 : 0xFFFFFF DarkMode($hGUI, $bDarkMode) DarkMode($hMenu_Sys, $bDarkMode) _GUICtrlListView_SetBkColor($hLV, $bDarkMode ? BitXOR($iLVBgColor, 0xFFFFFF) : $iLVBgColor) _WinAPI_SetWindowTheme_unr($hLV, "", "") DllCall('uxtheme.dll', 'none', 136) ;FlushMenuTheme DllCall('uxtheme.dll', 'none', 104) ;RefreshImmersiveColorPolicyState CreateIcons() _WinAPI_InvalidateRect($hGUI, 0, 0) _WinAPI_UpdateWindow($hGUI) Case $iTrayAbout About() Case $iTrayExit _Exit() EndSwitch Until False Func CreateIcons() If $hBMP_Restart Then _WinAPI_DeleteObject($hBMP_Restart) If $hBMP_About Then _WinAPI_DeleteObject($hBMP_About) If $hBMP_Exit Then _WinAPI_DeleteObject($hBMP_Exit) If $hBMP_Check Then _WinAPI_DeleteObject($hBMP_Check) If $hBMP_Rect Then _WinAPI_DeleteObject($hBMP_Rect) If $bDarkMode Then $hTmp = _GDIPlus_BitmapCreateFromMemory(_Restart_Pic()) $hBMP_Restart = _GDIPlus_CreateNegativeImage($hTmp, True) _GDIPlus_ImageDispose($hTmp) $hTmp = _GDIPlus_BitmapCreateFromMemory(_Exit_Pic()) $hBMP_Exit = _GDIPlus_CreateNegativeImage($hTmp, True) _GDIPlus_ImageDispose($hTmp) $hTmp = _GDIPlus_BitmapCreateFromMemory(_Check_Pic()) $hBMP_Check = _GDIPlus_CreateNegativeImage($hTmp, True) _GDIPlus_ImageDispose($hTmp) $hTmp = _GDIPlus_BitmapCreateFromMemory(_Rect_Pic()) $hBMP_Rect = _GDIPlus_CreateNegativeImage($hTmp, True) _GDIPlus_ImageDispose($hTmp) Else $hBMP_Restart = _GDIPlus_BitmapCreateFromMemory(_Restart_Pic(), True) $hBMP_About = _GDIPlus_BitmapCreateFromMemory(_About_Pic(), True) $hBMP_Exit = _GDIPlus_BitmapCreateFromMemory(_Exit_Pic(), True) $hBMP_Check = _GDIPlus_BitmapCreateFromMemory(_Check_Pic(), True) $hBMP_Rect = _GDIPlus_BitmapCreateFromMemory(_Rect_Pic(), True) EndIf _GUICtrlMenu_SetItemBitmaps($hMenu_Tray, 0, $hBMP_Restart, $hBMP_Restart) _GUICtrlMenu_SetItemBitmaps($hMenu_Tray, 1, $hBMP_Check, $hBMP_Rect) _GUICtrlMenu_SetItemBitmaps($hMenu_Tray, 2, $hBMP_Check, $hBMP_Rect) _GUICtrlMenu_SetItemBitmaps($hMenu_Tray, 4, $hBMP_About, $hBMP_About) _GUICtrlMenu_SetItemBitmaps($hMenu_Tray, 5, $hBMP_Exit, $hBMP_Exit) EndFunc ;==>CreateIcons Func PosGUI() ;~ $aWinPos = _WinAPI_FindMyIconPosInTaskbar("Toolbar Desktop.exe - a simple toolbar menu app for Windows 11 to access desktop icons faster") $aWinPos = _WinAPI_FindMyIconPosInTaskbar("Toolbar Desktop.exe") Local $tmpW = $iW_def, $tmpH = $iH_def If $bManualResized Then Local $aWin = WinGetPos($hGUI) $iW_def = $aWin[2] * $g_iDPI_ratio2 $iH_def = $aWin[3] * $g_iDPI_ratio2 EndIf If @error Or Not UBound($aWinPos) Then ConsoleWrite("Error getting icon pos in taskbar - " & @error & @CRLF) $px = MouseGetPos(0) - $iW_def * $g_iDPI_ratio1 / 2 $py = MouseGetPos(1) - $iH_def * $g_iDPI_ratio1 / 2 $px = $px < $iMonitorX ? $iMonitorX : $px $px = $px + $iW_def * $g_iDPI_ratio1 > $iMonitorX + $iMonitorW ? $iMonitorX + $iMonitorW - $iW_def * $g_iDPI_ratio1 : $px $py = $py < $iMonitorY ? $iMonitorY : $py $py = $py + $iH_def * $g_iDPI_ratio1 > $iMonitorY + $iMonitorH ? $iMonitorX + $iMonitorH - $iH_def * $g_iDPI_ratio1 : $py WinMove($hGUI, "", $px, $py, $iW_def * $g_iDPI_ratio1, $iH_def * $g_iDPI_ratio1) Else If $aWinPos[0] >= $iMonitorX + $iMonitorW And $aWinPos[1] < $iMonitorY + $iMonitorH Then ;Taskbar on the right side ConsoleWrite("Taskbar right" & @CRLF) $px = $aWinPos[0] - $iW_def * $g_iDPI_ratio1 - 1 $py = $aWinPos[1] + $aWinPos[3] - $iH_def * $g_iDPI_ratio1 / 2 $py = $py < $iMonitorY ? $iMonitorY : $py $py = $py + $iH_def * $g_iDPI_ratio1 > $iMonitorY + $iMonitorH ? $py + $iH_def * $g_iDPI_ratio1 - ($py + $iH_def * $g_iDPI_ratio1 - $iMonitorY + $iMonitorH) : $py ElseIf $aWinPos[0] < $iMonitorX And $aWinPos[1] < $iMonitorY + $iMonitorH Then ;Taskbar on the left side ConsoleWrite("Taskbar left" & @CRLF) $px = $aWinPos[0] + $aWinPos[2] + 1 $py = $aWinPos[1] + $aWinPos[3] - $iH_def * $g_iDPI_ratio1 / 2 $py = $py < $iMonitorY ? $iMonitorY : $py $py = $py + $iH_def * $g_iDPI_ratio1 > $iMonitorY + $iMonitorH ? $py + $iH_def * $g_iDPI_ratio1 - ($py + $iH_def * $g_iDPI_ratio1 - $iMonitorY + $iMonitorH) : $py ElseIf $aWinPos[1] < $iMonitorY And $aWinPos[0] > $iMonitorX Then ;Taskbar at top ConsoleWrite("Taskbar top" & @CRLF) $px = $aWinPos[0] - ($iW_def * $g_iDPI_ratio1 - $aWinPos[2]) / 2 $px = $px < $iMonitorX ? $iMonitorX : $px $tx = $iMonitorX + $iMonitorW - $px - $iW_def * $g_iDPI_ratio1 $py = $aWinPos[1] + $aWinPos[3] + 1 Else ;Taskbar at bottom ConsoleWrite("Taskbar bottom" & @CRLF) $px = $aWinPos[0] - ($iW_def * $g_iDPI_ratio1 - $aWinPos[2]) / 2 $px = $px < $iMonitorX ? $iMonitorX : $px $tx = $iMonitorX + $iMonitorW - $px - $iW_def * $g_iDPI_ratio1 If $tx < 0 Then $px += $tx $py = $aWinPos[1] - $iH_def * $g_iDPI_ratio1 - 1 EndIf WinMove($hGUI, "", $px, $py, $iW_def * $g_iDPI_ratio1, $iH_def * $g_iDPI_ratio1) EndIf If $bManualResized Then $iW_def = $tmpW $iH_def = $tmpH EndIf EndFunc ;==>PosGUI Func AdjustLVIcons() _GUICtrlListView_BeginUpdate($hLV) Local $i If $hLV_Font Then _WinAPI_DeleteObject($hLV_Font) $hLV_Font = _GUICtrlListView_SetItemHeightByFont($hLV, $fIconSize, $fLVFontSize) _GUIImageList_SetIconSize($hImageList, $fIconSize, $fIconSize) If $bSorted Then _ArraySort($aIconAssignment, 0, 0, 0, 0) For $i = 0 To UBound($aIconAssignment) - 1 _GUIImageList_ReplaceIcon($hImageList, -1, $aIconAssignment[$i][2]) Next _GUICtrlListView_SetImageList($hLV, $hImageList, 1) ;~ _GUICtrlListView_SetColumnWidth($hLV, 0, $LVSCW_AUTOSIZE) _GUICtrlListView_SetColumnWidth($hLV, 0, $iW_def * $g_iDPI_ratio1 / 3.5) _GUICtrlListView_EndUpdate($hLV) EndFunc ;==>AdjustLVIcons Func Max($a, $b) Return $a > $b ? $a : $b EndFunc ;==>Max Func Min($a, $b) Return $a < $b ? $a : $b EndFunc ;==>Min Func AutoStartReg($bSet) Switch $bSet Case True If RegWrite("HKCU\Software\Microsoft\Windows\CurrentVersion\Run", "Toolbar Desktop", "REG_SZ", '"' & @ScriptDir & '\Toolbar Desktop.exe"') Then MsgBox($MB_ICONINFORMATION, "Information", "Autostart entry properly set to the registry", 10, $hGUI) Else MsgBox($MB_ICONERROR, "ERROR", "Unable to set autostart entry to the registry!", 30, $hGUI) EndIf Case Else If RegDelete("HKCU\Software\Microsoft\Windows\CurrentVersion\Run", "Toolbar Desktop") Then MsgBox($MB_ICONINFORMATION, "Information", "Autostart entry properly removed from the registry", 10, $hGUI) Else MsgBox($MB_ICONERROR, "ERROR", "Unable to remove autostart entry from the registry!", 30, $hGUI) EndIf EndSwitch EndFunc ;==>AutoStartReg Func About() AutoItSetOption("GUIOnEventMode", 1) If @AutoItX64 = 0 Then _SIDStartup() _SIDOpen($binSID) EndIf $bExit = False TraySetState($TRAY_ICONSTATE_HIDE) GUISetState(@SW_MINIMIZE, $hGUI) GUISetState(@SW_HIDE, $hGUI) GDIPlus_About() If @AutoItX64 = 0 Then _SIDStop() _SIDClose() _SIDShutdown() EndIf TraySetState($TRAY_ICONSTATE_SHOW) GUISetState(@SW_SHOWMINIMIZED, $hGUI) AutoItSetOption("GUIOnEventMode", 0) EndFunc ;==>About Func GDIPlus_About() Local Const $iW = 800, $iH = Int($iW * 9 / 16), $iWh = $iW / 2, $iHh = $iH / 2 Local Const $_t = 1 / 60 Local Const $hGUI_About = GUICreate($sTitle, $iW, $iH, -1, -1, -1, BitOR($WS_EX_APPWINDOW, $WS_EX_TOOLWINDOW)) GUISetState(@SW_SHOW, $hGUI_About) If $bDarkMode Then DarkMode($hGUI_About) ;create canvas elements Local Const $hDC = _WinAPI_GetDC($hGUI_About) Local Const $hHBITMAP = _WinAPI_CreateCompatibleBitmap($hDC, $iW, $iH) Local Const $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC) Local Const $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hHBITMAP) Local Const $hCanvas = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer) _GDIPlus_GraphicsSetSmoothingMode($hCanvas, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsSetPixelOffsetMode($hCanvas, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) ;~ _GDIPlus_GraphicsSetTextRenderingHint(_GDIPlus_GraphicsSetTextRenderingHint, $GDIP_TEXTRENDERINGHINTANTIALIASGRIDFIT) Local Const $fTxtHeight = 3.0 * $iH Local $hBrush_Clr = _GDIPlus_BrushCreateSolid(0xF0303030), _ $hBrush_FPS = _GDIPlus_BrushCreateSolid(0xF0808080), _ $hFormat_FPS = _GDIPlus_StringFormatCreate(), _ $hFamily_FPS = _GDIPlus_FontFamilyCreate("Arial"), _ $hFont_FPS = _GDIPlus_FontCreate($hFamily_FPS, 8), _ $tLayout_FPS = _GDIPlus_RectFCreate(0, 0, 60, 16), _ $hBrush_anim = _GDIPlus_BrushCreateSolid(0xF0C0C0C0), _ $hPen_anim = _GDIPlus_PenCreate(0xF0101010, 1), _ $tRectF_col = _GDIPlus_RectFCreate(0, 0, $iW, $iHh), _ $hBrush_txt = _GDIPlus_LineBrushCreateFromRectWithAngle($tRectF_col, 0xC07D1B7E, 0xCFFCDFFF, 45, True, 1), _ $tRectF_txt = _GDIPlus_RectFCreate(0, 0, $iW, $fTxtHeight), _ $hPen_txt = _GDIPlus_PenCreate(0x80000000, 2), _ $hFormat_txt = _GDIPlus_StringFormatCreate(), _ $hFamily_txt = _GDIPlus_FontFamilyCreate("Impact"), _ $hPath_txt = _GDIPlus_PathCreate(), _ $sTxt = $sTitle & @CRLF & _ $sVer & @CRLF & @CRLF & _ "Coded by" & @CRLF & @CRLF & _ "UEZ" & @CRLF & @CRLF & @CRLF & _ "Thanks to:" & @CRLF & _ "argumentum" & @CRLF & _ "BugFix" & @CRLF & _ "InnI" & @CRLF & _ "junkew" & @CRLF & _ "KaFu" & @CRLF & _ "Kanashius" & @CRLF & _ "Soren" & @CRLF & _ "Mombas" & @CRLF & _ "Yashied" & @CRLF & _ "wakillon" & @CRLF & _ "Ward" & @CRLF & @CRLF & @CRLF & _ "Greetings to all Autoit'ers" & @CRLF & _ "around the world." _GDIPlus_StringFormatSetAlign($hFormat_txt, 1) _GDIPlus_StringFormatSetLineAlign($hFormat_txt, 1) Local $p, $q, $z, $x, $s, $i, $t = 0, $f1, $px, $py $iFPS = 0 GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit_About", $hGUI_About) AdlibRegister("CalcFPS", 1000) $tRectF_txt.y = $iH + $iH / 10 Local $tFFTData = DllStructCreate("float data[1024]"), $pFFTData = DllStructGetPtr($tFFTData), $sum Do DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hCanvas, "handle", $hBrush_Clr, "float", 0, "float", 0, "float", $iW, "float", $iH) ;erase canvas background DllCall($__g_hGDIPDll, "int", "GdipAddPathString", "handle", $hPath_txt, "wstr", $sTxt, "int", -1, "handle", $hFamily_txt, "int", 0, "float", $iH / 10, "struct*", $tRectF_txt, "handle", $hFormat_txt) ;~ _SIDGetFFTData($tFFTData) ;~ $sum = 0 ;~ For $i = 1 To 64 ;~ $sum += $tFFTData.data(($i)) * $tFFTData.data(($i)) ;~ Next ;~ $sum = 0x30 + Log(Sqrt($sum)) / Log(10) * 10 ;~ _GDIPlus_GraphicsClear($hCanvas, BitOR(0xFF000000, BitShift($sum, -16), BitShift($sum, -8), BitShift($sum, 0))) For $i = 0 To 1919 Step 15 $p = $i * Cos($t / 2) / 40 $q = $i / 628 $f1 = Sin($q) $z = 2.4 + Cos($p) * $f1 $x = Sin($p) * $f1 $s = 49 / $z / $z $f1 = 1 / $z $px = $iWh + $f1 * $x * $iWh $py = $iHh + Cos($q) * $iWh * $f1 DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hCanvas, "handle", $hBrush_anim, "float", $px, "float", $py, "float", $s, "float", $s) ;~ DllCall($__g_hGDIPDll, "int", "GdipDrawEllipse", "handle", $hCanvas, "handle", $hPen_anim, "float", $px, "float", $py, "float", $s, "float", $s) Next DllCall($__g_hGDIPDll, "int", "GdipFillPath", "handle", $hCanvas, "handle", $hBrush_txt, "handle", $hPath_txt) DllCall($__g_hGDIPDll, "int", "GdipDrawPath", "handle", $hCanvas, "handle", $hPen_txt, "handle", $hPath_txt) DllCall($__g_hGDIPDll, "int", "GdipResetPath", "handle", $hPath_txt) $tRectF_txt.y -= 1 $tRectF_txt.y = ($tRectF_txt.y < -$iH / 10 - $fTxtHeight) ? ($iH + $iH / 10) : ($tRectF_txt.y) $t += $_t _GDIPlus_GraphicsDrawStringEx($hCanvas, "FPS: " & $iShowFPS, $hFont_FPS, $tLayout_FPS, $hFormat_FPS, $hBrush_FPS) _WinAPI_BitBlt($hDC, 0, 0, $iW, $iH, $hDC_backbuffer, 0, 0, $SRCCOPY) $iFPS += 1 If $bExit Then ExitLoop Until Not Sleep(10) AdlibUnRegister("CalcFPS") ;release resources _GDIPlus_PathDispose($hPath_txt) _GDIPlus_PenDispose($hPen_txt) _GDIPlus_PenDispose($hPen_anim) _GDIPlus_FontDispose($hFont_FPS) _GDIPlus_FontFamilyDispose($hFamily_FPS) _GDIPlus_FontFamilyDispose($hFamily_txt) _GDIPlus_StringFormatDispose($hFormat_FPS) _GDIPlus_StringFormatDispose($hFormat_txt) _GDIPlus_BrushDispose($hBrush_anim) _GDIPlus_BrushDispose($hBrush_Clr) _GDIPlus_BrushDispose($hBrush_FPS) _GDIPlus_GraphicsDispose($hCanvas) _WinAPI_SelectObject($hDC_backbuffer, $DC_obj) _WinAPI_DeleteDC($hDC_backbuffer) _WinAPI_DeleteObject($hHBITMAP) _WinAPI_ReleaseDC($hGUI_About, $hDC) GUIDelete($hGUI_About) EndFunc ;==>GDIPlus_About Func _Exit_About() $bExit = True EndFunc ;==>_Exit_About Func CalcFPS() ;display FPS $iShowFPS = $iFPS $iFPS = 0 EndFunc ;==>CalcFPS Func ReadDesktopIcons() Local $aFileList1 = _FileListToArray(@DesktopDir, "*", $FLTA_FILESFOLDERS, True) Local $aFileList2 = _FileListToArray(@DesktopCommonDir, "*", $FLTA_FILESFOLDERS, True) If BitOR(IsArray($aFileList1), IsArray($aFileList2)) = 0 Then Return SetError(1, 0, 0) Local $i, $j, $aFileList[$aFileList1[0] + $aFileList2[0] + 1], $c = 1 For $i = 1 To $aFileList1[0] If StringRight($aFileList1[$i], 4) <> ".ini" Then $aFileList[$c] = $aFileList1[$i] $c += 1 EndIf Next For $j = 1 To $aFileList2[0] If StringRight($aFileList2[$j], 4) <> ".ini" Then $aFileList[$c] = $aFileList2[$j] $c += 1 EndIf Next $aFileList[0] = $c - 1 ReDim $aFileList[$c] Return $aFileList EndFunc ;==>ReadDesktopIcons Func _ScriptRestart($fExit = 1) ;thanks to Yashied Local $pid If Not $__Restart Then If @Compiled Then $pid = Run(@ScriptFullPath & " " & $CmdLineRaw, @ScriptDir, Default, 1) Else $pid = Run(@AutoItExe & ' "' & @ScriptFullPath & '" ' & $CmdLineRaw, @ScriptDir, Default, 1) EndIf If @error Then Return SetError(@error, 0, 0) EndIf StdinWrite($pid, @AutoItPID) EndIf $__Restart = 1 If $fExit Then Sleep(50) Exit EndIf Return 1 EndFunc ;==>_ScriptRestart Func _GUICtrlMenu_CreateBitmap($file, $iIndex = 0, $iX = 16, $iY = 16) ;thanks to Yashied If FileExists($file) Then Local $aRet, $hIcon, $hBitmap Local $hDC, $hBackDC, $hBackSv $aRet = DllCall("shell32", "long", "ExtractAssociatedIcon", "int", 0, "str", $file, "word*", $iIndex) If @error Then Return SetError(@error, @extended, 0) $hIcon = $aRet[0] $hDC = _WinAPI_GetDC(0) ;thanks to Yashied $hBackDC = _WinAPI_CreateCompatibleDC($hDC) $hBitmap = _WinAPI_CreateSolidBitmap(0, _WinAPI_GetSysColor($COLOR_MENU), $iX, $iY) $hBackSv = _WinAPI_SelectObject($hBackDC, $hBitmap) _WinAPI_DrawIconEx($hBackDC, 0, 0, $hIcon, $iX, $iY, 0, 0, 3) _WinAPI_DestroyIcon($hIcon) _WinAPI_SelectObject($hBackDC, $hBackSv) _WinAPI_ReleaseDC(0, $hDC) _WinAPI_DeleteDC($hBackDC) Return $hBitmap Else Return SetError(1, 0, 0) EndIf EndFunc ;==>_GUICtrlMenu_CreateBitmap Func _GDIPlus_Convert2HBitmap($hBitmap, $iColor) ; removes alpha backround using system color and converts to gdi bitmap Local $iBgColor = _WinAPI_GetSysColor($iColor) $iBgColor = 0x10000 * BitAND($iBgColor, 0xFF) + BitAND($iBgColor, 0x00FF00) + BitShift($iBgColor, 16) Local $iWidth = _GDIPlus_ImageGetWidth($hBitmap), $iHeight = _GDIPlus_ImageGetHeight($hBitmap) Local $hBitmap_new = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight) ;$aResult[6] Local $hCtx_new = _GDIPlus_ImageGetGraphicsContext($hBitmap_new) _GDIPlus_GraphicsSetPixelOffsetMode($hCtx_new, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) Local $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000 + $iBgColor) _GDIPlus_GraphicsFillRect($hCtx_new, 0, 0, $iWidth, $iHeight, $hBrush) _GDIPlus_GraphicsDrawImageRect($hCtx_new, $hBitmap, 0, 0, $iWidth, $iHeight) Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_new) _GDIPlus_BrushDispose($hBrush) _GDIPlus_BitmapDispose($hBitmap_new) _GDIPlus_GraphicsDispose($hCtx_new) Return $hHBITMAP EndFunc ;==>_GDIPlus_Convert2HBitmap Func _GDIPlus_CreateNegativeImage($hImage, $bGDI = True) Local Const $aDim = _GDIPlus_ImageGetDimension($hImage) If @error Then Return 0 Local Const $hBmp = _GDIPlus_ImageClone($hImage) Local $tBitmapData = _GDIPlus_BitmapLockBits($hBmp, 0, 0, $aDim[0], $aDim[1], BitOR($GDIP_ILMWRITE, $GDIP_ILMREAD), $GDIP_PXF32ARGB) Local $iPixel, $iRowOffset, $iY, $iX Local $iScan0 = DllStructGetData($tBitmapData, "Scan0") Local $tPixel = DllStructCreate("int[" & $aDim[0] * $aDim[1] & "];", $iScan0) For $iY = 0 To $aDim[1] - 1 $iRowOffset = $iY * $aDim[0] + 1 For $iX = 0 To $aDim[0] - 1 $iPixel = DllStructGetData($tPixel, 1, $iRowOffset + $iX) DllStructSetData($tPixel, 1, BitXOR($iPixel, 0x00FFFFFF), $iRowOffset + $iX) Next Next _GDIPlus_BitmapUnlockBits($hBmp, $tBitmapData) If $bGDI Then Local Const $hBmpGDI = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp) _GDIPlus_ImageDispose($hBmp) Return $hBmpGDI EndIf Return $hBmp EndFunc ;==>_GDIPlus_CreateNegativeImage Func _Exit() If $g_pStatusBarCallback Then _WinAPI_SetWindowLong($hStatusBar, $GWL_WNDPROC, $g_pOrigStatusBarProc) DllCallbackFree($g_pStatusBarCallback) EndIf $binSID = 0 For $i = 1 To $aFileList[0] _WinAPI_DestroyIcon($aFileIcons[$i]) Next _WinAPI_UnhookWindowsHookEx($hHook_Key) DllCallbackFree($iListViewCallback) GUIRegisterMsg($WM_SIZE, "") GUIRegisterMsg($WM_EXITSIZEMOVE, "") GUIRegisterMsg($WM_NOTIFY, "") GUIRegisterMsg($WM_COMMAND, "") GUIRegisterMsg($WM_SYSCOMMAND, "") GUIRegisterMsg($WM_DPICHANGED, "") _WinAPI_DeleteObject($hLV_Font) _WinAPI_DeleteObject($hBMP_Shield) _WinAPI_DeleteObject($hBMP_Sort) _WinAPI_DeleteObject($hBMP_OpenFolder) _WinAPI_DeleteObject($hBMP_Restart) _WinAPI_DeleteObject($hBMP_Rect) _WinAPI_DeleteObject($hBMP_Check) _WinAPI_DeleteObject($hBMP_About) _WinAPI_DeleteObject($hBMP_Exit) _GUIImageList_Destroy($hImageList) GUIDelete($hGUI) _GDIPlus_Shutdown() DllClose($_KERNEL32DLL) Exit EndFunc ;==>_Exit Func _GUICtrlListView_SetItemHeightByFont(ByRef $hListView, $iHeight, $fFontSize) ; Get font of ListView control ; Copied from _GUICtrlGetFont example by KaFu ; See https://www.autoitscript.com/forum/index.php?showtopic=124526 Local $hDC = _WinAPI_GetDC($hListView), $hFont = _SendMessage($hListView, $WM_GETFONT) Local $tagLOGFONT2 = "long lfHeight;long lfWidth;long lfEscapement;long lfOrientation;long lfWeight;byte lfItalic;byte lfUnderline;byte lfStrikeOut;byte lfCharSet;byte lfOutPrecision;byte lfClipPrecision;byte lfQuality;byte lfPitchAndFamily;wchar lfFaceName[32]" Local $hObject = _WinAPI_SelectObject($hDC, $hFont), $lvLOGFONT = DllStructCreate($tagLOGFONT2) _WinAPI_GetObject($hFont, DllStructGetSize($lvLOGFONT), DllStructGetPtr($lvLOGFONT)) $lvLOGFONT.lfQuality = $CLEARTYPE_QUALITY $lvLOGFONT.lfOutPrecision = $OUT_DEFAULT_PRECIS $lvLOGFONT.lfWeight = $FW_MEDIUM $lvLOGFONT.lfHeight = $fFontSize Local $hLVfont = _WinAPI_CreateFontIndirect($lvLOGFONT) ; Original ListView font _WinAPI_SelectObject($hDC, $hObject) _WinAPI_ReleaseDC($hListView, $hDC) _WinAPI_DeleteObject($hFont) ; Set height of ListView items by applying text font with suitable height $hFont = _WinAPI_CreateFont($iHeight, 0, 0, 0, $FW_MEDIUM, False, False, False, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $CLEARTYPE_QUALITY, 0, "Segoe UI") _WinAPI_SetFont($hListView, $hFont) _WinAPI_DeleteObject($hFont) ; Restore font of Header control Local $hHeader = _GUICtrlListView_GetHeader($hListView) If $hHeader Then _WinAPI_SetFont($hHeader, $hLVfont) ; Return original ListView font Return $hLVfont EndFunc ;==>_GUICtrlListView_SetItemHeightByFont Func WM_DPICHANGED($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam Local $iDPI = _WinAPI_LoWord($wParam) ConsoleWrite("DPI change triggered! DPI: " & $iDPI & @CRLF) $g_iDPI_ratio1 = $iDPI / $iDPI_def $g_iDPI_ratio2 = $g_iDPI_ratio1 ^ - 1 $fIconSize = 16 * $g_iDPI_ratio1 $fLVFontSize = 15.5 * $g_iDPI_ratio1 AdjustLVIcons() PosGUI() Return 1 EndFunc ;==>WM_DPICHANGED Func _StatusBar_WndProc($hWnd, $iMsg, $wParam, $lParam) If $iMsg = $WM_PAINT Or $iMsg = $WM_ERASEBKGND Then If $iMsg = $WM_ERASEBKGND Then Return 1 ; Verhindere Flackern Local $tPS = DllStructCreate($tagPAINTSTRUCT) Local $hDC = _WinAPI_BeginPaint($hWnd, $tPS) Local $tRect = _WinAPI_GetClientRect($hWnd) ; Hintergrund zeichnen Local $hBrush = _WinAPI_CreateSolidBrush($bDarkMode ? 0x1B1B1B : _WinAPI_GetSysColor($COLOR_BTNFACE)) _WinAPI_FillRect($hDC, $tRect, $hBrush) _WinAPI_DeleteObject($hBrush) ; Font der Statusbar verwenden Local $hFont = _SendMessage($hWnd, $WM_GETFONT, 0, 0) Local $hOldFont = _WinAPI_SelectObject($hDC, $hFont) ; Text zeichnen _WinAPI_SetTextColor($hDC, $bDarkMode ? 0xFFFFFF : 0x000000) _WinAPI_SetBkMode($hDC, $TRANSPARENT) ; Padding für Text $tRect.Left += 5 Local $sText = _GUICtrlStatusBar_GetText($hStatusBar, 0) _WinAPI_DrawText($hDC, $sText, $tRect, BitOR($DT_SINGLELINE, $DT_VCENTER, $DT_LEFT)) ; Font wiederherstellen _WinAPI_SelectObject($hDC, $hOldFont) _WinAPI_EndPaint($hWnd, $tPS) Return 0 EndIf Return _WinAPI_CallWindowProc($g_pOrigStatusBarProc, $hWnd, $iMsg, $wParam, $lParam) EndFunc ;==>_StatusBar_WndProc Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam), $tInfo Local Static $iHot = -1, $iHotPrev = -1 Switch HWnd($tNMHDR.hWndFrom) Case $hLV Switch $tNMHDR.Code Case $NM_CLICK ToolTip("") $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) If $tInfo.Index > -1 And $tInfo.Index < UBound($aIconAssignment) Then ConsoleWrite("Shell executing " & $aIconAssignment[$tInfo.Index][1] & @CRLF) _GUICtrlListView_SetItemSelected($hLV, $tInfo.Index, False, False) ;_GUICtrlListView_SetItemFocused($hLV, $tInfo.Index, False) GUISetState(@SW_MINIMIZE, $hGUI) ConsoleWrite("PID: " & ShellExecute(@WindowsDir & "\Explorer.exe", $aIconAssignment[$tInfo.Index][1]) & @CRLF) ;~ ConsoleWrite("PID: " & ShellExecute($aIconAssignment[$tInfo.Index][1]) & @CRLF) EndIf Case $NM_RCLICK ToolTip("") $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) If $tInfo.Index > -1 And $tInfo.Index < UBound($aIconAssignment) Then _GUICtrlListView_SetItemSelected($hLV, $tInfo.Index, False, False) $sRunAsAdmin = $aIconAssignment[$tInfo.Index][1] EndIf _GUICtrlMenu_TrackPopupMenu($hQMenu_LV, $hGUI) Case $NM_KILLFOCUS ToolTip("") GUISetState(@SW_MINIMIZE, $hGUI) Case $NM_CUSTOMDRAW Local $tNMLVCUSTOMDRAW = DllStructCreate($tagNMLVCUSTOMDRAW, $lParam) Local $dwDrawStage = $tNMLVCUSTOMDRAW.dwDrawStage Local $dwItemSpec = $tNMLVCUSTOMDRAW.dwItemSpec Switch $dwDrawStage Case $CDDS_PREPAINT Local $hDC = $tNMLVCUSTOMDRAW.HDC Local $hPen = _WinAPI_CreatePen($PS_SOLID, 1, $bDarkMode ? BitXOR($iLVBgColor, 0xFFFFFF) : $iLVBgColor) Local $o_Orig = _WinAPI_SelectObject($hDC, $hPen) _WinAPI_DrawLine($hDC, 0, $tNMLVCUSTOMDRAW.Top - 1, $tNMLVCUSTOMDRAW.Right, $tNMLVCUSTOMDRAW.Top - 1) ; horizontal left _WinAPI_SelectObject($hDC, $o_Orig) _WinAPI_DeleteObject($hPen) Return BitOR($CDRF_NOTIFYPOSTPAINT, $CDRF_NOTIFYSUBITEMDRAW) Case $CDDS_ITEMPREPAINT If $dwItemSpec = $iHot Then $tNMLVCUSTOMDRAW.ClrText = $bDarkMode ? BitXOR($iLVTxtColor, 0xFFFFFF) : $iLVTxtColor $tNMLVCUSTOMDRAW.ClrTextBk = $bDarkMode ? 0xFFD700 : 0x98FF98 ;hottrack color Else ; Other rows $tNMLVCUSTOMDRAW.ClrText = $bDarkMode ? BitXOR($iLVTxtColor, 0xFFFFFF) : $iLVTxtColor $tNMLVCUSTOMDRAW.ClrTextBk = $bDarkMode ? BitXOR($iLVBgColor, 0xFFFFFF) : $iLVBgColor EndIf _WinAPI_SelectObject($tNMLVCUSTOMDRAW.hdc, $hLV_Font) Return $CDRF_NEWFONT EndSwitch Case $LVN_HOTTRACK If WinActive($hGUI) Then $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) $iHot = $tInfo.Item If $iHot <> $iHotPrev Then If $iHot <> -1 Then _GUICtrlListView_RedrawItems($hLV, $iHot, $iHot) If $iHotPrev <> -1 Then _GUICtrlListView_RedrawItems($hLV, $iHotPrev, $iHotPrev) If $iHot <> $iHotPrev And $iHot <> -1 Then $iHotPrev = $iHot EndIf ;check if listview text is shortened with "..." and display listview text in tooltip Local $sTxt = _GUICtrlListView_GetItemTextString($hLV, _GUICtrlListView_GetHotItem($hLV)) Local $hDC = _WinAPI_GetDC($hLV) Local $hFont = _SendMessage($hLV, $WM_GETFONT, 0, 0) Local $hFont_old = _WinAPI_SelectObject($hDC, $hFont) Local $tSize = _WinAPI_GetTextExtentPoint32($hDC, $sTxt) If Not @error Then Local $iTextWidth = $tSize.x * $g_iDPI_ratio1 Local $iColumnWidth = _GUICtrlListView_GetColumnWidth($hLV, $iHot) If $iTextWidth > $iColumnWidth Then $iColumnWidth -= 3 * _WinAPI_GetTextExtentPoint32($hDC, ".") If $iTextWidth >= $iColumnWidth Then ToolTip($sTxt, MouseGetPos(0) + 10, MouseGetPos(1) - 20, "", 0, 6) Else ToolTip("") EndIf Else ToolTip("") EndIf EndIf _WinAPI_SelectObject($hDC, $hFont_old) _WinAPI_ReleaseDC($hLV, $hDC) Return 0 EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $iW = _WinAPI_LoWord($lParam), $iH = _WinAPI_HiWord($lParam), $iH_SB = _GUICtrlStatusBar_GetHeight($hStatusBar) ControlMove($hGUI, "", $iStatusBar, 0, $iH - $iH_SB, $iW, $iH_SB) ControlMove($hGUI, "", $iLV, 0, 0, $iW, $iH - $iH_SB - 1) Return $GUI_RUNDEFMSG EndFunc ;==>WM_SIZE Func WM_EXITSIZEMOVE($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam $bManualResized = True Return $GUI_RUNDEFMSG EndFunc ;==>WM_EXITSIZEMOVE Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam Switch $wParam Case $idRunAsAdmin ConsoleWrite("Shell executing as Administrator" & $sRunAsAdmin & @CRLF) ConsoleWrite("PID: " & ShellExecute($sRunAsAdmin, "", @DesktopDir, "runas") & @CRLF) Case $idSort Static $a[1] = [0], $iDir = 1 $a[0] = ($iDir = 1 ? 0 : 1) _ArraySort($aIconAssignment, $a[0], 0, 0, 1) Local $i _GUICtrlListView_BeginUpdate($hLV) For $i = 0 To UBound($aIconAssignment) - 1 _GUICtrlListView_SetItemImage($hLV, $i, $aIconAssignment[$i][0]) _GUICtrlListView_SetItemText($hLV, $i, StringRegExpReplace($aIconAssignment[$i][1], ".+\\(.+)\..+", "$1")) Next _GUICtrlListView_EndUpdate($hLV) $iDir *= -1 $bSorted = 1 Case $idOpenFL Local $sFullPath = $oShell.CreateShortcut($sRunAsAdmin).TargetPath If $sFullPath = "" Then Return 0 Local $sFolder = StringRegExpReplace($sFullPath, "(.+\\).*", "$1") If $sFolder Then ShellExecute("Explorer.exe", "/e, /n, " & $sFolder, $sFolder) Return 1 EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND Func WM_SYSCOMMAND($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam Switch BitAND($wParam, 0x0000FFFF) Case $idAbout GUICtrlSendToDummy($iDummy_About) Return 0 Case $SC_RESTORE If @OSBuild > 9599 Then Local $tPos = _WinAPI_GetMousePos() Local $hMontitor = _WinAPI_MonitorFromPoint($tPos) Local $iDPI = _WinAPI_GetDpiForPrimaryMonitor($hMontitor) $g_iDPI_ratio1 = $iDPI / $iDPI_def $g_iDPI_ratio2 = $g_iDPI_ratio1 ^ - 1 $fIconSize = 16 * $g_iDPI_ratio1 $fLVFontSize = 15.5 * $g_iDPI_ratio1 EndIf WinSetTrans($hGUI, "", 0) GUISetState(@SW_RESTORE, $hGUI) If $aFileList[0] Then AdjustLVIcons() PosGUI() WinSetTrans($hGUI, "", 255) Else GUICtrlSendToDummy($iDummy_Error) EndIf Return 0 Case $SC_MINIMIZE ToolTip("") EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_SYSCOMMAND Func LVKeyCallback($nCode, $wParam, $lParam) If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook_Key, $nCode, $wParam, $lParam) Switch $wParam Case $WM_KEYDOWN, $WM_SYSKEYDOWN ;prevent keyboard access in listview Local $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam) Switch $tKEYHOOKS.vkCode Case $VK_LEFT, $VK_Right, $VK_UP, $VK_DOWN If WinActive($hGUI) Then Return 1 EndSwitch EndSwitch Return _WinAPI_CallNextHookEx($hHook_Key, $nCode, $wParam, $lParam) EndFunc ;==>LVKeyCallback Func ErrFunc() Local Static $iEventError = 0 $iEventError += 1 ; Use to check when a COM Error occurs Local Const $sText_Error = _ (@ScriptName & " : ==> COM Error intercepted !" & @CRLF & _ "Error count is: " & @TAB & $iEventError & @CRLF & _ "Number is: " & @TAB & @TAB & "0x" & Hex($oMyError.number) & @CRLF & _ "WinDescription:" & @TAB & @TAB & $oMyError.windescription & _ "Description is: " & @TAB & $oMyError.description & @CRLF & _ "Source is: " & @TAB & @TAB & $oMyError.source & @CRLF & _ "ScriptLine is: " & @TAB & @TAB & $oMyError.scriptline & @CRLF & _ "RetCode is: " & @TAB & @TAB & "0x" & Hex($oMyError.retcode) & @CRLF & @CRLF) ConsoleWrite($sText_Error) EndFunc ;==>ErrFunc Func _GDIPlus_MeasureString($sString, $sFont = "Arial", $fSize = 12, $iStyle = 0, $bRound = True) Local $aSize[2] Local Const $hFamily = _GDIPlus_FontFamilyCreate($sFont) If Not $hFamily Then Return SetError(1, 0, $aSize) Local Const $hFormat = _GDIPlus_StringFormatCreate() Local Const $hFont = _GDIPlus_FontCreate($hFamily, $fSize, $iStyle) Local Const $tLayout = _GDIPlus_RectFCreate(0, 0, 0, 0) Local Const $hGraphic = _GDIPlus_GraphicsCreateFromHWND(0) Local $aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $sString, $hFont, $tLayout, $hFormat) $aSize[0] = $bRound ? Round($aInfo[0].Width, 0) : $aInfo[0].Width $aSize[1] = $bRound ? Round($aInfo[0].Height, 0) : $aInfo[0].Height _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_GraphicsDispose($hGraphic) Return $aSize EndFunc ;==>_GDIPlus_MeasureString ;by InnI - https://www.autoitscript.com/forum/topic/200541-solved-taskbar-icons-coordinates/?do=findComment&comment=1521328 Func _WinAPI_FindMyIconPosInTaskbar($sFileDescription) ; Search taskbars Local $ahWnd = WinList("[REGEXPCLASS:Shell_(Secondary)?TrayWnd]") ; Search controls Local $ahCtrl[$ahWnd[0][0]][2] For $i = 1 To $ahWnd[0][0] $ahCtrl[$i - 1][0] = ControlGetHandle($ahWnd[$i][1], "", "MSTaskListWClass1") $ahCtrl[$i - 1][1] = WinGetPos($ahWnd[$i][1]) Next ; Get UIAutomation object Local $oUIAutomation = ObjCreateInterface($sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation), $oElement, $oCondition, $oElementArray, $oButton If Not IsObj($oUIAutomation) Then Return SetError(1, 0, 0) ;Exit ConsoleWrite("Error create UIA object" & @CRLF) ; Create 2D array of buttons [name,left,top,right,bottom] Local $aBtnInfo[4], $pElement, $pCondition, $pElementArray, $iButtons, $vValue, $tPos, $hMOnitor, $aMonitorPos $tPos = _WinAPI_GetMousePos() $hMOnitor = _WinAPI_MonitorFromPoint($tPos) If @error Or Not $hMOnitor Then Return SetError(2, 0, 0) $aMonitorPos = _WinAPI_GetMonitorInfo($hMOnitor) If @error Or Not $hMOnitor Then Return SetError(3, 0, 0) $iMonitorX = $aMonitorPos[1].left $iMonitorY = $aMonitorPos[1].top $iMonitorW = Abs($aMonitorPos[1].right - $aMonitorPos[1].left) $iMonitorH = Abs($aMonitorPos[1].bottom - $aMonitorPos[1].top) Local $tRect = DllStructCreate("long Left;long Top;long Right;long Bottom"), $tPOINT = DllStructCreate($tagPOINT) For $n = 0 To UBound($ahCtrl) - 1 ; Get taskbar element $oUIAutomation.ElementFromHandle($ahCtrl[$n][0], $pElement) $oElement = ObjCreateInterface($pElement, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) ; Get condition (ControlType = Button) $oUIAutomation.CreatePropertyCondition($UIA_ControlTypePropertyId, $UIA_ButtonControlTypeId, $pCondition) $oCondition = ObjCreateInterface($pCondition, $sIID_IUIAutomationPropertyCondition, $dtagIUIAutomationPropertyCondition) ; Find all buttons $oElement.FindAll($TreeScope_Children, $oCondition, $pElementArray) $oElementArray = ObjCreateInterface($pElementArray, $sIID_IUIAutomationElementArray, $dtagIUIAutomationElementArray) $oElementArray.Length($iButtons) ; Get name and position for each button For $i = 0 To $iButtons - 1 $oElementArray.GetElement($i, $pElement) $oButton = ObjCreateInterface($pElement, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) $oButton.GetCurrentPropertyValue($UIA_NamePropertyId, $vValue) $oButton.CurrentBoundingRectangle($tRect) If StringInStr($vValue, $sFileDescription) Then $aBtnInfo[0] = $tRect.Left $aBtnInfo[1] = $tRect.Top $aBtnInfo[2] = Abs($tRect.Right - $tRect.Left) $aBtnInfo[3] = Abs($tRect.Bottom - $tRect.Top) $tPOINT.x = $tRect.Left $tPOINT.y = $tRect.Top If _WinAPI_PtInRect($aMonitorPos[0], $tPOINT) Then Return $aBtnInfo EndIf Next Next Return SetError(4, 0, 0) EndFunc ;==>_WinAPI_FindMyIconPosInTaskbar Func _WinAPI_Base64Decode($sB64String) Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "") Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]") $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "") Return DllStructGetData($bBuffer, 1) EndFunc ;==>_WinAPI_Base64Decode Func _WinAPI_LZNTDecompress(ByRef $tInput, ByRef $tOutput, $iBufferSize) $tOutput = DllStructCreate("byte[" & $iBufferSize & "]") If @error Then Return SetError(1, 0, 0) Local $aRet = DllCall("ntdll.dll", "uint", "RtlDecompressBuffer", "ushort", 0x0002, "struct*", $tOutput, "ulong", $iBufferSize, "struct*", $tInput, "ulong", DllStructGetSize($tInput), "ulong*", 0) If @error Then Return SetError(2, 0, 0) If $aRet[0] Then Return SetError(3, $aRet[0], 0) Return $aRet[6] EndFunc ;==>_WinAPI_LZNTDecompress Func _WinAPI_GetDPI($hWnd = 0) $hWnd = Not $hWnd ? _WinAPI_GetDesktopWindow() : $hWnd Local Const $hDC = _WinAPI_GetDC($hWnd) If @error Then Return SetError(1, 0, 0) Local Const $iDPI = _WinAPI_GetDeviceCaps($hDC, 88) If @error Or Not $iDPI Then _WinAPI_ReleaseDC($hWnd, $hDC) Return SetError(2, 0, 0) EndIf _WinAPI_ReleaseDC($hWnd, $hDC) Return $iDPI EndFunc ;==>_WinAPI_GetDPI ;https://learn.microsoft.com/en-us/windows/win32/api/shellscalingapi/nf-shellscalingapi-getdpiformonitor Func _WinAPI_GetDpiForPrimaryMonitor($hMOnitor = 0, $dpiType = $MDT_DEFAULT) If $hMOnitor = 0 Then Local $aMonitors = _WinAPI_EnumDisplayMonitors() If @error Or Not IsArray($aMonitors) Then Return SetError(1, 0, 0) Local $i For $i = 1 To $aMonitors[0][0] If _WinAPI_GetMonitorInfo($aMonitors[$i][0])[2] = 1 Then $hMOnitor = $aMonitors[$i][0] ExitLoop EndIf Next EndIf Local $tx = DllStructCreate("int dpiX"), $tY = DllStructCreate("int dpiY") Local $aResult = DllCall("Shcore.dll", "long", "GetDpiForMonitor", "handle", $hMOnitor, "long", $dpiType, "struct*", $tx, "struct*", $tY) If @error Or Not IsArray($aResult) Then Return SetError(2, 0, 0) Return $tx.dpiX EndFunc ;==>_WinAPI_GetDpiForPrimaryMonitor Func _WinAPI_SetProcessDpiAwarenessContext($DPI_AWARENESS_CONTEXT_value) Local $aResult = DllCall("user32.dll", "bool", "SetProcessDpiAwarenessContext", @AutoItX64 ? "int64" : "int", $DPI_AWARENESS_CONTEXT_value) If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If Not $aResult[0] Then Return SetError(2, @extended, 0) Return $aResult[0] EndFunc ;==>_WinAPI_SetProcessDpiAwarenessContext Func _WinAPI_SetThreadDpiAwarenessContext($DPI_AWARENESS_CONTEXT_value) Local $aResult = DllCall("user32.dll", "uint", "SetThreadDpiAwarenessContext", @AutoItX64 ? "int64" : "int", $DPI_AWARENESS_CONTEXT_value) If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If Not $aResult[0] Then Return SetError(2, @extended, 0) Return $aResult[0] EndFunc ;==>_WinAPI_SetThreadDpiAwarenessContext Func _WinAPI_SetProcessDpiAwareness($PROCESS_DPI_AWARENESS = $DPI_AWARENESS_PER_MONITOR_AWARE) Local $aResult = DllCall("Shcore.dll", "long", "SetProcessDpiAwareness", "int", $PROCESS_DPI_AWARENESS) If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If $aResult[0] Then Return SetError(2, $aResult[0], 0) Return $aResult[0] EndFunc ;==>_WinAPI_SetProcessDpiAwareness Func _WinAPI_SetDPIAwareness($DPIAwareContext = $DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE, $iMode = 1) Switch @OSBuild Case 6000 To 9199 Local $aResult = DllCall("user32.dll", "bool", "SetProcessDPIAware") If Not $aResult[0] Then Return SetError(1, 0, 0) Case 9200 To 13999 $DPIAwareContext = ($DPIAwareContext < 0) ? 0 : ($DPIAwareContext > 2) ? 2 : $DPIAwareContext _WinAPI_SetProcessDpiAwareness($DPIAwareContext) If @error Then Return SetError(2, @error, 0) Case @OSBuild > 13999 $DPIAwareContext = ($DPIAwareContext < -5) ? -5 : ($DPIAwareContext > -1) ? -1 : $DPIAwareContext $iMode = ($iMode < 1) ? 1 : ($iMode > 2) ? 2 : $iMode Local $iResult Switch $iMode Case 1 $iResult = _WinAPI_SetProcessDpiAwarenessContext($DPIAwareContext) If Not $iResult Or @error Then Return SetError(3, 0, 0) Case 2 $iResult = _WinAPI_SetThreadDpiAwarenessContext($DPIAwareContext) If Not $iResult Or @error Then Return SetError(4, 0, 0) EndSwitch EndSwitch Local $iDPI If @OSBuild < 9200 Then $iDPI = _WinAPI_GetDPI() If @error Or Not $iDPI Then Return SetError(5, 0, 0) Else $iDPI = _WinAPI_GetDpiForPrimaryMonitor() If @error Or Not $iDPI Then Return SetError(6, 0, 0) EndIf Return $iDPI EndFunc ;==>_WinAPI_SetDPIAwareness #Region Embedded Gfx Func _Info_Pic($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Info_Pic $Info_Pic &= 'iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAYAAAA4E5OyAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3goVCzU6of+cFgAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAAQNElEQVR42t1cWZBc1Xn+/nNu3+7pZTZJow000khCywwyoxUtCGEgQgGMMYJsTlKkkspLXvKSl7zkIQ+pJAUpx5VyxS6MF2HALALHNjgCjC0kpNE28mgZ7UgWSAaNZulR9+17zv/n4S7TMxrNyJpuIXKqekbdd3TuOd/5l+9fbhPCceTIcTQ25rDtvb34sz9+GCKid3cczOVy6T/57LPeuUqr1Y7SayyzAEREABEAEMoH0fD31R0S/JSyTwSQ+AMBEcF1EwDwoes6Lw/kB59fu3rZZQB4e9sH2PjAWrz045/jj57chHg3Bw4cwl13tWL//i7V3t7GJ0+fab5woecfBgaubBKWOYJo8xCtFSlSIKLgM6JwFgJkJDw3CRIqQ4UFAkAgYMuwLGDmeAsJ1wEBz6bTqX9as3pp/8uvvKWe2vwQxwfadego2loX4qOPziabm2d5R44c//q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dYA8/z4HkF+H4JkyfVf5fWrt+UYObXtXYeTiZrkEyl4CaSUNFDiBOgaYoIxlrkB69Aq+D0Pc+HiCCVSqKmJhlKi9w0MIbCBQPjl+AViyiVir7nebxx4/p1BAArV9//sFJ6ayLhOslkDdxkCo6TgFI6fJh54iWI8g1XqvZzw7yDLYzxUSp5KHlFGRzMF1pm3zbw8kvfn6YAYPfOd37K1v7IL5XgeUUueQX4pRKs9WGtjZncjXYdCMuY76v9iuwFWwtjDPxSCSXPQ8krwvM8Sjjaf2jjfX8XJ+RWrn5A7965zS6/+75dWjkrXTdpE66rE9qFdhworcOMlap0Fq+60hD9DOM1ywxrDIwpoVQqie97ZI35Vceud+8NpScoIRvj87q1G2mwWPgD0fKmCK+31hrjGMdxHCjlxIVr0M3+jpAbVw0Knx8M6lAWli2s8eEb31jfd6w1+9jyJgB4YcsWIiKh5avuw55d72Hpinuxr+N9LF2+vg5E/6uUWqGUNlprRykHWhFAekT7E93S8hEV2aNEUEjCrLVGM/MRMbhr//73S8tX3AfXcbFj59tw9ux6L97a0uXrsW/Pr/o2bNj4SF++8Kds+d+tNSAqgZRG9P0pXySlKW87DUqiokXkh3X1qb/s6/Oc6GB37Hx79CNevfZ++vRSnzpxdI9dsXLNKmb8GwtNFmARkT5BQOEm60zwxR/APAAegHPXdSIihOD7LFpEJKOCEu07KVdt27Hj1//ypWUbdOfeX9r25feCCNjX8T4A4P8AfQxoGhUQAVAAAAAASUVORK5CYII=' Local $bString = Binary(_WinAPI_Base64Decode($Info_Pic)) If $bSaveBinary Then Local $hFile = FileOpen($sSavePath & "\Info_68x68.png", 18) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Info_Pic Func _Error_Pic($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Error_Pic $Error_Pic &= 'iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAYAAAA4E5OyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3goUEicBw0v6ewAA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G+l0HSagYZkNY1SED0lJCv0vSdOxkL1UEHPQFJz03el60RPh54pFFd1Ev+3Ei6D5q9VqO8xRmF6LmGhWmiEGc8FOHZlaboEQNayxbASHMaLIAsBLDPg+ag+g3EJuhDgOFXmHCVqJLITFR9oEu0g0Dwy8p7SshxHJHGVEaCNZ2hAEQleBtVuXCCKXD/ygpYr899gDhOM6md+mC1IPlPgGCgEmn+8kvu63BGugwtQrSfXpsdg8pTKX8at6pCgLbM6rxePxnVVV5EkfQhf9hnfpxif1Gn/1sna3ZCOJe1PvsGGFz8lOxxc/eSUDJx+Pxnz1AMpnMD7Isg+d5ZDIZKIrSoI/NJlpYYoKsvN97UStV2BhLSQQ5jgNFUZDJZMDzPMnY/eCpTE9PzzeO47wsy3JXuVzme3t7MT8/j1qtFlhsx9qKqOR00KclQSrjp2LNGldarfyeqaqKdDqNcrkMTdMcQRCy11133TcAwI2MjGBubk4pFotPXbhwYT8Ap1qt8oQDpMRqKQ7TUp+36oss9TnP83V70KqqOhzH8StXrnw+k8kcLJVKOgcAX331FTc/P5+YnJzccv78+dcLhcJVhmGgWq06dB3WcrxKMudWndSlEh90SJIEVVV5RVGQTCane3p6dvf19f371ltvLa5fv94VAeDixYvuCy+8UHz33XcP9vX1HZ2YmNg0Nzf3D57nb5YkSVgGAJGENSscy5UeSkpsURR/TqVSP1xzzTXfJBKJyUQiYRw/fvw/HezYsaMu6XI5Dtd1ucUTLZ6c67qXZUuQrq/dsWMH/h9l1MgBujE/MAAAAABJRU5ErkJggg==' Local $bString = Binary(_WinAPI_Base64Decode($Error_Pic)) If $bSaveBinary Then Local $hFile = FileOpen($sSavePath & "\Status-dialog-error-icon_68x68.png", 18) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Error_Pic Func _OK_Pic($bSaveBinary = False, $sSavePath = @ScriptDir) Local $OK_Pic $OK_Pic &= 'iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAQAAACSGls5AAAAAmJLR0QA/4ePzL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ZE7+wwyjovskjbGnqDH9LEMOaVIRqpk9Tbp7CLf4us/qqggbcPMQxM8/Pij7dY4dsAjHt80NoSxWcj9qJnrwbiZLD2M0EY4QAwV6zNebG4jTnZqNtpD9WJABTxxAiLXuHALRIWucrXeT//xJAX2Sg1ztCahqnfWbE4ohFmhHUuDDHKAg3+AShHavgQUlUiDRDKRCCzORLbZSFCwX0c4SabNGlEm8Iarab9zoqGmwJaRk0swEKQgtKk6fQh43GhkWZYrFttbQqEfb6YHkjf/Zu4M9S70siGY1TQbNRSe01k+FC6BkGo3vJ2sGKSpNF+Rp1OxvlQt/ejvsTbLXC1mpp1H2PHIGJqWktWF4KdX+qe9KHfW37HzooaqXXO7vSBCFXjW7YFEENeNKTim1+71Ydw9tJngz8jJ1UrakJSDtaHeOhTs4mrsU1MSXgNvY6JZK1Yy527RLnXEtQvbsWi3oaLf9zEKEvp6YPm7GI6FglNdcQfCK59gP7ntJYR1XGDtyDhUdNO6ZKbdJxWZCs5tq8Xd1H9Bm2/SnGVVcw6C51bTTvhMG/QQCR5O/+PStVS79e+SHJNeZNJNpKOcL3T5EnWE97OH2Od1f6orvKNzjg30P8Ct9xvUPNcU8UAAAAASUVORK5CYII=' Local $bString = Binary(_WinAPI_Base64Decode($OK_Pic)) If $bSaveBinary Then Local $hFile = FileOpen($sSavePath & "\OK-button-icon_68x68.png", 18) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_OK_Pic Func _Sort($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Sort $Sort &= 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAADAFBMVEVHcEwAAQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAgQAAQIAAAAERo4AAAAAAAAERo4AAAAAAQMAAAAABg0AAAABBQkAAAAAAAAAAAAUV6QUV6QQU6AkabwJTJYBM2sXWqkjaLsjaLv////39/fx8fH29vb09PT19fX7+/vy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op7AUS8uUMKfoV8/BAskQQ52Tkl+9AgsAbQ0LDQ0D2vv4MVjAQNtYz8JCzxhuBszQe2cuX753Hmjtvmj/0JSUUH/Pz1OmHEBxaefvrRCXgp3qFJ2W5gL2i7autrEJEBgDGQxYAADHkkynWLow7gAAAABJRU5ErkJggg==' Local $bString = _WinAPI_Base64Decode($Sort) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Sort_16x16.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Sort ;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2020-06-05 Func _OpenFolder($bSaveBinary = False, $sSavePath = @ScriptDir) Local $OpenFolder $OpenFolder &= 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAB0VBMVEV4xhJ9zAZ/1gCA1gCK1wCM2gCNylqUz1yW2jea3TOn4lSw5G+854O+y9vFz9zJz8DOzsXR2eTR2uTTz8XUqIXUxZjUz8bU0MfU8LPVmmDW0cjXxZPX0snY3N/Y7MjZ1MvZ8b3akz/asova1c3b8r7dngDdoAbdpADdpAbd2dLd9MLepAbepQze2tLe9MTfpQ/fzaDg4uPh4+Th8dri7fjjkiLj9czkuHTk06jk5Obk9s/nqADn99TorxbotDbprxTprxbprxzpsBzpsB7psSPpsiXpsy3pszLp9d7qsR7qsy3qy47q38/q7PrrsBjrtC3rtC/rukbry43stzns18Ts6+rttS3ttzntuT7t27nt7Onutzbuu0Xuu0buvEjux2ju5N7wu0Hwu0XwxmXxuzfxvDrxvUrxvlHxy3vx++Xy8/PzvDbzvTrzyXLz59Dz6Nzz8/P0wk70x1/0yGT01JP1yGb2z3L20H325tf29/X347v35ND39/f43cD47eP5+fn68en6+vj6/Pf78uD7/vf88t388t/8/Pz8/vr98+H9+vj9/vv+9+z++fD+/Pr+/fr+/fv+/vz+/v3+/v7+//7+/////Pj//v3//v7///7///8fdIuRAAAACXBIWXMAABcSAAAXEgFnn9JSAAAA6UlEQVQYV2OYBQSTQITWrJkgigGIZ87qttIz48qcNQUiMGWWDScTMysLd8fkmRCBFhUFCR4ORgaPGRNnAAWmzwCpnMXOZjwVZkZ9QWVjk9ysaW2drT2zGPpq87OijGQNffPKikuLytsYqk1DTIT4BHkFktPS05NyexkqFBP4RQ0spOMTY2PiwkpmMdRJ+hRmp6bkRAeHh0f4Vc1kaBDxtnd383IL8Pf3D/BsnsXQpWTn5OoCBq62gf1Aa82tHR0gwNk6Y9YEhslBqvra6iCgoaMW2T6BoT1U' $OpenFolder &= 'V1lGXFhYWExKXtOyBuxSFAAAdgZiD4/tcMUAAAAASUVORK5CYII=' Local $bString = _WinAPI_Base64Decode($OpenFolder) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Open-file_16x16.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_OpenFolder Func _Restart_Pic($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Restart_Pic $Restart_Pic &= 'k7kAiVBORw0KGgoAAAAADUlIRFIlAHAUARgIBgAojYkAHQ0AAALzelQAWHRSYXcgcHIAb2ZpbGUgdHkAcGUgZXhpZgAAAHja7ZdNkuQAKAyF95xijmAA/SFxHAwmom8AMMefB3Z6qrIAshc5s+qIhDAAYJAfQh+QVekA+PvXSH8hUYkAnNQ8csl5Q9IAooUrGrGdqa4AkjZd5fmi1xgAfe9P9wCjS1AAy/ka+bJ/9NMALXBWFS37IhQA7RrYvw+UawIAjiehayKZHjEAGv0SKpeQ8DkA8PCwnsvacgkA/7qE/Tjr6/sAMwx40izEl/YALfL8ro7odUMApzAfQrKhFOEA0wGZjySpaDgASoIRHIZBFRMARanyWCoC8ioATncq8GhMV/UApdE3KneLXvcAp2daypeJPAUAOd/1y/5E9poAygr9l5k1rhYAf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EwBOj4k0aD1J8wAXXnfZdB4D4QCT4zuu4jK2OwAX0EocBnAzngDh4B7hYayHMQBUCNzCYBUHuwCaGIZwCx8wGwBcDVWsL4V/HgB0FferkMZmYgDYx0WsdEl/CwAvsZzxm7jXCACdtTPjDTwO3QCV8BFPMq6NegCViLaDkTjoIwDs9bjdbVzLuADDRp/SeI+//QA4Vmhm3DdcyQC4Hexm3Bg+ZwBcs8LvQol9wgCdHj9yGz8KJQDZhoWozRTn8AAWU4Vg41gryABmBgu1EParRABzadCnuI4v+ACDUXzFM/zM/AA38KDzMndCUwAYjfLqhqUo3wAzaQ6TeHFW7QBrqVewNP3WCQANdibO7L80awCnHAHNZAS8KQCNgH8IK0cZ5giggq3A' $Restart_Pic &= 'ZwBJRU4ARK5CYII=' $Restart_Pic = _WinAPI_Base64Decode($Restart_Pic) If @error Then Return SetError(1, 0, 0) Local $tSource = DllStructCreate('byte[' & BinaryLen($Restart_Pic) & ']') DllStructSetData($tSource, 1, $Restart_Pic) Local $tDecompress _WinAPI_LZNTDecompress($tSource, $tDecompress, 5125) If @error Then Return SetError(3, 0, 0) $tSource = 0 Local Const $bString = Binary(DllStructGetData($tDecompress, 1)) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Restart_20x20.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Restart_Pic Func _Rect_Pic($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Rect_Pic $Rect_Pic &= 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9TpSItDnYQcchQXbQgKuIorVgEC6Wt0KqDyaVf0KQhSXFxFFwLDn4sVh1cnHV1cBUEwQ8QVxcnRRcp8X9JoUWMB8f9eHfvcfcOEJpVppo9k4CqWUY6ERNz+VUx8IoAQghiHD6JmXoys5iF5/i6h4+vd1Ge5X3uzxFSCiYDfCLxPNMNi3iDeHbT0jnvE4dZWVKIz4knDLog8SPXZZffOJccFnhm2Mim48RhYrHUxXIXs7KhEs8QRxRVo3wh57LCeYuzWq2z9j35C4MFbSXDdZojSGAJSaQgQkYdFVRhIUqrRoqJNO3HPPzDjj9FLplcFTByLKAGFZLjB/+D392axekpNykYA3pfbPtjFAjsAq2GbX8f23brBPA/A1dax19rAnOfpDc6WuQIGNgGLq47mrwHXO4AQ0+6ZEiO5KcpFIvA+xl9Ux4YvAX619ze2vs4fQCy1NXyDXBwCIyVKHvd49193b39e6bd3w9P7XKZpWdougAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB+cHDQ0AILRpNswAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAfElEQVQ4y+3UMQoCQQyF4U+ZO9iKeBIbD6WV19iTeBWLcdu9xGqTBVELnZlyHoRAAj8hIY/GWkXe4IJ9IeeOE6alMOBRGQOkAO4iHzH+Od0W14WR3pojbjU7XLc+Sgd2YAf+ovTl0RWYwwcw4xCuUar8CjxjrjDYHIz2egIcTx4/Oi5K+wAAAABJRU5ErkJggg==' Local $bString = _WinAPI_Base64Decode($Rect_Pic) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Rect_20x20.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Rect_Pic Func _Check_Pic($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Check_Pic $Check_Pic &= 'lbkAiVBORw0KGgoAAAAADUlIRFIlAHAUARgIBgAojYkAHQ0AAALyelQAWHRSYXcgcHIAb2ZpbGUgdHkAcGUgZXhpZgAAAHja7ZdBkuQAKAxF95xijmAASQiJ42AwEX0Agzn+fGGnpyoAK3uRM6uOSAgAAxb4I/SArEoAx9+/ZvoLiaoA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hQQCgvaeTQAQJcIBIWXMAAAsTwQAgAQCanBgABQd0AElNRQfnBw0NAAA12bTSJwAAAAERSURBVDjLALXUvUrDUBQAAODPmqV2cRDcAESk1MHBRxBcAHwDcVYRurnbAMlJVHyBgiKuAPoADn0AH8BFAKEWN59A/GtdAG4g1tSkST0QAC7cJF/OPffkADLhmArjPA5RAC/oPOEAL/FEABuDklcbogAuAIVxA70xs1vEAG1sREM3e3goAFPDSsH3qlieABQ4g3PcYa0sAFjFBbZQw0JeAHAupb41XGITAB/Yx9WoL3fCANY3sIpnnGE6ALHM6/DMG5qJAB5uhPnOKLCJAC/0cYpZ3CSwAO2hZDLBCo4CANjHYwLbS1ldACYY9+dxAAd4AMfuiHLlAoX6AJ3gFTt/7HxuADDOdCWjlX6AAFl9+In7cRo1AEr50RU4HH6BAF2sh1OjaHSTAGAr7Gi9BNbyAB/xDZYOU00wCIg/xMBLAElFTgBErkJggg==' $Check_Pic = _WinAPI_Base64Decode($Check_Pic) If @error Then Return SetError(1, 0, 0) Local $tSource = DllStructCreate('byte[' & BinaryLen($Check_Pic) & ']') DllStructSetData($tSource, 1, $Check_Pic) Local $tDecompress _WinAPI_LZNTDecompress($tSource, $tDecompress, 5012) If @error Then Return SetError(3, 0, 0) $tSource = 0 Local Const $bString = Binary(DllStructGetData($tDecompress, 1)) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\RectCheck_20x20.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Check_Pic Func _About_Pic($bSaveBinary = False, $sSavePath = @ScriptDir) Local $About $About &= 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAUCAYAAACEYr13AAAACXBIWXMAAAsSAAALEgHS3X78AAADgklEQVQ4jYWS3UssZRzHv888zzwzOy+7O7O66q4WTQnKZoGg3ih4PLYdKAyKIiE4F0I30UVXEf0JdRWEXUZ0o3ddlBJeBNFNUhmiJ1nFl12do+uk7O7Mvs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AABJRU5ErkJggg==' Local $bString = Binary(_WinAPI_Base64Decode($About)) If $bSaveBinary Then Local $hFile = FileOpen($sSavePath & "\About1_16x20.png", 18) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_About_Pic Func _Exit_Pic($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Exit $Exit &= 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsSAAALEgHS3X78AAABdElEQVQ4ja2UO0vDUBiGn/ecnLbaWmgtRbxPLi6Cm4MuOghO4uDgILg7CG4Orm7+Av+Lo5sI7oqTiChRkdqa4+Clsa3RBF/4IJzke/LmuwTiklkEmkCULfQY0CmZMCjXDzA2BIT3gBfeC+/xn9fxeyDfbExHjaf1Ttgi6Ao01PWiX6UVUGjSJybrG1DGtuQKIVIUP84OzPWfuMrwsqy7jZ3OAKtAd72zSUvAPbAPlBKeWwGFAXCQDPSTQBnYA6aBHeAqMSNFRMApMEdXbd8dpgV+xjVoE2Q7gZnGRjYo5urj4wpyPfNTuTOF4oWrTayZfLGj6x9NcdXR3SQ30cvz1Ovj7RYIW6oe24HKdvPm8ty3mr63fWMTA9kljH1wtbFDWxqsop/mvN2UuArACPBVbAX5WVeb2DB9ZZf0Jb2BMgugM1C9DcwZ2eAP69ce7LgcUCG2kr71EpFC//636bXweWAeuEvJmgH0HShFMqYPOMpgTqDGG6xug+Rulk+sAAAAAElFTkSuQmCC' Local $bString = Binary(_WinAPI_Base64Decode($Exit)) If $bSaveBinary Then Local $hFile = FileOpen($sSavePath & "\Exit3_20x20.png", 18) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Exit_Pic Func _Shell32_39ico($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Shell32_39ico $Shell32_39ico &= 'iLRIAAABABBAQAFwIAAAKEIAABYAAMwAKAAYAJAAgAAYAVwPAgAAbP8DGwBaWFJgAFtXUd9bVlL/AFpVUf5ZVV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JO8Ay4D/56ci/+cMpiHAQsAApCD/5QCjH//loh7/7wDFc//++vH//AHAQe7Ccf/uy4oP/z8/AP8/zCXy1JD/AOuzNP/prSb/BOmsxACrJf/oqQAk/+ioI//orOAw/+7KgPo+/z8fAP8fAPMffwB/AH8A/x8fAB8A//8f/x9/AH8A/x8fAB8AHwAB/R/Ly8v/xMTE/38AfwBuAGEL/x8fAB8AHwD//x9/AH8A/x8/FA8ADwAPAP8PAA8A/w8/AD8APwA/AD8A/z8A/w8PAA8ADwAPAA8ADwD//w8/AD8APwA/AD8APwD/D38PAA8ADwAPAA8ADwAJALLAsrLf8fHx/wk/AH8/AD8APwA/ADIAMQfwD+9/HwkPAA8ADwAPAA8ADwAA4AC0tLRfcQixGD8Avz8APwA/AD8APwBwB9+xB/8fCQ8ADwAPAA8ADwAPAA8A/w8ADwAPAA8ADwAPAA8ADwD/DwAPAA8ADwAPAA8ADwAPAP8PAA8ADwAPAA8ADwAPAA8A/w8ADwAPAA8ADwAPAA8ADwD/DwAPAA8ADwAPAA8ADwAPAP8PAA8ADwAPAA8ADwAPAA8AAQ8AF7CqADoA/xwA8ANMD0UOHw9hBYX/B9MDGwA=' $Shell32_39ico = _WinAPI_Base64Decode($Shell32_39ico) If @error Then Return SetError(1, 0, 0) Local $tSource = DllStructCreate('byte[' & BinaryLen($Shell32_39ico) & ']') DllStructSetData($tSource, 1, $Shell32_39ico) Local $tDecompress _WinAPI_LZNTDecompress($tSource, $tDecompress, 16958) If @error Then Return SetError(3, 0, 0) $tSource = 0 Local Const $bString = Binary(DllStructGetData($tDecompress, 1)) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Shell32_39.ico", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Shell32_39ico #EndRegion Embedded Gfx #Region Embedded Binary Data #Region TichySID Func _SIDClose() Local $aRet = MemoryDllCall($hTitchysidDll, 'int', 'SIDClose') If @error Then Return SetError(@error, 0, 0) Return $aRet[0] EndFunc ;==>_SIDClose Func _SIDOpen($Sid, $iSubsong = 1) Local $bSid If Not IsBinary($Sid) Then If Not FileExists($Sid) Then Return SetError(2, 0, 0) Local $hFileOpen = FileOpen($Sid, 0) If $hFileOpen = -1 Then Return SetError(-1, 0, 0) $bSid = FileRead($hFileOpen) FileClose($hFileOpen) Else $bSid = $Sid EndIf Local $tSid = DllStructCreate('byte[' & BinaryLen($bSid) & ']') DllStructSetData($tSid, 1, $bSid) Local $sType = BinaryToString(BinaryMid($bSid, 1, 4), 1) ConsoleWrite('-->-- Sid File Type : ' & $sType & @CRLF) Local $iVersion = Execute(BinaryMid($bSid, 5, 2)) ConsoleWrite('-->-- Sid File Version : ' & $iVersion & @CRLF) $iSubsongCount = Int(StringTrimLeft(BinaryMid($bSid, 15, 2), 2)) ConsoleWrite('-->-- SubsongCount : ' & $iSubsongCount & @CRLF) $iSubsong = $iSubsong - 1 If $iSubsong < 0 Then $iSubsong = 0 If $iSubsong > $iSubsongCount Then $iSubsong = 0 ConsoleWrite('-->-- Subsong : ' & $iSubsong & @CRLF) Local $aRet = MemoryDllCall($hTitchysidDll, 'int', 'SIDOpen', 'ptr', DllStructGetPtr($tSid), 'int', DllStructGetSize($tSid), 'int', $SID_MEMORY, 'int', $SID_NON_DEFAULT, 'int', $iSubsong) If @error Then Return SetError(@error, 0, 0) $tSid = 0 $bSid = 0 Return $aRet[0] EndFunc ;==>_SIDOpen Func _SIDShutdown() MemoryDllClose($hTitchysidDll) $hTitchysidDll = 0 EndFunc ;==>_SIDShutdown Func _SIDStartup() $hTitchysidDll = MemoryDllOpen(TitchySIDdll()) If $hTitchysidDll = -1 Then Return SetError(1, 0, 0) Return SetError(0, 0, $hTitchysidDll) EndFunc ;==>_SIDStartup Func _SIDStop() Local $aRet = MemoryDllCall($hTitchysidDll, 'int', 'SIDStop') If @error Then Return SetError(@error, 0, 0) Return $aRet[0] EndFunc ;==>_SIDStop Func _SIDGetFFTData($tFFTData) Local $aRet = MemoryDllCall($hTitchysidDll, 'int', 'SIDGetFFTData', "struct*", $tFFTData) If @error Then Return SetError(@error, 0, 0) Return $aRet[0] EndFunc ;==>_SIDGetFFTData Func TitchySIDdll($bSaveBinary = False, $sSavePath = @ScriptDir) Local $TitchySIDdll $TitchySIDdll &= 'UbwATVqQAAMAAACCBAAw//8AALgAOB0BAEAEOBkAAawOH7oADgC0Cc0huAEATM0hVGhpcyAAcHJvZ3JhbSAAY2Fubm90IGIAZSBydW4gaW4AIERPUyBtb2RAZS4NDQokBIYDgFUFlEc0a8cJA4JEAAPJK3jHVgAHMFJpY2gBEw17UEUAAABMAQQAoAEExF8FE+AADiELIAEFDAAWAAyqBrUDFBAEAzAEDQELAgPv4wEABQcAAAcGBgAPAxoHgRWGAwMDoDEAAPMLgY+AJzwZjvAGAEgXoKEOAIArNBgPLnRl5Hh0gANaFARIgXUHYgECACAAAGAucmTAYXRhAACTAWaBfU2BERqLE4DxQC6DCQBceKLASwF9wQsezgnAAC5yZWxvYwAAvDgBwzbCCQAazAlCsTw/PwA/AD8APwA/AC8AVYsE7LhBOl3CDABWCFfo6kABi/6Bx0JIQEuNTgi4QTz3ACED+DPA/wGDADkQdQKJAYlGAECDfjwAdUZmAGoAZv92mOjoAA4AADPJD7cFAHdOBRBmuSBOAPfhM9JmuQBMAPfxZoP4AHQGAIB+nAB1BbgggE4AAGa5RKzBAwC5QEIPAPfxiSBGPLgACEAOTkAAi9HR4gPWg8IASANOPDvIdhUxQAIrwVCiAyAOK8EAKUY86wyLRjwAUAFGQGoAj0ZQPFLolgCXuQEEOQBOQA+FZ////wAPv0ZIZokHZgCJRwKDxgKDxwAE4u1fXsP/dgAE6FYTAADDaiAgjUYMUMAB/1QAJBDCBAC+XEFYABDDQCAgH/DABzMAwIlGCFBQUGgBQFkQav+NRgRQJOgLAAfHRsAhAgBAg04g/42GQSOJAEYMagyPRhxoQDwkABDopUAH6AC//v//g34IAFB19WhUgQKQgAL+QEY662jo0eArjYBGL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ATAAAMAKSmbTyxAB5bFPoMygg+AAcuBu8E+wH9AACeAH8AKgAZAfADBCBUMA2ABOCQAyJUM3EA8AB1AAI7cQAAIkQzDcjIRAARcwCpAXEAcAEBdQAmMYeaDgkEAAEMCgcIBQIDAA0GCxQTBAgWABcFCRgSBgwZACIHDTgfACQtACEBDjIgAgoxABwDCzgqFRURAC0yMSMaHR4bADg3OC4zLzQQACwoKSclJjUP+CswNj8PDwAPAA8ADwD/DwAPAA8ADwAPAA8ADwAPAAcPAA8ADQBOsAAAEAAAKAAAAABMMP4wFjE/MQBUMdYxmzICMwBZMzE0UTSZNEAcOmk6cT8AgCABAggAGjQgNCY0ACw0MjQ4ND40AEQ0SjRQNFY0AwAwtAE=' $TitchySIDdll = _WinAPI_Base64Decode($TitchySIDdll) If @error Then Return SetError(1, 0, 0) Local $tSource = DllStructCreate('byte[' & BinaryLen($TitchySIDdll) & ']') DllStructSetData($tSource, 1, $TitchySIDdll) Local $tDecompress _WinAPI_LZNTDecompress($tSource, $tDecompress, 8704) If @error Then Return SetError(3, 0, 0) $tSource = 0 Local Const $bString = Binary(DllStructGetData($tDecompress, 1)) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\TitchySID.dll", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>TitchySIDdll Func API_FreeLibrary($Module) Local $Ret = DllCall($_KERNEL32DLL, 'bool', 'FreeLibrary', 'handle', $Module) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_FreeLibrary Func API_GetProcAddress($Module, $Procname) If IsNumber($Procname) Then Local $Ret = DllCall($_KERNEL32DLL, 'ptr', 'GetProcAddress', 'handle', $Module, 'int', $Procname) Else Local $Ret = DllCall($_KERNEL32DLL, 'ptr', 'GetProcAddress', 'handle', $Module, 'str', $Procname) EndIf If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_GetProcAddress Func API_IsBadReadPtr($Ptr, $Len) Local $Ret = DllCall($_KERNEL32DLL, 'int', 'IsBadReadPtr', 'ptr', $Ptr, 'UINT_PTR', $Len) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_IsBadReadPtr Func API_LoadLibrary($Filename) Local $Ret = DllCall($_KERNEL32DLL, 'handle', 'LoadLibraryW', 'wstr', $Filename) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_LoadLibrary Func API_lstrlenA($Address) Local $Ret = DllCall($_KERNEL32DLL, 'int', 'lstrlenA', 'ptr', $Address) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_lstrlenA Func API_lstrlenW($Address) Local $Ret = DllCall($_KERNEL32DLL, 'int', 'lstrlenW', 'ptr', $Address) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_lstrlenW Func API_VirtualProtect($Address, $Size, $Protection) Local $Ret = DllCall($_KERNEL32DLL, 'bool', 'VirtualProtect', 'ptr', $Address, 'dword_ptr', $Size, 'dword', $Protection, 'dword*', 0) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_VirtualProtect Func API_ZeroMemory($Address, $Size) Local $Ret = DllCall($_KERNEL32DLL, 'none', 'RtlZeroMemory', 'ptr', $Address, 'dword_ptr', $Size) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_ZeroMemory Func MemLib_BuildImportTable($CodeBase, $PEHeader) Local Const $IMAGE_DIRECTORY_ENTRY_IMPORT = 1 Local Const $SizeOfPtr = DllStructGetSize(DllStructCreate('ptr', 1)) Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfDataDirectory = DllStructGetSize(DllStructCreate($tagIMAGE_DATA_DIRECTORY)) Local $ImportDirectoryPtr = $PEHeader + DllStructGetSize($IMAGE_NT_HEADER) + $IMAGE_DIRECTORY_ENTRY_IMPORT * $SizeOfDataDirectory Local $ImportDirectory = DllStructCreate($tagIMAGE_DATA_DIRECTORY, $ImportDirectoryPtr) Local $ImportSize = DllStructGetData($ImportDirectory, 'Size') Local $ImportVirtualAddress = DllStructGetData($ImportDirectory, 'VirtualAddress') Local $SizeOfImportDir = DllStructGetSize(DllStructCreate($tagIMAGE_IMPORT_DESCRIPTOR)) Local $ImportList = '' If $ImportSize > 0 Then Local $ImportDescPtr = $CodeBase + $ImportVirtualAddress While 1 If API_IsBadReadPtr($ImportDescPtr, $SizeOfImportDir) Then ExitLoop Local $ImportDesc = DllStructCreate($tagIMAGE_IMPORT_DESCRIPTOR, $ImportDescPtr) Local $NameOffset = DllStructGetData($ImportDesc, 'Name') If $NameOffset = 0 Then ExitLoop Local $Name = Peek('str', $CodeBase + $NameOffset) Local $OriginalFirstThunk = DllStructGetData($ImportDesc, 'OriginalFirstThunk') Local $FirstThunk = DllStructGetData($ImportDesc, 'FirstThunk') Local $Handle = API_LoadLibrary($Name) If $Handle Then $ImportList &= $Handle & ',' Local $FuncRef = $CodeBase + $FirstThunk Local $ThunkRef = $CodeBase + $OriginalFirstThunk If $OriginalFirstThunk = 0 Then $ThunkRef = $FuncRef While 1 Local $Ref = Peek('ptr', $ThunkRef) If $Ref = 0 Then ExitLoop If BitAND(Peek('byte', $ThunkRef + $SizeOfPtr - 1), 0x80) Then Local $Ptr = API_GetProcAddress($Handle, BitAND($Ref, 0xffff)) Else Local $IMAGE_IMPORT_BY_NAME = DllStructCreate($tagIMAGE_IMPORT_BY_NAME, $CodeBase + $Ref) Local $NamePtr = DllStructGetPtr($IMAGE_IMPORT_BY_NAME, 2) Local $FuncName = Peek('str', $NamePtr) Local $Ptr = API_GetProcAddress($Handle, $FuncName) EndIf If $Ptr = 0 Then Return SetError(1, 0, False) Poke('ptr', $FuncRef, $Ptr) $ThunkRef += $SizeOfPtr $FuncRef += $SizeOfPtr WEnd Else Return SetError(1, 0, False) EndIf $ImportDescPtr += $SizeOfImportDir WEnd EndIf Return $ImportList EndFunc ;==>MemLib_BuildImportTable Func MemLib_CopySections($CodeBase, $PEHeader, $DllDataPtr) Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfFileHeader = DllStructGetPtr($IMAGE_NT_HEADER, 'Magic') - $PEHeader Local $SizeOfOptionalHeader = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfOptionalHeader') Local $NumberOfSections = DllStructGetData($IMAGE_NT_HEADER, 'NumberOfSections') Local $SectionAlignment = DllStructGetData($IMAGE_NT_HEADER, 'SectionAlignment') Local $SectionPtr = $PEHeader + $SizeOfFileHeader + $SizeOfOptionalHeader For $i = 1 To $NumberOfSections Local $Section = DllStructCreate($tagIMAGE_SECTION_HEADER, $SectionPtr) Local $VirtualAddress = DllStructGetData($Section, 'VirtualAddress') Local $SizeOfRawData = DllStructGetData($Section, 'SizeOfRawData') Local $PointerToRawData = DllStructGetData($Section, 'PointerToRawData') If $SizeOfRawData = 0 Then Local $Dest = _MemVirtualAlloc($CodeBase + $VirtualAddress, $SectionAlignment, $MEM_COMMIT, $PAGE_READWRITE) API_ZeroMemory($Dest, $SectionAlignment) Else Local $Dest = _MemVirtualAlloc($CodeBase + $VirtualAddress, $SizeOfRawData, $MEM_COMMIT, $PAGE_READWRITE) _MemMoveMemory($DllDataPtr + $PointerToRawData, $Dest, $SizeOfRawData) EndIf DllStructSetData($Section, 'VirtualSize', $Dest - $CodeBase) $SectionPtr += DllStructGetSize($Section) Next EndFunc ;==>MemLib_CopySections Func MemLib_FinalizeSections($CodeBase, $PEHeader) Local Const $IMAGE_SCN_MEM_EXECUTE = 0x20000000 Local Const $IMAGE_SCN_MEM_READ = 0x40000000 Local Const $IMAGE_SCN_MEM_WRITE = 0x80000000 Local Const $IMAGE_SCN_MEM_NOT_CACHED = 0x4000000 Local Const $IMAGE_SCN_CNT_INITIALIZED_DATA = 64 Local Const $IMAGE_SCN_CNT_UNINITIALIZED_DATA = 128 Local Const $PAGE_WRITECOPY = 0x0008 Local Const $PAGE_EXECUTE_WRITECOPY = 0x0080 Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfFileHeader = DllStructGetPtr($IMAGE_NT_HEADER, 'Magic') - $PEHeader Local $SizeOfOptionalHeader = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfOptionalHeader') Local $NumberOfSections = DllStructGetData($IMAGE_NT_HEADER, 'NumberOfSections') Local $SectionAlignment = DllStructGetData($IMAGE_NT_HEADER, 'SectionAlignment') Local $SectionPtr = $PEHeader + $SizeOfFileHeader + $SizeOfOptionalHeader For $i = 1 To $NumberOfSections Local $Section = DllStructCreate($tagIMAGE_SECTION_HEADER, $SectionPtr) Local $Characteristics = DllStructGetData($Section, 'Characteristics') Local $SizeOfRawData = DllStructGetData($Section, 'SizeOfRawData') Local $Executable = (BitAND($Characteristics, $IMAGE_SCN_MEM_EXECUTE) <> 0) Local $Readable = (BitAND($Characteristics, $IMAGE_SCN_MEM_READ) <> 0) Local $Writeable = (BitAND($Characteristics, $IMAGE_SCN_MEM_WRITE) <> 0) Local $ProtectList[8] = [$PAGE_NOACCESS, $PAGE_EXECUTE, $PAGE_READONLY, $PAGE_EXECUTE_READ, $PAGE_WRITECOPY, $PAGE_EXECUTE_WRITECOPY, $PAGE_READWRITE, $PAGE_EXECUTE_READWRITE] Local $Protect = $ProtectList[$Executable + $Readable * 2 + $Writeable * 4] If BitAND($Characteristics, $IMAGE_SCN_MEM_NOT_CACHED) Then $Protect = BitOR($Protect, $PAGE_NOCACHE) Local $Size = $SizeOfRawData If $Size = 0 Then If BitAND($Characteristics, $IMAGE_SCN_CNT_INITIALIZED_DATA) Then $Size = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfInitializedData') ElseIf BitAND($Characteristics, $IMAGE_SCN_CNT_UNINITIALIZED_DATA) Then $Size = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfUninitializedData') EndIf EndIf If $Size > 0 Then Local $PhysicalAddress = $CodeBase + DllStructGetData($Section, 'VirtualSize') API_VirtualProtect($PhysicalAddress, $Size, $Protect) EndIf $SectionPtr += DllStructGetSize($Section) Next EndFunc ;==>MemLib_FinalizeSections Func MemLib_FreeLibrary($ModulePtr) If Not MemLib_Vaild($ModulePtr) Then Return 0 Local $Module = DllStructCreate($tagModule, $ModulePtr) Local $CodeBase = DllStructGetData($Module, 'CodeBase') Local $DllEntry = DllStructGetData($Module, 'DllEntry') Local $Initialized = DllStructGetData($Module, 'Initialized') Local $ImportListPtr = DllStructGetData($Module, 'ImportList') Local $ExportListPtr = DllStructGetData($Module, 'ExportList') If $Initialized And $DllEntry Then Local $Success = MemoryFuncCall('bool', $DllEntry, 'ptr', $CodeBase, 'dword', 0, 'ptr', 0) DllStructSetData($Module, 'Initialized', 0) EndIf If $ExportListPtr Then _MemGlobalFree($ExportListPtr) If $ImportListPtr Then Local $ImportList = StringSplit(Peek('str', $ImportListPtr), ',') For $i = 1 To $ImportList[0] If $ImportList[$i] Then API_FreeLibrary($ImportList[$i]) Next _MemGlobalFree($ImportListPtr) EndIf If $CodeBase Then _MemVirtualFree($CodeBase, 0, $MEM_RELEASE) DllStructSetData($Module, 'CodeBase', 0) DllStructSetData($Module, 'ExportList', 0) _MemGlobalFree($ModulePtr) Return 1 EndFunc ;==>MemLib_FreeLibrary Func MemLib_GetExportList($CodeBase, $PEHeader) Local Const $IMAGE_DIRECTORY_ENTRY_EXPORT = 0 Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfDataDirectory = DllStructGetSize(DllStructCreate($tagIMAGE_DATA_DIRECTORY)) Local $ExportDirectoryPtr = $PEHeader + DllStructGetSize($IMAGE_NT_HEADER) + $IMAGE_DIRECTORY_ENTRY_EXPORT * $SizeOfDataDirectory Local $ExportDirectory = DllStructCreate($tagIMAGE_DATA_DIRECTORY, $ExportDirectoryPtr) Local $ExportSize = DllStructGetData($ExportDirectory, 'Size') Local $ExportVirtualAddress = DllStructGetData($ExportDirectory, 'VirtualAddress') Local $ExportList = '' If $ExportSize > 0 Then Local $IMAGE_EXPORT_DIRECTORY = DllStructCreate($tagIMAGE_EXPORT_DIRECTORY, $CodeBase + $ExportVirtualAddress) Local $NumberOfNames = DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'NumberOfNames') Local $NumberOfFunctions = DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'NumberOfFunctions') Local $AddressOfFunctions = DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'AddressOfFunctions') If $NumberOfNames = 0 Or $NumberOfFunctions = 0 Then Return '' Local $NameRef = $CodeBase + DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'AddressOfNames') Local $Ordinal = $CodeBase + DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'AddressOfNameOrdinals') For $i = 1 To $NumberOfNames Local $Ref = Peek('dword', $NameRef) Local $Idx = Peek('word', $Ordinal) Local $FuncName = Peek('str', $CodeBase + $Ref) If $Idx <= $NumberOfFunctions Then Local $Addr = $CodeBase + Peek('dword', $CodeBase + $AddressOfFunctions + $Idx * 4) $ExportList &= $FuncName & Chr(1) & $Addr & Chr(1) EndIf $NameRef += 4 $Ordinal += 2 Next EndIf Return $ExportList EndFunc ;==>MemLib_GetExportList Func MemLib_GetProcAddress($ModulePtr, $FuncName) Local $ExportPtr = Peek('ptr', $ModulePtr) If Not $ExportPtr Then Return 0 Local $ExportList = Peek('str', $ExportPtr) Local $Match = StringRegExp($ExportList, '(?i)' & $FuncName & '\001([^\001]*)\001', 3) If Not @error Then Return Ptr($Match[0]) Return 0 EndFunc ;==>MemLib_GetProcAddress Func MemLib_LoadLibrary($DllBinary) $DllBinary = Binary($DllBinary) Local $DllData = DllStructCreate('byte[' & BinaryLen($DllBinary) & ']') Local $DllDataPtr = DllStructGetPtr($DllData) DllStructSetData($DllData, 1, $DllBinary) Local $IMAGE_DOS_HEADER = DllStructCreate($tagIMAGE_DOS_HEADER, $DllDataPtr) If DllStructGetData($IMAGE_DOS_HEADER, 'e_magic') <> 0x5A4D Then Return SetError(1, 0, 0) EndIf Local $PEHeader = $DllDataPtr + DllStructGetData($IMAGE_DOS_HEADER, 'e_lfanew') Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) If DllStructGetData($IMAGE_NT_HEADER, 'Signature') <> 0x4550 Then Return SetError(1, 0, 0) EndIf Switch DllStructGetData($IMAGE_NT_HEADER, 'Magic') Case 0x10B If @AutoItX64 Then Return SetError(2, 0, 0) Case 0x20B If Not @AutoItX64 Then Return SetError(2, 0, 0) EndSwitch Local $ImageBase = DllStructGetData($IMAGE_NT_HEADER, 'ImageBase') Local $SizeOfImage = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfImage') Local $SizeOfHeaders = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfHeaders') Local $AddressOfEntryPoint = DllStructGetData($IMAGE_NT_HEADER, 'AddressOfEntryPoint') Local $ModulePtr = _MemGlobalAlloc(DllStructGetSize(DllStructCreate($tagModule)), $GPTR) If $ModulePtr = 0 Then Return SetError(3, 0, 0) Local $Module = DllStructCreate($tagModule, $ModulePtr) Local $CodeBase = _MemVirtualAlloc($ImageBase, $SizeOfImage, $MEM_RESERVE, $PAGE_READWRITE) If $CodeBase = 0 Then $CodeBase = _MemVirtualAlloc(0, $SizeOfImage, $MEM_RESERVE, $PAGE_READWRITE) If $CodeBase = 0 Then Return SetError(3, 0, 0) DllStructSetData($Module, 'CodeBase', $CodeBase) _MemVirtualAlloc($CodeBase, $SizeOfImage, $MEM_COMMIT, $PAGE_READWRITE) Local $Base = _MemVirtualAlloc($CodeBase, $SizeOfHeaders, $MEM_COMMIT, $PAGE_READWRITE) _MemMoveMemory($DllDataPtr, $Base, $SizeOfHeaders) MemLib_CopySections($CodeBase, $PEHeader, $DllDataPtr) Local $LocationDelta = $CodeBase - $ImageBase If $LocationDelta <> 0 Then MemLib_PerformBaseRelocation($CodeBase, $PEHeader, $LocationDelta) Local $ImportList = MemLib_BuildImportTable($CodeBase, $PEHeader) If @error Then MemLib_FreeLibrary($ModulePtr) Return SetError(2, 0, 0) EndIf Local $ExportList = MemLib_GetExportList($CodeBase, $PEHeader) Local $ImportListPtr = _MemGlobalAlloc(StringLen($ImportList) + 2, $GPTR) Local $ExportListPtr = _MemGlobalAlloc(StringLen($ExportList) + 2, $GPTR) DllStructSetData($Module, 'ImportList', $ImportListPtr) DllStructSetData($Module, 'ExportList', $ExportListPtr) If $ImportListPtr = 0 Or $ExportListPtr = 0 Then MemLib_FreeLibrary($ModulePtr) Return SetError(3, 0, 0) EndIf Poke('str', $ImportListPtr, $ImportList) Poke('str', $ExportListPtr, $ExportList) MemLib_FinalizeSections($CodeBase, $PEHeader) Local $DllEntry = $CodeBase + $AddressOfEntryPoint DllStructSetData($Module, 'DllEntry', $DllEntry) DllStructSetData($Module, 'Initialized', 0) If $AddressOfEntryPoint Then Local $Success = MemoryFuncCall('bool', $DllEntry, 'ptr', $CodeBase, 'dword', 1, 'ptr', 0) If Not $Success[0] Then MemLib_FreeLibrary($ModulePtr) Return SetError(4, 0, 0) EndIf DllStructSetData($Module, 'Initialized', 1) EndIf Return $ModulePtr EndFunc ;==>MemLib_LoadLibrary Func MemLib_PerformBaseRelocation($CodeBase, $PEHeader, $LocationDelta) Local Const $IMAGE_DIRECTORY_ENTRY_BASERELOC = 5 Local Const $IMAGE_REL_BASED_HIGHLOW = 3 Local Const $IMAGE_REL_BASED_DIR64 = 10 Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfDataDirectory = DllStructGetSize(DllStructCreate($tagIMAGE_DATA_DIRECTORY)) Local $RelocDirectoryPtr = $PEHeader + DllStructGetSize($IMAGE_NT_HEADER) + $IMAGE_DIRECTORY_ENTRY_BASERELOC * $SizeOfDataDirectory Local $RelocDirectory = DllStructCreate($tagIMAGE_DATA_DIRECTORY, $RelocDirectoryPtr) Local $RelocSize = DllStructGetData($RelocDirectory, 'Size') Local $RelocVirtualAddress = DllStructGetData($RelocDirectory, 'VirtualAddress') If $RelocSize > 0 Then Local $Relocation = $CodeBase + $RelocVirtualAddress While 1 Local $IMAGE_BASE_RELOCATION = DllStructCreate($tagIMAGE_BASE_RELOCATION, $Relocation) Local $VirtualAddress = DllStructGetData($IMAGE_BASE_RELOCATION, 'VirtualAddress') Local $SizeOfBlock = DllStructGetData($IMAGE_BASE_RELOCATION, 'SizeOfBlock') If $VirtualAddress = 0 Then ExitLoop Local $Dest = $CodeBase + $VirtualAddress Local $Entries = ($SizeOfBlock - 8) / 2 Local $RelInfo = DllStructCreate('word[' & $Entries & ']', $Relocation + 8) For $i = 1 To $Entries Local $Info = DllStructGetData($RelInfo, 1, $i) Local $Type = BitShift($Info, 12) If $Type = $IMAGE_REL_BASED_HIGHLOW Or $Type = $IMAGE_REL_BASED_DIR64 Then Local $Addr = DllStructCreate('ptr', $Dest + BitAND($Info, 0xFFF)) DllStructSetData($Addr, 1, DllStructGetData($Addr, 1) + $LocationDelta) EndIf Next $Relocation += $SizeOfBlock WEnd EndIf EndFunc ;==>MemLib_PerformBaseRelocation Func MemLib_Vaild($ModulePtr) Local $ModuleSize = DllStructGetSize(DllStructCreate($tagModule)) If API_IsBadReadPtr($ModulePtr, $ModuleSize) Then Return False Local $Module = DllStructCreate($tagModule, $ModulePtr) Local $CodeBase = DllStructGetData($Module, 'CodeBase') If Not $CodeBase Then Return False Return True EndFunc ;==>MemLib_Vaild Func MemoryDllCall($Module, $RetType, $FuncName, $Type1 = '', $Param1 = 0, $Type2 = '', $Param2 = 0, $Type3 = '', $Param3 = 0, $Type4 = '', $Param4 = 0, $Type5 = '', $Param5 = 0, $Type6 = '', $Param6 = 0, $Type7 = '', $Param7 = 0, $Type8 = '', $Param8 = 0, $Type9 = '', $Param9 = 0, $Type10 = '', $Param10 = 0, $Type11 = '', $Param11 = 0, $Type12 = '', $Param12 = 0, $Type13 = '', $Param13 = 0, $Type14 = '', $Param14 = 0, $Type15 = '', $Param15 = 0, $Type16 = '', $Param16 = 0, $Type17 = '', $Param17 = 0, $Type18 = '', $Param18 = 0, $Type19 = '', $Param19 = 0, $Type20 = '', $Param20 = 0) Local $Ret, $OpenFlag = False Local Const $MaxParams = 20 If (@NumParams < 3) Or (@NumParams > $MaxParams * 2 + 3) Or (Mod(@NumParams, 2) = 0) Then Return SetError(4, 0, 0) If Not IsPtr($Module) Then $OpenFlag = True $Module = MemoryDllOpen($Module) If @error Then Return SetError(1, 0, 0) EndIf Local $Addr = MemLib_GetProcAddress($Module, $FuncName) If Not $Addr Then Return SetError(3, 0, 0) Poke('ptr', $_MFHookPtr + 1 + @AutoItX64, $Addr) Switch @NumParams Case 3 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi) Case 5 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1) Case 7 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2) Case 9 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3) Case 11 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3, $Type4, $Param4) Case 13 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3, $Type4, $Param4, $Type5, $Param5) Case Else Local $DllCallStr = 'DllCall ( $_KERNEL32DLL, $RetType, $_MFHookApi', $n = 1 For $i = 5 To @NumParams Step 2 $DllCallStr &= ', $Type' & $n & ', $Param' & $n $n += 1 Next $DllCallStr &= ' )' $Ret = Execute($DllCallStr) EndSwitch Local $Err = @error If $OpenFlag Then MemoryDllClose($Module) Return SetError($Err, 0, $Ret) EndFunc ;==>MemoryDllCall Func MemoryDllClose($Module) MemLib_FreeLibrary($Module) EndFunc ;==>MemoryDllClose Func MemoryDllOpen($DllBinary) If Not IsDllStruct($_MFHookBak) Then MemoryFuncInit() Local $Module = MemLib_LoadLibrary($DllBinary) If @error Then Return SetError(@error, 0, -1) Return $Module EndFunc ;==>MemoryDllOpen Func MemoryFuncCall($RetType, $Address, $Type1 = '', $Param1 = 0, $Type2 = '', $Param2 = 0, $Type3 = '', $Param3 = 0, $Type4 = '', $Param4 = 0, $Type5 = '', $Param5 = 0, $Type6 = '', $Param6 = 0, $Type7 = '', $Param7 = 0, $Type8 = '', $Param8 = 0, $Type9 = '', $Param9 = 0, $Type10 = '', $Param10 = 0, $Type11 = '', $Param11 = 0, $Type12 = '', $Param12 = 0, $Type13 = '', $Param13 = 0, $Type14 = '', $Param14 = 0, $Type15 = '', $Param15 = 0, $Type16 = '', $Param16 = 0, $Type17 = '', $Param17 = 0, $Type18 = '', $Param18 = 0, $Type19 = '', $Param19 = 0, $Type20 = '', $Param20 = 0) If Not IsDllStruct($_MFHookBak) Then MemoryFuncInit() Poke('ptr', $_MFHookPtr + 1 + @AutoItX64, $Address) Local $Ret Switch @NumParams Case 2 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi) Case 4 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1) Case 6 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2) Case 8 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3) Case 10 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3, $Type4, $Param4) Case 12 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3, $Type4, $Param4, $Type5, $Param5) Case Else Local $DllCallStr = 'DllCall($_KERNEL32DLL, $RetType, $_MFHookApi', $n = 1 For $i = 4 To @NumParams Step 2 $DllCallStr &= ', $Type' & $n & ', $Param' & $n $n += 1 Next $DllCallStr &= ')' $Ret = Execute($DllCallStr) EndSwitch Return SetError(@error, 0, $Ret) EndFunc ;==>MemoryFuncCall Func MemoryFuncInit() Local $KernelHandle = API_LoadLibrary('kernel32.dll') API_FreeLibrary($KernelHandle) Local $HookPtr = API_GetProcAddress($KernelHandle, $_MFHookApi) Local $HookSize = 7 + @AutoItX64 * 5 $_MFHookPtr = $HookPtr $_MFHookBak = DllStructCreate('byte[' & $HookSize & ']') If Not API_VirtualProtect($_MFHookPtr, $HookSize, $PAGE_EXECUTE_READWRITE) Then Return False DllStructSetData($_MFHookBak, 1, Peek('byte[' & $HookSize & ']', $_MFHookPtr)) If @AutoItX64 Then Poke('word', $_MFHookPtr, 0xB848) Poke('word', $_MFHookPtr + 10, 0xE0FF) Else Poke('byte', $_MFHookPtr, 0xB8) Poke('word', $_MFHookPtr + 5, 0xE0FF) EndIf Return True EndFunc ;==>MemoryFuncInit Func Peek($Type, $Ptr) If $Type = 'str' Then $Type = 'char[' & API_lstrlenA($Ptr) & ']' ElseIf $Type = 'wstr' Then $Type = 'wchar[' & API_lstrlenW($Ptr) & ']' EndIf Return DllStructGetData(DllStructCreate($Type, $Ptr), 1) EndFunc ;==>Peek Func Poke($Type, $Ptr, $Value) If $Type = 'str' Then $Type = 'char[' & (StringLen($Value) + 1) & ']' ElseIf $Type = 'wstr' Then $Type = 'wchar[' & (StringLen($Value) + 1) & ']' EndIf DllStructSetData(DllStructCreate($Type, $Ptr), 1, $Value) EndFunc ;==>Poke #EndRegion TichySID #EndRegion Embedded Binary Data #Region SID Tune ;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2020-06-05 Func _SID_Tune($bSaveBinary = False, $sSavePath = @ScriptDir) Local $SID_Tune $SID_Tune &= 'DrkAUFNJRAACAHwAAAAQABADAAEDABAAAFVuaWNvcoBuZmxha2VzAUABDABT+HJlbiBMgHVuZCAoU28AFgIpCz4yMDE2IENAYW1lbG90EHwABAAUAgoQTH0RTADqEUwNEq2WiaCSlZq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GgAAQDoHAoBQEEAgEABgME/wAVCBUWFjkABQYHCMMBdZAKFxcYGDkA8AoCDHF2/wF+g8H/AD17qMbzHElnAJS99yFSiMLsQB1TbomcGAAAGVUBABoCABsBABwBAIYAYSb+/4FiGmAA/mEa/oMt/oGAYBpi/oJhGLIA2WEBg2GEAPwBgeMA0gNCE9ABE/6EK9ABE2fTAbEAYQGEYYQA/AGBVeMAH9EDF9ABF7MFF6+4B2ABswf/AYHjACPRA+oc0AEcswUcuAdgAbMHBf8BgeMAKP7/hWICPdABPv45/mA7ALH7/D37Y/5hADn+NP5rNrBpIPth/mA3QAE5Ygj7sGPAAP+FZy8EsHmAAC3+L/5gADKy+/w0+7BhIPv+MmX+UAr/hSMTBNEEQP470AFgPUpiwASw0ARnNgAE/gBhNP42/j7+PSPABsACMbNhIAIyZwMiBJABsGX+MmH+ji+xBNIGkgD+/4YPCtsPCgUKhg8KCAqGDwoPCp0FCoYPCg8KYg9iMQAKZjKQAwQKsPtRBfEAPYkwBj5iUQo9sPvQAoA5/mM2/GA3QgeyZZADYzuhBYACMoADVDRkYAFlkQhkAQQvWP4xsJAL0A40kAJhwXADNPv8NmaBDkQPIdEHYy+wZ0AKLfsA/C/+ZTRh/jJ3cAWgAwoDZWYSYQo1B2JmNFAL0A6wYHAPEQ82/7EWrwyvDK8MkAOvDK8Mogz+hq8MrwypDAkD' $SID_Tune &= 'rwyvDKMMAIdhKrT+MbT+UC20/jKCADaCADkCtKEBJrT+L7T+DisSAYAApwGGYSr+6jHQIzJQADZQAHEg0EEoL/4rwAAvJQE=' $SID_Tune = _WinAPI_Base64Decode($SID_Tune) If @error Then Return SetError(1, 0, 0) Local $tSource = DllStructCreate('byte[' & BinaryLen($SID_Tune) & ']') DllStructSetData($tSource, 1, $SID_Tune) Local $tDecompress _WinAPI_LZNTDecompress($tSource, $tDecompress, 3373) If @error Then Return SetError(3, 0, 0) $tSource = 0 Local Const $bString = Binary(DllStructGetData($tDecompress, 1)) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Unicornflakes.sid", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_SID_Tune #EndRegion SID Tune ;---------------------------------------------------------------------------------------- Func _SetCtrlColorMode($hWnd, $bDarkMode = True, $sName = Default) If $sName = Default Then $sName = $bDarkMode ? "DarkMode_Explorer" : "Explorer" $bDarkMode = Not Not $bDarkMode ; https://www.vbforums.com/showthread.php?900444-Windows-10-Dark-Mode-amp-VB6-apps If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) Local Enum $eDefault, $eAllowDark, $eForceDark, $eForceLight, $eMax ; enum PreferredAppMode DllCall("uxtheme.dll", "bool", 133, "hwnd", $hWnd, "bool", $bDarkMode) ; fnAllowDarkModeForWindow = 133 DllCall("uxtheme.dll", "int", 135, "int", ($bDarkMode ? $eForceDark : $eForceLight)) ; fnAllowDarkModeForApp = 135 _WinAPI_SetWindowTheme_unr($hWnd, $sName) ; https://www.autoitscript.com/forum/index.php?showtopic=211475&view=findpost&p=1530103 DllCall("uxtheme.dll", "none", 104) ; fnRefreshImmersiveColorPolicyState = 104 ; not needed ? _SendMessage($hWnd, $WM_THEMECHANGED, 0, 0) ; not needed ? EndFunc ;==>_SetCtrlColorMode ;---------------------------------------------------------------------------------------- Func _WinAPI_SetWindowTheme_unr($hWnd, $sName = Null, $sList = Null) ;Causes a window to use a different set of visual style information than its class normally uses Local $sResult = DllCall("UxTheme.dll", "long", "SetWindowTheme", "hwnd", $hWnd, "wstr", $sName, "wstr", $sList) If @error Then Return SetError(@error, @extended, 0) If $sResult[0] Then Return SetError(10, $sResult[0], 0) Return 1 EndFunc ;==>_WinAPI_SetWindowTheme_unr ;---------------------------------------------------------------------------------------- Func _WinAPI_DwmSetWindowAttribute_unr($hWnd, $iAttribute, $iData) ;Sets the value of the specified attributes for non-client rendering to apply to the window Local $aCall = DllCall("dwmapi.dll", "long", "DwmSetWindowAttribute", "hwnd", $hWnd, "dword", $iAttribute, "dword*", $iData, "dword", 4) If @error Then Return SetError(@error, @extended, 0) If $aCall[0] Then Return SetError(10, $aCall[0], 0) Return 1 EndFunc ;==>_WinAPI_DwmSetWindowAttribute_unr ;---------------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------------------------------------------------------- ; https://www.autoitscript.com/forum/topic/211475-darkmode-udf-for-autoits-win32guis/#comment-1530103 ;-------------------------------------------------------------------------------------------------------------------------------- Func DarkMode($hGUI, $bDarkMode = True) ; DarkMode Local Enum $DWMWA_USE_IMMERSIVE_DARK_MODE = (@OSBuild <= 18985) ? 19 : 20 ;ConsoleWrite("$DWMWA_USE_IMMERSIVE_DARK_MODE=" & $DWMWA_USE_IMMERSIVE_DARK_MODE & @CRLF) ; DWMWA_USE_IMMERSIVE_DARK_MODE ; https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute ; Use with DwmSetWindowAttribute. Allows the window frame for this window to be drawn in dark mode colors when the dark mode system setting is enabled. ; For compatibility reasons, all windows default to light mode regardless of the system setting. ; The pvAttribute parameter points to a value of type BOOL. TRUE to honor dark mode for the window, FALSE to always use light mode. ; This value is supported starting with Windows 11 Build 22000. Local $iRet = _WinAPI_DwmSetWindowAttribute_unr($hGUI, $DWMWA_USE_IMMERSIVE_DARK_MODE, $bDarkMode) If Not $iRet Then Return SetError(1, 0, -1) _SetCtrlColorMode($hLV, $bDarkMode) If $bDarkMode Then ; $hGUI GUISetBkColor(0x1B1B1B, $hGUI) ;0x1B1B1B Black Else ; $hGUI GUISetBkColor(0xF0F0F0, $hGUI) ;0xF0F0F0 Honeydew EndIf _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_UPDATENOW) ;WinActivate("[CLASS:Progman;]") ; To refresh the frame. ;WinActivate($hGui) ; Only needed for the constant back and forth in this demo. EndFunc ;==>DarkMode The tool should also work for different DPI settings and in multi-monitor environment. Thanks to for testing: argumentum BugFix Kanashius Mombas After starting, the desktop icons are read in and displayed in a list. With the left mouse button you can start the app, with the right mouse button you have additional options, like starting the app with administrative rights. The source code and the compiled exe file are additionally located on my One Drive: Toolbar Desktop Works best when compiled!
    2 points
  49. My pleasure mate Ok fair enough. Just as an eye test, we probably on need to refresh this every 100ms or so to keep the animation relatively smooth. At that pace I wouldn't think we'd run into responsiveness issues caused by too much border-ing. But yes, if the process is too busy to call DoBorder() then the animation would obviously pause. That function shouldn't really do anything until that "1/25" seconds has elapsed.. so would adlib a bit slower and save some resources Try 100ms to start, and if it looks janky you can speed it up a little bit from there. Adlibing super fast can also cause issues, this is because the adlib gap could be smaller than the available idle time.. In that case you'll just endup with a backlog of adlib tasks that can't be processed, and you'll probably ramp the cpu. To give you an idea, even doing a Sleep(1) will take around 10 - 15ms by the time the process goes to sleep and wakes up again.
    2 points
  50. This is quite a clever bit of code! The internal timer is a reference, so doesn't matter when you call the function - it'll always calculate the "correct" colour based on when it was called. The function was being called periodically based on a second external timer. But adlib should happily work for us, or we can just call it in a loop. A hue value is then calculated based on that internal timer. It is a value between 0 and 1, then the RGB values are based on that. We can see this in action... For $i = 0 To 9 WriteVals($i/10) Next Func WriteVals($fHue) ;T = presumably "transition" value. So RGB values are all based on this. Local $fT = 6 * $fHue Local $nR = Abs($fT - 3) - 1 Local $nG = 2 - Abs($fT - 2) Local $nB = 2 - Abs($fT - 4) ;Max out at 0 and 1. $nR = ($nR < 0) ? 0 : ($nR > 1) ? 1 : $nR $nG = ($nG < 0) ? 0 : ($nG > 1) ? 1 : $nG $nB = ($nB < 0) ? 0 : ($nB > 1) ? 1 : $nB ConsoleWrite(StringFormat("Hue: %1.2f", $fHue, $nR, $nG, $nB)& @CRLF) ConsoleWrite(StringFormat("R:%1.2f G:%1.2f B:%1.2f", $nR, $nG, $nB)& @CRLF) ;make percentage of max values! $nR *= 255 $nG *= 255 $nB *= 255 ConsoleWrite(StringFormat("R:%4d G:%4d B:%4d" , $nR, $nG, $nB)& @CRLF & @CRLF) EndFunc And here's that implemented based on time: #include <GUIConstantsEx.au3> Global $hGUI, $fSpeed = 4 Example() Func Example() ; Create a GUI with various controls. $hGUI = GUICreate("Example", 400, 400) Local $idBtn_OK = GUICtrlCreateButton("OK", 310, 370, 85, 25) ; dark titlebar _WinAPI_DwmSetWindowAttribute__($hGUI, 20, 1) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idBtn_OK ExitLoop EndSwitch DoBorder($hGUI) WEnd GUIDelete($hGUI) EndFunc ;==>Example Func DoBorder($hWnd) Local Const $fInverseSpeed = 1/$fSpeed Local Static $fHue ;the border col will be calculated based on the time elapsed from a single timer. Local Static $hTimer = TimerInit() Local Static $fLastTime Local $fCurTime = TimerDiff($hTimer) Local $fTimerSec = ($fCurTime - $fLastTime)/1000 If $fTimerSec < 1/25 Then Return ;Slow down processing (do not needlessly refresh faster than 25hz) $fLastTime = $fCurTime ;Hue is a value between 0 and 1. ;Its value is based on the internal timer.. $fHue += ($fTimerSec * $fInverseSpeed) If $fHue >= 1 Then $fHue -= Int($fHue) ;T = transition value. So RGB values are all based on this. ;We want RGB values to be between 0 and 1. Local $fT = 6 * $fHue Local $fR = Abs($fT - 3) - 1 Local $fG = 2 - Abs($fT - 2) Local $fB = 2 - Abs($fT - 4) ;Max values out at 0 and 1. $fR = ($fR < 0) ? 0 : ($fR > 1) ? 1 : $fR $fG = ($fG < 0) ? 0 : ($fG > 1) ? 1 : $fG $fB = ($fB < 0) ? 0 : ($fB > 1) ? 1 : $fB ;RGB is now a percentage of max values $fR *= 255 $fG *= 255 $fB *= 255 ;Construct RGB Value. (reverse order due to endianness!) Local $iRGB = BitOr(BitShift(Int($fB), -16), BitShift(Int($fG), -8), Int($fR)) DllCall('dwmapi.dll', 'long', 'DwmSetWindowAttribute', 'hwnd', $hWnd, 'dword', 34, 'dword*', $iRGB, 'dword', 4) EndFunc ;==>BorderMeRandomColorViaTimer Func _WinAPI_DwmSetWindowAttribute__($hwnd, $attribute = 34, $value = 0x00FF00, $valLen = 4) Local $aCall = DllCall('dwmapi.dll', 'long', 'DwmSetWindowAttribute', 'hwnd', $hWnd, 'dword', $attribute, 'dword*', $value, 'dword', $valLen) If @error Then Return SetError(@error, @extended, 0) If $aCall[0] Then Return SetError(10, $aCall[0], 0) Return 1 EndFunc ;==>_WinAPI_DwmSetWindowAttribute__ Edit: I'm a bit confused as to why we're jumping into IPC stuff? - was the problem with adlib that you can't supply the window handle as a param? I'd just store the target window handle as a global var to do it that way... - anyway FWIW I've updated the example so you can specify a target window.
    2 points
×
×
  • Create New...