Jump to content

Leaderboard

Popular Content

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

  1. Jon

    AutoIt v3.3.18.0 Released

    AutoIt v3.3.18.0 has been released - mainly a UDF release. Thanks to @jpm and the MVPs who were responsible for the majority of code in this version. Download it here. Complete list of changes: History
    16 points
  2. Try this: ;Coded by UEZ build 2025-09-06 #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPIConstants.au3> #include <WinAPISysWin.au3> _GDIPlus_Startup() Global Const $STM_SETIMAGE = 0x0172, $SC_DRAGMOVE = 0xF012 Global Const $iW = 300, $iH = $iW Global $hGUI = GUICreate("GDI+ Ring Progressbar", $iW, $iH, -1, -1, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_LAYERED)) GUISetState() Global $aInterpolations[4][2] ;define the interpolated colors and positions $aInterpolations[0][0] = 3 $aInterpolations[1][0] = 0xFF800000 ;Red $aInterpolations[1][1] = 0 $aInterpolations[2][0] = 0xFFFF6700 ;Orange $aInterpolations[2][1] = 0.5 $aInterpolations[3][0] = 0xFFFFFF00 ;Yellow $aInterpolations[3][1] = 1.0 Global $fPerc = 0, $iSleep = 30 GUIRegisterMsg($WM_TIMER, "PlayAnim") DllCall("user32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", $iSleep, "int", 0) GUIRegisterMsg($WM_LBUTTONDOWN, "WM_LBUTTONDOWN") Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIRegisterMsg($WM_TIMER, "") GUIRegisterMsg($WM_LBUTTONDOWN, "") _GDIPlus_Shutdown() GUIDelete() Exit EndSwitch Until False Func PlayAnim() _GDIPlus_RingProgressbar($fPerc, $iW) $fPerc += 0.33333 If $fPerc > 100 Then $fPerc = 0 EndFunc ;==>PlayAnim Func _GDIPlus_RingProgressbar($fPerc, $iSize = 300, $sText = "Please wait...") Local Const $hBitmap = _GDIPlus_BitmapCreateFromScan0($iSize, $iSize) Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetPixelOffsetMode($hCtxt, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2) If $fPerc < 0 Then $fPerc = 0 If $fPerc > 100 Then $fPerc = 100 Local Const $hPath = _GDIPlus_PathCreate(), _ $fRadius = $iSize / 1.5, $iX = ($iSize - $fRadius) / 2, $iY = ($iSize - $fRadius) / 2, _ $fDX = $iSize / 10, $fAngel = $fPerc * 3.6, $fSize = $iSize / 15 Local Const $hBrush = _GDIPlus_LineBrushCreate($iX, $fDX + $iY, $fRadius, $fRadius, 0, 0, 1) Local Const $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($hMatrix, $fRadius, $fRadius) _GDIPlus_MatrixRotate($hMatrix, -35, False) _GDIPlus_LineBrushMultiplyTransform($hBrush, $hMatrix, False) _GDIPlus_LineBrushSetPresetBlend($hBrush, $aInterpolations) _GDIPlus_MatrixDispose($hMatrix) Local Const $hPen = _GDIPlus_PenCreate2($hBrush, $fSize) _GDIPlus_PathAddArc($hPath, $iX, $fDX + $iY, $fRadius, $fRadius, -90, $fAngel) _GDIPlus_GraphicsDrawPath($hCtxt, $hPath, $hPen) _GDIPlus_PathReset($hPath) Local Const $hFamily = _GDIPlus_FontFamilyCreate("Verdana") Local Const $hFormat = _GDIPlus_StringFormatCreate() Local Const $tLayout = _GDIPlus_RectFCreate(0, $iSize / 12, $iSize, 0) Local Const $tLayout2 = _GDIPlus_RectFCreate(0, ($iSize + $iSize / 18) / 2, $iSize, 0) _GDIPlus_StringFormatSetAlign($hFormat, 1) Local Const $hBrush2 = _GDIPlus_BrushCreateSolid(0xF0FFFFFF) _GDIPlus_PenSetColor($hPen, 0xF0404040) _GDIPlus_PenSetWidth($hPen, $iSize / 100) _GDIPlus_PenSetLineJoin($hPen, 2) _GDIPlus_PathAddString($hPath, $sText, $tLayout, $hFamily, 0, $iSize / 12, $hFormat) _GDIPlus_PathAddString($hPath, StringFormat("%02d%", $fPerc), $tLayout2, $hFamily, 0, $iSize / 9, $hFormat) _GDIPlus_GraphicsDrawPath($hCtxt, $hPath, $hPen) _GDIPlus_GraphicsFillPath($hCtxt, $hPath, $hBrush2) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_PenDispose($hPen) _GDIPlus_BrushDispose($hBrush) _GDIPlus_BrushDispose($hBrush2) _GDIPlus_PathDispose($hPath) Local $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _WinAPI_BitmapDisplayTransparentInGUI($hHBmp, $hGUI) _GDIPlus_BitmapDispose($hBitmap) _WinAPI_DeleteObject($hHBmp) EndFunc ;==>_GDIPlus_RingProgressbar Func _WinAPI_BitmapDisplayTransparentInGUI(ByRef $hHBitmap, ByRef $hGUI, $iOpacity = 0xFF, $iFlags = $ULW_ALPHA, $bReleaseGDI = True, $tDest = Null, $iBGR = 0) If Not BitAND(GUIGetStyle($hGUI)[1], $WS_EX_LAYERED) = $WS_EX_LAYERED Then Return SetError(1, 0, 0) Local $tDim = DllStructCreate($tagBITMAP) If Not _WinAPI_GetObject($hHBitmap, DllStructGetSize($tDim), DllStructGetPtr($tDim)) Then Return SetError(2, 0, 0) Local $tSize = DllStructCreate($tagSIZE), $tSource = DllStructCreate($tagPOINT), $tBlend = DllStructCreate($tagBLENDFUNCTION) Local Const $hScrDC = _WinAPI_GetDC(0), $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC), $hOld = _WinAPI_SelectObject($hMemDC, $hHBitmap) $tSize.X = $tDim.bmWidth $tSize.Y = $tDim.bmHeight $tBlend.Alpha = $iOpacity $tBlend.Format = 1 _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, $tDest, $tSize, $hMemDC, $tSource, $iBGR, $tBlend, $iFlags) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteDC($hMemDC) If $bReleaseGDI Then _WinAPI_DeleteObject($hHBitmap) Return True EndFunc ;==>_WinAPI_BitmapDisplayTransparentInGUI Func WM_LBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam) _SendMessage($hGUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0) EndFunc ;==>WM_LBUTTONDOWN
    7 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. Latest update just released. See below for change log.
    6 points
  5. To break down the performance behavior in more detail: It depends on whether the condition is met or not. The following test script: Global Const $N = 1e7 Global $iT, $f_Overhead ConsoleWrite(@CRLF & " name time" & @CRLF & "--------------------------------------" & @CRLF) ; determine the overhead of loop [and optional other stuff] $iT = TimerInit() For $i = 1 To $N Next $f_Overhead = TimerDiff($iT) $iVariable = 1 $iT = TimerInit() For $i = 1 To $N If $iVariable Then $iVariable = 1 EndIf Next $iT = TimerDiff($iT) ConsoleWrite(StringFormat("% 20s:\t%10.6f ms\n", "If-EndIf True", ($iT-$f_Overhead) / $N)) $iVariable = 0 $iT = TimerInit() For $i = 1 To $N If $iVariable Then $iVariable = 1 EndIf Next $iT = TimerDiff($iT) ConsoleWrite(StringFormat("% 20s:\t%10.6f ms\n", "If-EndIf False", ($iT-$f_Overhead) / $N)) $iVariable = 1 $iT = TimerInit() For $i = 1 To $N If $iVariable Then $iVariable = 1 Next $iT = TimerDiff($iT) ConsoleWrite(StringFormat("% 20s:\t%10.6f ms\n", "If-OneLiner True", ($iT-$f_Overhead) / $N)) $iVariable = 0 $iT = TimerInit() For $i = 1 To $N If $iVariable Then $iVariable = 1 Next $iT = TimerDiff($iT) ConsoleWrite(StringFormat("% 20s:\t%10.6f ms\n", "If-OneLiner False", ($iT-$f_Overhead) / $N)) produces for me: name time -------------------------------------- If-EndIf True: 0.000260 ms If-EndIf False: 0.000161 ms If-OneLiner True: 0.000481 ms If-OneLiner False: 0.000088 ms So it depends on whether the condition is met or not. If it is met, then the classic If-EndIf is faster. If it is not met, the one-liner is faster. When conditions are balanced, their times will be roughly the same. If you can estimate whether the vast majority of conditions are true or false, then you could certainly optimize on that basis. The relative differences are quite significant. But in absolute terms, they are completely subordinated. To put the measured numbers into perspective: we are talking about a difference between 160 nanoseconds and 88 nanoseconds – not milliseconds, not even microseconds! No, nanoseconds! These are therefore overshadowed by any other parts of the code. (unless the script consists purely of millions of consecutive if queries). This decision therefore makes no relevant difference to the overall script. However, this makes the answer for this thread quite straightforward (as the others have already said): which of the two is used is independent of any performance considerations. The decision should be based solely on readability and clarity at the specific code location.
    5 points
  6. If every ounce of performance is really needed, then there are a few areas where optimization can be carried out to squeeze out a little more: #include <WinAPIProc.au3> Global $hUser32 = DllOpen('user32.dll') Global $hKernel32 = DllOpen('kernel32.dll') Global $hpsapi = DllOpen('psapi.dll') ; Run Notepad Run("notepad.exe") ; Wait up to 10 seconds for the Notepad window to appear. WinWait("[CLASS:Notepad]", "", 10) ; Retrieve the handle of the Notepad window using the classname of Notepad. Global $hWnd = WinGetHandle("[CLASS:Notepad]") ConsoleWrite("Notepad handle: " & $hWnd & @CRLF) ConsoleWrite("Notepad process: " & _WinAPI_GetWindowFileName3($hWnd) & @CRLF) ; time comparison Global Const $N = 1e4 Global $iT ConsoleWrite(@CRLF & " name time" & @CRLF & "---------------------------------------------" & @CRLF) ; the first measurement $iT = TimerInit() For $i = 1 To $N _WinAPI_GetWindowFileName($hWnd) Next $iT = TimerDiff($iT) ConsoleWrite(StringFormat("% 30s:\t%10.6f ms\n", "_WinAPI_GetWindowFileName ", ($iT) / $N)) ; the second measurement $iT = TimerInit() For $i = 1 To $N _WinAPI_GetWindowFileName2($hWnd) Next $iT = TimerDiff($iT) ConsoleWrite(StringFormat("% 30s:\t%10.6f ms\n", "_WinAPI_GetWindowFileName2", ($iT) / $N)) ; the third measurement $iT = TimerInit() For $i = 1 To $N _WinAPI_GetWindowFileName3($hWnd) Next $iT = TimerDiff($iT) ConsoleWrite(StringFormat("% 30s:\t%10.6f ms\n", "_WinAPI_GetWindowFileName3", ($iT) / $N)) ; close notepad WinKill($hWnd) Func _WinAPI_GetWindowFileName2($hWnd) Local Static $iNumChars = 512, $tBuff = DllStructCreate(StringFormat("wchar[%d]", $iNumChars)) Local $aCall = DllCall($hUser32, "dword", "GetWindowThreadProcessId", "hwnd", $hWnd, "dword*", 0) Local $iPID = $aCall[2] $aCall = DllCall($hKernel32, 'handle', 'OpenProcess', 'dword', 0x00001010, 'bool', 0, 'dword', $iPID) Local $hProc = $aCall[0] DllCall($hpsapi, 'dword', 'GetModuleBaseNameW', 'handle', $hProc, 'handle', 0, 'struct*', $tBuff, 'int', $iNumChars) $aCall = DllCall($hKernel32, "bool", "CloseHandle", "handle", $hProc) Return DllStructGetData($tBuff, 1) EndFunc Func _WinAPI_GetWindowFileName3($hWnd) Local $aCall = DllCall($hKernel32, 'HANDLE', 'OpenProcess', 'DWORD', 0x410, 'BOOL', 0, 'DWORD', WinGetProcess($hWnd)), _ $hProc = $aCall[0] $aCall = DllCall($hpsapi, 'DWORD', 'GetModuleBaseNameW', 'HANDLE', $hProc, 'HANDLE', 0, 'WSTR', '', 'INT', 65536) DllCall($hKernel32, "BOOL", "CloseHandle", "HANDLE", $hProc) Return $aCall[3] EndFunc Otherwise, the solutions presented so far completely lack reasonable error management. And if only this function needs the DLL handles, then the global variables could be bypassed by defining them directly in the function as local static variables instead.
    5 points
  7. 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/52f6eb0c5e6543777e19010a6c64f46e4dbe8fe0.zip I am still working on event support, but would like some feedback from the forum so far Thanks!
    4 points
  8. I compiled Zint v2.15.09 source and it has 30 functions! ZBarcode_BarcodeName|0x0001CBA0 ZBarcode_Buffer|0x0001CC20 ZBarcode_Buffer_Vector|0x0001CC60 ZBarcode_Cap|0x0001CCA0 ZBarcode_Clear|0x0001D270 ZBarcode_Create|0x0001D390 ZBarcode_Default_Xdim|0x0001D3C0 ZBarcode_Delete|0x0001D5D0 ZBarcode_Dest_Len_ECI|0x0001D630 ZBarcode_Encode|0x0001D6D0 ZBarcode_Encode_File|0x0001D710 ZBarcode_Encode_File_and_Buffer|0x0001DB00 ZBarcode_Encode_File_and_Buffer_Vector|0x0001DB50 ZBarcode_Encode_File_and_Print|0x0001DBA0 ZBarcode_Encode_Segs|0x0001DBE0 ZBarcode_Encode_Segs_and_Buffer|0x0001E890 ZBarcode_Encode_Segs_and_Buffer_Vector|0x0001E8F0 ZBarcode_Encode_Segs_and_Print|0x0001E950 ZBarcode_Encode_and_Buffer|0x0001E990 ZBarcode_Encode_and_Buffer_Vector|0x0001EA10 ZBarcode_Encode_and_Print|0x0001EA90 ZBarcode_HaveGS1SyntaxEngine|0x0001EAF0 ZBarcode_NoPng|0x0001EB00 ZBarcode_Print|0x0001EB10 ZBarcode_Reset|0x0001EC30 ZBarcode_Scale_From_XdimDp|0x0001ECA0 ZBarcode_UTF8_To_ECI|0x0001EE80 ZBarcode_ValidID|0x0001EF40 ZBarcode_Version|0x0001EF80 ZBarcode_XdimDp_From_Scale|0x0001EF90 I will update the code in the next days. I compiled also a x64 Zint DLL but I don't know if it is working yet...
    4 points
  9. You may have a look here: Or here (old):
    4 points
  10. Hey mate, Yeah so there's a bit you can do.. _WinAPI_GetWindowFileName calls a few things, which we can streamline if we're planning to call it 10000 times,. Func _WinAPI_GetWindowFileName($hWnd) Local $iPID = 0 Local $aCall = DllCall("user32.dll", "bool", "IsWindow", "hwnd", $hWnd) If $aCall[0] Then $aCall = DllCall("user32.dll", "dword", "GetWindowThreadProcessId", "hwnd", $hWnd, "dword*", 0) $iPID = $aCall[2] EndIf If Not $iPID Then Return SetError(1, 0, '') Local $sResult = _WinAPI_GetProcessFileName($iPID) If @error Then Return SetError(@error, @extended, '') Return $sResult EndFunc Func _WinAPI_GetProcessFileName($iPID = 0) If Not $iPID Then $iPID = @AutoItPID Local $hProcess = DllCall('kernel32.dll', 'handle', 'OpenProcess', 'dword', ((_WinAPI_GetVersion() < 6.0) ? 0x00000410 : 0x00001010), _ 'bool', 0, 'dword', $iPID) If @error Or Not $hProcess[0] Then Return SetError(@error + 20, @extended, '') Local $sPath = _WinAPI_GetModuleFileNameEx($hProcess[0]) Local $iError = @error DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $hProcess[0]) If $iError Then Return SetError(@error, 0, '') Return $sPath EndFunc Func _WinAPI_GetModuleFileNameEx($hProcess, $hModule = 0) Local $aCall = DllCall(@SystemDir & '\psapi.dll', 'dword', 'GetModuleFileNameExW', 'handle', $hProcess, 'handle', $hModule, _ 'wstr', '', 'int', 4096) If @error Or Not $aCall[0] Then Return SetError(@error + 10, @extended, '') Return $aCall[3] EndFunc Firstly I'd be using dll handles with DllOpen instead of using file names in DllCall, this should save open/closing Dlls all the time! That IsWindow call in GetWindowFilename is there as a sanity check. So if you're reasonably happy that you won't sent it rubbish, that can go. GetVersion doesn't need to be called 10000 times. 6.0 is Vista, so we probably don't really care about this anymore... but if you do - just call GetVersion once before your loop, or store it as a static or something. Use GetModuleBaseNameW instead of GetModuleFileNameExW - that will get you just the "notepad.exe" part of the process name We don't need to allocate the string buffer and free it 10000 times either (assuming the func returns a null-terminated string). Create a buffer once beforehand and just reuse it. #include <WinAPISysWin.au3> #include <WinAPIProc.au3> #include <Array.au3> #include <WinAPISys.au3> #include <File.au3> Global $maxruns = 10000 Global $hUser32 = DllOpen('user32.dll') Global $hKernel32 = DllOpen('kernel32.dll') Global $hpsapi = DllOpen('psapi.dll') ; Run Notepad Run("notepad.exe") ; Wait 10 seconds for the Notepad window to appear. WinWait("[CLASS:Notepad]", "", 10) Global $iPID = ProcessExists("notepad.exe") ; Retrieve the handle of the Notepad window using the classname of Notepad. Global $hWnd = WinGetHandle("[CLASS:Notepad]") ConsoleWrite("Notepad handle: " & $hWnd & @CRLF) Example3() Func Example3() Local $hTimer = TimerInit() For $i = 1 To $maxruns Local $test = _WinAPI_GetWindowFileName2($hWnd) Next Local $fDiff = TimerDiff($hTimer) ConsoleWrite("Timer: " & $fDiff & @CRLF) ConsoleWrite("_WinAPI_GetWindowFileName: " & $test & @CRLF) EndFunc Func _WinAPI_GetWindowFileName2($hWnd) Local Static $iNumChars = 512, $tBuff = DllStructCreate(StringFormat("wchar[%d]", $iNumChars)) Local $aCall = DllCall($hUser32, "dword", "GetWindowThreadProcessId", "hwnd", $hWnd, "dword*", 0) Local $iPID = $aCall[2] $aCall = DllCall($hKernel32, 'handle', 'OpenProcess', 'dword', 0x00001010, 'bool', 0, 'dword', $iPID) Local $hProc = $aCall[0] DllCall($hpsapi, 'dword', 'GetModuleBaseNameW', 'handle', $hProc, 'handle', 0, 'struct*', $tBuff, 'int', $iNumChars) $aCall = DllCall($hKernel32, "bool", "CloseHandle", "handle", $hProc) Return DllStructGetData($tBuff, 1) EndFunc Obviously you'll want to put some error checks back in, and clean up when you're done.. but you get the idea Edit: and the time comparison.. Notepad handle: 0x00000000005B0D40 Timer: 548.97 _WinAPI_GetWindowFileName2: Notepad.exe Timer: 1794.9062 _WinAPI_GetWindowFileName: C:\Program Files\WindowsApps\Microsoft.WindowsNotepad_11.2507.26.0_x64__8wekyb3d8bbwe\Notepad\Notepad.exe
    4 points
  11. You're perfectly right. Relevant neurons fixed!
    3 points
  12. 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
  13. @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
  14. So that means I am really getting too old for all of this. Sorry @rcmaehl for not staying up-to-date on the "street lingo".
    3 points
  15. 💡 Did You Know AutoIt’s Truthiness Rules Can Surprise You? Did you know that in AutoIt an empty string is considered False, but the string "0" is treated as True? Or that Not $variable might not behave the way you expect? 🔍 Understanding Logical Expression Evaluation in AutoIt When working with AutoIt, one subtle but important point is how values are converted and evaluated in logical expressions. 👉 AutoIt does have a dedicated Boolean type (True/False). True and False are not just integers — they belong to the Boolean type, as VarGetType(True) shows. However, AutoIt is a dynamically typed language and performs implicit type conversions. Numbers, strings, arrays, maps, and other data types can all be converted into a Boolean when required (e.g., in If or While statements). This is why Boolean behavior can sometimes look surprising if you expect stricter typing. 1️⃣ Boolean Values in AutoIt AutoIt defines two Boolean constants: True and False. Internally, they often behave like 1 and 0, but they are a separate data type. Example:   Local $v1 = True Local $v2 = False ConsoleWrite(VarGetType($v1) & " / " & VarGetType($v2) & @CRLF) ; Outputs: Boolean / Boolean Compare returning integers vs. Booleans:   Func retInt() Return 1 EndFunc Func retBool() Return True EndFunc ConsoleWrite(VarGetType(retInt()) & @CRLF) ; Int32 ConsoleWrite(VarGetType(retBool()) & @CRLF) ; Boolean 2️⃣ Truthiness Rules (Implicit Conversion) When a value is evaluated in a Boolean context (If, While, Not, etc.), AutoIt converts it to a Boolean according to fixed rules. "" (empty string) → False 0 (numeric) → False Any other non-empty string → True Any non-zero number → True But that’s not all. Other types can also convert to False: Empty array Empty map Default Ptr(0) Certain invalid DllStruct values Function pointers when not valid ✅ Examples:   If "" Then MsgBox(0, "Test", "This will NOT show") ; False If "hello" Then MsgBox(0, "Test", "This WILL show") ; True If 0 Then MsgBox(0, "Test", "This will NOT show") ; False If -1 Then MsgBox(0, "Test", "This WILL show") ; True Global $aArray[1] If $aArray Then MsgBox(0, "", "Array = True") ; Won’t show, empty array = False 3️⃣ What Does Not Do? The Not operator inverts the Boolean value of its operand.   ConsoleWrite(Not "" & @CRLF) ; 1 (True) ConsoleWrite(Not "abc" & @CRLF) ; 0 (False) ConsoleWrite(Not 0 & @CRLF) ; 1 (True) ConsoleWrite(Not 123 & @CRLF) ; 0 (False) 👉 In plain words: Not $variable = “is this variable empty, zero, or otherwise converted to False?” 4️⃣ Real Example: UDF _PathFull In the standard UDF File.au3, the function _PathFull contains this line:   If Not $sRelativePath Or $sRelativePath = "." Then Return $sBasePath This handles two cases: $sRelativePath is "" → return the base path. $sRelativePath is "." → return the base path (current directory). It works because AutoIt treats an empty string as False. 5️⃣ Common Pitfalls ❌ Pitfall 1: Thinking False is just 0   Local $x = False If $x Then MsgBox(0, "Result", "Will this show?") ; Will not run, but VarGetType(False) = Boolean, not Int32 ❌ Pitfall 2: Forgetting that "0" (string) is True   If "0" Then MsgBox(0, "Result", "This WILL show!") ; Non-empty string = True ; But numeric 0 would be False. ❌ Pitfall 3: Misunderstanding Not   Local $val = "hello" If Not $val Then MsgBox(0, "Result", "Will this show?") ; Never runs because "hello" converts to True EndIf ✅ Key Takeaways AutoIt has a Boolean type (True/False). In logical expressions, values of other types are implicitly converted to Boolean. Conversion rules: "" and 0 → False Empty array, empty map, Default, Ptr(0) and similar → False Everything else → True Not $var = “is this variable False after conversion?” 📝 Conclusion Understanding AutoIt’s implicit type conversion to Boolean is essential for writing reliable conditions. 👉 Pro Tip: Use implicit truthiness for quick checks, but when clarity matters, be explicit: Use StringLen() to check if a string is empty. Use =, <>, etc. for precise comparisons. Use VarGetType() to confirm whether you’re working with Boolean or another type. This ensures your intent is clear and avoids bugs caused by AutoIt’s flexible but sometimes surprising rules. 💬 Final Note: If I’ve misunderstood or overlooked something, please share your thoughts — I’d be happy to update and improve this article!
    3 points
  16. What exactly leads you to this conclusion? This cannot be deduced from your following text. All of this can be explained perfectly by the fact that there are specific rules for converting other data types to the Boolean data type. There is nothing explicitly against the existence of a corresponding dedicated Boolean data type. Nope - if that were the case, they would behave exactly the same way - but they don't: ConsoleWrite("compare with int type: " & ("0" = retInt() ? True : False) & @CRLF) ConsoleWrite("compare with bool type: " & ("0" = retBool() ? True : False) & @CRLF) Func retInt() Return 1 EndFunc Func retBool() Return True EndFunc The following are also converted to False during conversion to Boolean: Global $aArray[1] Global $mMap[] If $aArray Then MsgBox(0, "", "Array = True") If $mMap Then MsgBox(0, "", "Map = True") If ObjCreate("Scripting.Dictionary") Then MsgBox(0, "", "Object = True") If Default Then MsgBox(0, "", "Default = True") If Ptr(0x0) Then MsgBox(0, "", "Ptr(0) = True") If DllStructCreate("CHAR[1]") Then MsgBox(0, "", "DllStruct = True") If ConsoleWrite Then MsgBox(0, "", "Function pointer = True") Basically, this discussion only touches superficially on logical expressions in AutoIt. In fact, the behavior is only a consequence of the real topic: Implicit data type conversions in AutoIt: AutoIt (like many other languages) is a dynamically typed language. In other words, variables do not have a fixed data type; instead, this can be changed at will during the lifetime of the variable. Nevertheless, variables can be linked together as desired using operators. But internally, at the machine level, only identical data types can be linked together. For example, addition is only possible between two Int32s and not between a Double and an Int32, etc. Therefore, one task of the AutoIt interpreter in operations with multiple operands or when the operation requires a specific target data type is to align the different data types with each other. AutoIt defines fixed rules for how certain data types are converted into others. Integers, for example, are converted to floats by considering the value as the integer part of the resulting float. How exactly certain data types are converted to the Boolean data type (yes, Boolean is explicitly listed as a separate data type) is described in part in the >>AutoIt help<<. Specifically, it says the following, for example: This explains exactly the behavior you described above. And we're not even talking about logical expressions yet - it's just about implicit data type conversion. If you keep in mind that logical operators and the if branch must have the expression as a Boolean, it quickly becomes clear that this is not actually about the behavior of logical expressions, but rather that they are only a consequence of the implicit data type conversion of other data types to the Boolean data type. In summary: The behavior described above describes the effects of implicit conversion of other data types to the Boolean data type. Everything described can be explained completely by this. However, I do not see the slightest indication in the description that AutoIt should not have a dedicated boolean data type.
    3 points
  17. ioa747

    _CircularProgress

    I created _CircularProgress , with the idea of calling it as a single function. ; https://www.autoitscript.com/forum/topic/213118-_circularprogress/ ;---------------------------------------------------------------------------------------- ; Title...........: _CircularProgress.au3 ; Description.....: Creates a customizable circular progress bar using GDI+ graphics. ; AutoIt Version..: 3.3.16.1 Author: ioa747 Script Version: 0.8 ; Note............: Testet in Win10 22H2 Date:11/09/2025 ; Based on post ..: https://www.autoitscript.com/forum/topic/213118-_circularprogress/#findComment-1545797 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WinAPISysWin.au3> #include <WinAPIConstants.au3> #include <WindowsConstants.au3> _Example() ; as demo ;~ _Example2() ; as demo ;~ _Example3() ; as demo Func _Example() Local $aList[2000] Local $iCnt = UBound($aList) ConsoleWrite("$iCnt=" & $iCnt & @CRLF) Local $nProgress For $i = 1 To UBound($aList) $nProgress = Int($i / $iCnt * 100) ConsoleWrite($i & ") $nProgress=" & $nProgress & @CRLF) _CircularProgress($nProgress) Next Sleep(200) ; Give it some time to see the 100%. _CircularProgress(101) ; Clean up the progress bar window EndFunc ;==>_Example Func _Example2() Local $aList[2000] Local $iCnt = UBound($aList) Local $nProgress _CircularProgress(0, 300, @DesktopWidth * 0.8, @DesktopHeight * 0.3) For $i = 1 To UBound($aList) $nProgress = Int($i / $iCnt * 100) _CircularProgress($nProgress) Next For $i = 1 To 2 _CircularProgress($nProgress, Default, Default, Default, Default, 0xFFFFFFFF, 0xFF4CFF00, 0xFFF6FF00) Sleep(500) _CircularProgress($nProgress, Default, Default, Default, Default, 0xFFFFFFFF, 0xFFF6FF00, 0xFF4CFF00) Sleep(500) Next _CircularProgress(101) ; Clean up the progress bar window EndFunc ;==>_Example Func _Example3() Local $aList[2000] Local $iCnt = UBound($aList) ConsoleWrite("$iCnt=" & $iCnt & @CRLF) Local $nProgress _CircularProgress($nProgress, 300, -1, -1, 20, Default, Default, Default, 150) For $i = 1 To UBound($aList) $nProgress = Int($i / $iCnt * 100) _CircularProgress($nProgress) Next Sleep(500) ; Give it some time to show the 100%. _CircularProgress(101) ; Clean up the progress bar window EndFunc ;==>_Example ; #FUNCTION# ==================================================================================================================== ; Name...........: _CircularProgress ; Description....: Creates a customizable circular progress bar using GDI+ graphics. ; Syntax.........: _CircularProgress($iPercent [, $iSize = 300 [, $iLeft = -1 [, $iTop = -1 [, $iThickness = 20 [, $TextCol = 0xFFBFBFBF [, $StartCol = 0xFFFFFF00, $EndCol = 0xFFFF0000 [, $iBgTrans = 0]]]]]]]) ; Parameters.....: $iPercent - The percentage complete for the progress bar (0 to 100). ; $iSize - [optional] width and height of the circular progress bar. (Default is 300) ; $iLeft - [optional] X-coordinate of the top-left corner. (Default is -1 for center) ; $iTop - [optional] Y-coordinate of the top-left corner. (Default is -1 for center) ; $iThickness - [optional] Thickness of the progress arc. (Default is 20) ; $TextCol - [optional] Color of the text within the progress bar. (Default is Silver) ; $StartCol - [optional] Start color of the progress arc gradient. (Default is Yellow) ; $EndCol - [optional] End color of the progress arc gradient. (Default is Red) ; $iBgTrans - [optional] The transparency of background, a number in the range 0 - 255. (Default is 0) ; Return values .: Success: create the progress bar GUI ; Author ........: ioa747 , Thank to UEZ ; Modified ......: 11/09/2025 - v0.8 ; Remarks .......: Cleanup is handled automatically by passing an $iPercent > 100. ; Avoid using 0x050505 Color for $TextCol, $StartCol, or $EndCol, as it is used as a transparency color for the background. ; Related .......: _GDIPlus_Startup, _GDIPlus_GraphicsCreateFromHWND, etc. ; Link ..........: https://www.autoitscript.com/forum/topic/213113-simple-circular-progressbar-with-smooth-edges-gradient-color/#findComment-1545755 ; Example .......: _CircularProgress(50, 300, -1, -1, 23, 0xFFBFBFBF, 0xFFFFFF00, 0xFFFF0000) ; =============================================================================================================================== Func _CircularProgress($iPercent, $iSize = 300, $iLeft = -1, $iTop = -1, $iThickness = 23, $TextCol = 0xFFDCDCDC, $StartCol = 0xFFFFFF00, $EndCol = 0xFFFF0000, $iBgTrans = 0) Local Static $hGUI, $inSize, $inThickness, $iRadius, $iX, $iY, $BackCol, $bInit = False If Not $bInit Then _GDIPlus_Startup() $BackCol = "0x" & Hex($iBgTrans, 2) & "000000" $inSize = ($iSize < 40 ? 300 : $iSize) $inThickness = ($iThickness > ($inSize * 0.5) ? $inSize * 0.5 : ($iThickness < 2 ? 20 : $iThickness) ) $iRadius = ($inSize - 4) / 2 $iX = $inSize / 2 $iY = $iX $hGUI = GUICreate("RingProgressBar", $inSize, $inSize, $iLeft, $iTop, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOOLWINDOW, $WS_EX_TOPMOST)) GUISetState(@SW_SHOWNOACTIVATE) $bInit = True EndIf If $iPercent > 100 Then _GDIPlus_Shutdown() GUIDelete($hGUI) $bInit = False Return EndIf ; Create an off-screen bitmap for double-buffering Local Const $hBmp = _GDIPlus_BitmapCreateFromScan0($inSize, $inSize) Local Const $hBmpGraphics = _GDIPlus_ImageGetGraphicsContext($hBmp) _GDIPlus_GraphicsSetSmoothingMode($hBmpGraphics, 4) _GDIPlus_GraphicsSetTextRenderingHint($hBmpGraphics, 4) ; Draw arc backround Local Const $hbackround = _GDIPlus_BrushCreateSolid($BackCol) _GDIPlus_GraphicsFillEllipse($hBmpGraphics, $iX - $iRadius + 1, $iY - $iRadius + 1, ($iRadius * 2) - 2, ($iRadius * 2) - 2, $hbackround) _GDIPlus_BrushDispose($hbackround) ; Draw progress arc as pie Local $angle = ($iPercent / 100) * 360 Local Const $hBrushProg = _GDIPlus_LineBrushCreate($iX - $iRadius, $iY, $iX + $iRadius, $iY, $EndCol, $StartCol, 1) Local Const $hPen = _GDIPlus_PenCreate2($hBrushProg, $inThickness) _GDIPlus_GraphicsDrawArc($hBmpGraphics, $iX - $iRadius + $inThickness / 2, $iY - $iRadius + $inThickness / 2, _ $iRadius * 2 - $inThickness, $iRadius * 2 - $inThickness, -90, $angle, $hPen) _GDIPlus_BrushDispose($hBrushProg) ; Draw percentage text Local Const $hPath = _GDIPlus_PathCreate() Local Const $iFontSize = Int($iRadius * 0.33) Local Const $hFamily = _GDIPlus_FontFamilyCreate("Times New Roman") Local Const $hFormat = _GDIPlus_StringFormatCreate() Local Const $tLayout = _GDIPlus_RectFCreate($iX - $iFontSize * 1.5, $iY - $iFontSize * 0.5, $iFontSize * 3, $iFontSize) _GDIPlus_StringFormatSetAlign($hFormat, 2) Local Const $hBrushText = _GDIPlus_BrushCreateSolid($TextCol) _GDIPlus_PenSetColor($hPen, 0xF0404040) _GDIPlus_PenSetWidth($hPen, $iFontSize * 0.0381) _GDIPlus_PenSetLineJoin($hPen, 2) _GDIPlus_PathAddString($hPath, StringFormat("%d%", $iPercent), $tLayout, $hFamily, 1, $iFontSize, $hFormat) _GDIPlus_GraphicsDrawPath($hBmpGraphics, $hPath, $hPen) _GDIPlus_GraphicsFillPath($hBmpGraphics, $hPath, $hBrushText) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_PenDispose($hPen) _GDIPlus_BrushDispose($hBrushText) _GDIPlus_PathDispose($hPath) ; Create HBITMAP and display Local $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp) ;_WinAPI_BitmapDisplayTransparentInGUI($hHBmp, $hGUI) Local $iOpacity = 0xFF, $iFlags = $ULW_ALPHA, $bReleaseGDI = True, $tDest = Null, $iBGR = 0 If Not BitAND(GUIGetStyle($hGUI)[1], $WS_EX_LAYERED) = $WS_EX_LAYERED Then Return SetError(1, 0, 0) Local $tDim = DllStructCreate($tagBITMAP) If Not _WinAPI_GetObject($hHBmp, DllStructGetSize($tDim), DllStructGetPtr($tDim)) Then Return SetError(2, 0, 0) Local $tSize = DllStructCreate($tagSIZE), $tSource = DllStructCreate($tagPOINT), $tBlend = DllStructCreate($tagBLENDFUNCTION) Local Const $hScrDC = _WinAPI_GetDC(0), $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC), $hOld = _WinAPI_SelectObject($hMemDC, $hHBmp) $tSize.X = $tDim.bmWidth $tSize.Y = $tDim.bmHeight $tBlend.Alpha = $iOpacity $tBlend.Format = 1 _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, $tDest, $tSize, $hMemDC, $tSource, $iBGR, $tBlend, $iFlags) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteDC($hMemDC) If $bReleaseGDI Then _WinAPI_DeleteObject($hHBmp) ;Return True _GDIPlus_BitmapDispose($hBmp) _GDIPlus_GraphicsDispose($hBmpGraphics) EndFunc ;==>_CircularProgress Please, every comment is appreciated! leave your comments and experiences here! Thank you very much
    3 points
  18. argumentum

    EndIf "overhead"

    Global $iTimer, $iVariable = 1 For $tryNo = 1 To 3 Sleep(1000) $iTimer1 = TimerInit() For $A = 1 To 10000 If $iVariable Then $iVariable = 1 Next $iTimer1 = Round(TimerDiff($iTimer1), 1) ConsoleWrite("10,000 runs (single line If statement): " & @TAB & $iTimer1 & "ms" & @CRLF) $iTimer2 = TimerInit() For $A = 1 To 10000 If $iVariable Then $iVariable = 1 EndIf Next $iTimer2 = Round(TimerDiff($iTimer2), 1) ConsoleWrite("10,000 runs (If statement with EndIf): " & @TAB & @TAB & $iTimer2 & "ms" & @CRLF) $iDifference = Round(($iTimer1 - $iTimer2) / $iTimer2, 2) ConsoleWrite("Percentage Difference: " & @TAB & @TAB & @TAB & @TAB & @TAB & @TAB & $iDifference * 100 & "%" & @CRLF & @CRLF) Next Exit 10,000 runs (single line If statement): 40.5ms 10,000 runs (If statement with EndIf): 3.1ms Percentage Difference: 1206% 10,000 runs (single line If statement): 5.7ms 10,000 runs (If statement with EndIf): 3ms Percentage Difference: 90% 10,000 runs (single line If statement): 5.8ms 10,000 runs (If statement with EndIf): 3ms Percentage Difference: 93% I'll write what makes the code more readable. Anyone having to depend on this, needs to rethink their code. My 2 cents
    3 points
  19. UEZ

    _CircularProgress

    It looks ugly on my Notebook: You may use: Func _WinAPI_BitmapDisplayTransparentInGUI(ByRef $hHBitmap, ByRef $hGUI, $iOpacity = 0xFF, $iFlags = $ULW_ALPHA, $bReleaseGDI = True, $tDest = Null, $iBGR = 0) If Not BitAND(GUIGetStyle($hGUI)[1], $WS_EX_LAYERED) = $WS_EX_LAYERED Then Return SetError(1, 0, 0) Local $tDim = DllStructCreate($tagBITMAP) If Not _WinAPI_GetObject($hHBitmap, DllStructGetSize($tDim), DllStructGetPtr($tDim)) Then Return SetError(2, 0, 0) Local $tSize = DllStructCreate($tagSIZE), $tSource = DllStructCreate($tagPOINT), $tBlend = DllStructCreate($tagBLENDFUNCTION) Local Const $hScrDC = _WinAPI_GetDC(0), $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC), $hOld = _WinAPI_SelectObject($hMemDC, $hHBitmap) $tSize.X = $tDim.bmWidth $tSize.Y = $tDim.bmHeight $tBlend.Alpha = $iOpacity $tBlend.Format = 1 _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, $tDest, $tSize, $hMemDC, $tSource, $iBGR, $tBlend, $iFlags) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteDC($hMemDC) If $bReleaseGDI Then _WinAPI_DeleteObject($hHBitmap) Return True EndFunc ;==>_WinAPI_BitmapDisplayTransparentInGUI to get a proper display. See for an example. _WinAPI_SetLayeredWindowAttributes() only makes is ugly!
    3 points
  20. Play with the colors, angle and translations: ;AutoIt v3.3.9.21 or higher needed! ;coded by UEZ build 2013-10-13 #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() Global Const $STM_SETIMAGE = 0x0172 Global Const $iW = 300, $iH = 300 Global Const $hGUI = GUICreate("GDI+ Ring Progressbar", $iW, $iH, -1, -1, $WS_POPUPWINDOW, $WS_EX_TOPMOST) GUISetBkColor(0) Global Const $iPic = GUICtrlCreatePic("", 0, 0, $iW, $iH) ;~ GUICtrlSetState(-1, $GUI_DISABLE) GUISetState() Global $hHBmp_BG, $hB, $fPerc, $iSleep = 60 GUIRegisterMsg($WM_TIMER, "PlayAnim") DllCall("user32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", $iSleep, "int", 0) Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIRegisterMsg($WM_TIMER, "") _WinAPI_DeleteObject($hHBmp_BG) _GDIPlus_Shutdown() GUIDelete() Exit EndSwitch Until False Func PlayAnim() $hHBmp_BG = _GDIPlus_RingProgressbar($fPerc) $hB = GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBmp_BG) If $hB Then _WinAPI_DeleteObject($hB) _WinAPI_DeleteObject($hHBmp_BG) $fPerc += 0.33333 If $fPerc > 100 Then $fPerc = 0 EndFunc ;==>PlayAnim Func _GDIPlus_RingProgressbar($fPerc, $iSize = 300, $sText = "Please wait...") Local Const $hBmp = _GDIPlus_BitmapCreateFromMemory(_Background_Texture()) Local Const $hTexture = _GDIPlus_TextureCreate($hBmp) _GDIPlus_BitmapDispose($hBmp) Local Const $hBitmap = _GDIPlus_BitmapCreateFromScan0($iSize, $iSize) Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetPixelOffsetMode($hCtxt, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2) _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iSize, $iSize, $hTexture) If $fPerc < 0 Then $fPerc = 0 If $fPerc > 100 Then $fPerc = 100 Local Const $hPath = _GDIPlus_PathCreate(), $hPath2 = _GDIPlus_PathCreate(), _ $fRadius = $iSize / 1.5, $iX = ($iSize - $fRadius) / 2, $iY = ($iSize - $fRadius) / 2, _ $fDX = $iSize / 10, $fAngel = $fPerc * 360 / 100, $fSize = $iSize / 15 _GDIPlus_PathAddEllipse($hPath, $iX, $fDX + $iY, $fRadius, $fRadius) Local $hBrush = _GDIPlus_LineBrushCreate($iX, $fDX + $iY, $fRadius, $fRadius, 0, 0, 1) Local $aInterpolations[4][2] ;define the interpolated colors and positions $aInterpolations[0][0] = 3 $aInterpolations[1][0] = 0xFF800000 ;Red $aInterpolations[1][1] = 0 $aInterpolations[2][0] = 0xFFFF6700 ;Orange $aInterpolations[2][1] = 0.5 $aInterpolations[3][0] = 0xFFFFFF00 ;Yellow $aInterpolations[3][1] = 1.0 $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($hMatrix, $fRadius, $fRadius) _GDIPlus_MatrixRotate($hMatrix, -35, False) _GDIPlus_LineBrushMultiplyTransform($hBrush, $hMatrix, False) _GDIPlus_LineBrushSetPresetBlend($hBrush, $aInterpolations) _GDIPlus_MatrixDispose($hMatrix) Local Const $hPen = _GDIPlus_PenCreate2($hBrush, $fSize) _GDIPlus_GraphicsDrawPath($hCtxt, $hPath, $hPen) _GDIPlus_PathReset($hPath) Local Const $hPen2 = _GDIPlus_PenCreate2($hTexture, $fSize + 4) _GDIPlus_PathAddArc($hPath, $iX, $fDX + $iY, $fRadius, $fRadius, -90, $fAngel) _GDIPlus_GraphicsDrawPath($hCtxt, $hPath, $hPen2) _GDIPlus_PathReset($hPath) Local Const $hFamily = _GDIPlus_FontFamilyCreate("Verdana") Local Const $hFormat = _GDIPlus_StringFormatCreate() Local Const $tLayout = _GDIPlus_RectFCreate(0, $iSize / 12, $iSize, 0) Local Const $tLayout2 = _GDIPlus_RectFCreate(0, ($iSize + $iSize / 18) / 2, $iSize, 0) _GDIPlus_StringFormatSetAlign($hFormat, 1) Local Const $hBrush2 = _GDIPlus_BrushCreateSolid(0xE0FFFFFF) _GDIPlus_PenSetColor($hPen, 0x80000000) _GDIPlus_PenSetWidth($hPen, 4) _GDIPlus_PathAddString($hPath, $sText, $tLayout, $hFamily, 0, $iSize / 12, $hFormat) _GDIPlus_PathAddString($hPath, StringFormat("%02d%", $fPerc), $tLayout2, $hFamily, 0, $iSize / 9, $hFormat) _GDIPlus_GraphicsDrawPath($hCtxt, $hPath, $hPen) _GDIPlus_GraphicsFillPath($hCtxt, $hPath, $hBrush2) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_PenDispose($hPen) _GDIPlus_PenDispose($hPen2) _GDIPlus_BrushDispose($hBrush) _GDIPlus_BrushDispose($hBrush2) _GDIPlus_BrushDispose($hTexture) _GDIPlus_PathDispose($hPath) _GDIPlus_PathDispose($hPath2) _GDIPlus_GraphicsDispose($hCtxt) Local Const $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) Return $hHBmp EndFunc ;Code below was generated by: 'File to Base64 String' Code Generator v1.12 Build 2013-05-17 Func _Background_Texture($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Background_Texture $Background_Texture &= '/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAUEBAUEAwUFBAUGBgUGCA4JCAcHCBEMDQoOFBEVFBMRExMWGB8bFhceFxMTGyUcHiAhIyMjFRomKSYiKR8iIyL/2wBDAQYGBggHCBAJCRAiFhMWIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiL/wgARCAFoAWgDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAA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cMtO5Yc8p+5zpmlKe5R4m3Nza7gAvvqL4XFfPD3BTd1uNlpOINbO1fUHZyNTXMEDcbbYT9QKKvLDGVTs4RrK8VjPiDhF8xcNhSOWXjdRpNygV0g0Z/ma7tcGOVr3CpeZQS7+5QrvD3HDl+Zk/3L3FucZhYN4e41eTJDLbvuFptw6l5ydxO0queeo5b/MKrKuYYCunME3lwwwxbX/uYtOx8TTC8xsjgthZkv3FLhYg0orS4zLTpKDamY/5cDPGnnxAyImu4jWq13GxqjHZF4X8iYC3Tsl7y2rp17lqeDw8xxb/AAQMmtdyimVn45nHe4FM+eZWC7jk4lW8biYXUSuNX3ALo3/uZRS0XFTYNwSs1cE8b3UsMK3EGzwxLyrW9RYbrcd8bi5++ai8PqZPzLVmoiEK3Loa5HHuDbZ9RtM1vqO8Vm4tjJuO8xhxx8kqgXHm/Crn/9k=' Local $bString = Binary(_Base64Decode($Background_Texture)) If $bSaveBinary Then Local $hFile = FileOpen($sSavePath & "\Dark Texture 300x300.jpg", 18) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Background_Texture Func _Base64Decode($sB64String) Local $a_Call = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0) If @error Or Not $a_Call[0] Then Return SetError(1, 0, "") Local $a = DllStructCreate("byte[" & $a_Call[5] & "]") $a_Call = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $a, "dword*", $a_Call[5], "ptr", 0, "ptr", 0) If @error Or Not $a_Call[0] Then Return SetError(2, 0, "") Return DllStructGetData($a, 1) EndFunc ;==>_Base64Decode
    3 points
  21. pixelsearch, analytical and comprehensive as always, thank you very much The solution proposed by Danyfirex 🏆, in this particular post is completely functional #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GuiTab.au3> ;>> Target: C:\Program Files (x86)\AutoIt3\Examples\Helpfile\GUICtrlCreateTab.au3 If Not WinExists("My GUI Tab") Then Exit Local $hWnd = WinWait("My GUI Tab", "", 1) ConsoleWrite("$hWnd=" & $hWnd & @CRLF) Local $hCtrl = ControlGetHandle($hWnd, "", "SysTabControl321") ConsoleWrite("$hCtrl=" & $hCtrl & @CRLF) Local $hParentWnd = _WinAPI_GetParent($hCtrl) ConsoleWrite("$hParentWnd=" & $hParentWnd & @CRLF) ; Show number of tabs Local $iTabCnt = _GUICtrlTab_GetItemCount($hCtrl) ConsoleWrite("Number of tabs: " & $iTabCnt & @CRLF & @CRLF) Local $sItemText, $aItem ; Now is working !! For $x = 0 To $iTabCnt - 1 $aItem = _GUICtrlTab_GetItemEx($hCtrl, $x) $sItemText = $aItem[1] ConsoleWrite("$sItemText=" & $sItemText & @CRLF) Next Func _GUICtrlTab_GetItemEx($hWnd, $iIndex) If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) Local $tagTCITEMEx = $tagTCITEM & ";ptr Filler" ; strange the Filler is erased by TCM_GETITEM : MS Bug!!! If Not _WinAPI_InProcess($hWnd, $__g_hGUICtrl_LastWnd) Then ;x86 read remote x64 If (Not @AutoItX64) And (Not _WinAPI_IsWow64Process(DllCall("user32.dll", "dword", "GetWindowThreadProcessId", "hwnd", $hWnd, "dword*", 0)[2])) Then $tagTCITEMEx = StringReplace($tagTCITEMEx, "ptr", "INT64") EndIf ;x64 read remote x86 If (@AutoItX64) And (_WinAPI_IsWow64Process(DllCall("user32.dll", "dword", "GetWindowThreadProcessId", "hwnd", $hWnd, "dword*", 0)[2])) Then $tagTCITEMEx = StringReplace($tagTCITEMEx, "ptr", "ULONG") EndIf EndIf Local $tItem = DllStructCreate($tagTCITEMEx) DllStructSetData($tItem, "Mask", $TCIF_ALLDATA) DllStructSetData($tItem, "StateMask", BitOR($TCIS_HIGHLIGHTED, $TCIS_BUTTONPRESSED)) Local $tBuffer, $iMsg If _GUICtrlTab_GetUnicodeFormat($hWnd) Then $tBuffer = $__g_tTabBuffer $iMsg = $TCM_GETITEMW Else $tBuffer = $__g_tTabBufferANSI $iMsg = $TCM_GETITEMA EndIf Local $iRet = __GUICtrl_SendMsg($hWnd, $iMsg, $iIndex, $tItem, $tBuffer, True, 4, True) Local $aItem[4] $aItem[0] = DllStructGetData($tItem, "State") $aItem[1] = DllStructGetData($tBuffer, "Text") $aItem[2] = DllStructGetData($tItem, "Image") $aItem[3] = DllStructGetData($tItem, "Param") Return SetError($iRet = 0, 0, $aItem) EndFunc ;==>_GUICtrlTab_GetItem This way, I avoid having to make a helper script like a bridge, I just add the function. Mission accomplished. Thank you very much
    3 points
  22. @ioa747 Hi When you call _GUICtrlTab_GetItemText, then _GUICtrlTab_GetItem is called And _GuiCtrlTab_GetItem had issues as seen on Trac Ticket 3903 and in this post. In the post, @Danyfirex worked on this x86-x64 issue and maybe he could give an advice here if he got time ? Also I notice code in _GUICtrlTab_GetItem has been updated in new release 3.3.17.1 (beta) . Did you check your script with 3.3.17.1 , maybe it's solved with the new release ? Fingers crossed & good luck
    3 points
  23. MattyD

    WinRT - WinUI3

    To flesh this out a bit more - I attempted to recreate this example.. The XML looks like this... <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="3*"/> <ColumnDefinition Width="5*"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="2*"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Border Background="#2f5cb6"/> <Border Grid.Column ="1" Background="#1f3d7a"/> <Border Grid.Row="1" Grid.ColumnSpan="2" Background="#152951"/> <StackPanel Grid.Column="1" Margin="40,0,0,0" VerticalAlignment="Center"> <TextBlock Foreground="White" FontSize="25" Text="Today - 64° F"/> <TextBlock Foreground="White" FontSize="25" Text="Partially Cloudy"/> <TextBlock Foreground="White" FontSize="25" Text="Precipitation: 25%"/> </StackPanel> <StackPanel Grid.Row="1" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"> <TextBlock Foreground="White" FontSize="25" Text="High: 66°" Margin="0,0,20,0"/> <TextBlock Foreground="White" FontSize="25" Text="Low: 43°" Margin="0,0,20,0"/> <TextBlock Foreground="White" FontSize="25" Text="Feels like: 63°"/> </StackPanel> <Image Margin="20" Source="Assets/partially-cloudy.png"/> </Grid> Now last time out we were specifying our Row/Column definitions like this.. Local $tGridLen = DllStructCreate("align 1;double Value;ulong GridUnitType") $tGridLen.GridUnitType = $mGridUnitType["Star"] $pRowDef = _WinRT_ActivateInstance("Microsoft.UI.Xaml.Controls.RowDefinition") $tGridLen.Value = 2 IRowDefinition_SetHeight($pRowDef, $tGridLen) IVector_Append($pRowDefs, $pRowDef) The default interface for a "RowDefinition" is IRowDefinition - but it seems ActivateInstance doesn't put us there. So appending the object to the collection worked OK- the cells obviously appeared. But setting the height property was actually failing. So the learning is: If you're instantiating via ActivateInstance, you should always follow up with a _WinRT_SwitchInterface. Local $tGridLen = DllStructCreate("align 1;double Value;ulong GridUnitType") $tGridLen.GridUnitType = $mGridUnitType["Star"] $pRowDef = _WinRT_ActivateInstance("Microsoft.UI.Xaml.Controls.RowDefinition") _WinRT_SwitchInterface($pRowDef, $sIID_IRowDefinition) ;ADD THIS! $tGridLen.Value = 2 IRowDefinition_SetHeight($pRowDef, $tGridLen) IVector_Append($pRowDefs, $pRowDef) In this example, we have a few new controls: stackpanels - these work like grids, but the're 1-dimentional. (Edit: Well they have a width and height, but its just one row or one column of panels!) You don't need to assign a "grid spot" for the controls of a stackpanel though - they seem to appear in the order they were added in the IPanel::Children collection. Vectors do assign indexes to child items by memory - so I'd imagine if we shuffled items around via IVector, the GUI would probably follow suit (untested). textblocks - not much to be said about these. But at this point, I'll quickly mention that IFrameworkElement interface seems to look after most of the spatial things for a control (its margins, vertical and horizontal alignment, min/max sizing etc). And this is common across everything we've seen so far. Then we have an image - this one is a bit more interesting. You load it in with a URI, so for local storage we'll need to specify something like file:///C:/path/to/file.blah. Once you have yourself an uri object - we can bring the file in via a BitmapImage object. And finally we associate that with the UI object "controls.Image" Local $pURI_Fact = _WinRT_GetActivationFactory("Windows.Foundation.Uri", $sIID_IUriRuntimeClassFactory) Local $pImageURI = IUriRuntimeClassFactory_CreateWithRelativeUri($pURI_Fact, "file:///C:/FilePath/", "image.png") Local $pBitmap = _WinRT_ActivateInstance("Microsoft.UI.Xaml.Media.Imaging.BitmapImage") _WinRT_SwitchInterface($pBitmap, $sIID_IBitmapImage) IBitmapImage_SetUriSource($pBitmap, $pImageURI) Local $pImage = _WinRT_ActivateInstance("Microsoft.UI.Xaml.Controls.Image") _WinRT_SwitchInterface($pImage, $sIID_IImage) IImage_SetSource($pImage, $pBitmap) The loading is asynchronous, so if you need the dimensions of the source for example - those details are only available once the image is ready. If those properties are important we can register a delegate that will fire once the image is loded. Also, if the image fails to load, there's a delegate for that too... Local $pImgFailedDgte = _WinRT_CreateDelegate("ImageLoadFail") Local $iImgFailedDgteTkn = IBitmapImage_AddHdlrImageFailed($pBitmap, $pImgFailedDgte) ;Attempt to load image IBitmapImage_SetUriSource($pBitmap, $pImageURI) Func ImageLoadFail($pThis, $pSource, $pArgs) #forceref $pThis, $pSource, $pArgs ConsoleWrite("Image failed to load!" & @CRLF) EndFunc Final point on this example, I've tied the content bridge's size (the container encompassing the xaml controls) to the Windows WM_SIZE message. Case $WM_SIZE $tRect.Width = BitAND(0xFFFF, $lParam) $tRect.Height = BitShift($lParam, 16) IDesktopSiteBridge_MoveAndResize($pBridge, $tRect) $iReturn = _WinAPI_DefWindowProcW($hWnd, $iMsg, $wParam, $lParam) And resizing the window actually works remarkably well. I guess I was expecting some flicker or something- so that was a pleasant surprise! WindowTest Grid.zip
    3 points
  24. ; https://www.autoitscript.com/forum/topic/213213-text-in-gdi-images-loses-transparency/#findComment-1546336 #include <WinAPIConstants.au3> #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPISysWin.au3> _GDIPlus_Startup() Global $iW, $iH, $hImage, $hGUI $hImage = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\cart.png") $iW = _GDIPlus_ImageGetWidth($hImage) $iH = _GDIPlus_ImageGetHeight($hImage) $hGUI = GUICreate("", $iW, $iH, -1, -1, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST, $WS_EX_LAYERED)) GUISetState() _add_TEXT_to_IMG($hImage, String(5), 58, 5) ; Convert the MODIFIED GDI+ image to HBITMAP Local $hBitmapToDisplay = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) ; Display the new HBITMAP transparently _WinAPI_BitmapDisplayTransparentInGUI($hBitmapToDisplay, $hGUI) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Cleanup ; _WinAPI_BitmapDisplayTransparentInGUI already deleted $hBitmapToDisplay _GDIPlus_BitmapDispose($hImage) _GDIPlus_Shutdown() GUIDelete() Func _add_TEXT_to_IMG(ByRef $hImage, $sText, $iX = 5, $iY = 70, $sFontName = "Arial", $fSize = 5, $fStyle = 1, $iColor = 0xFFFFFFFF) Local Const $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage) _GDIPlus_GraphicsSetSmoothingMode($hGraphic, 4) _GDIPlus_GraphicsSetTextRenderingHint($hGraphic, 3) Local Const $hBrush = _GDIPlus_BrushCreateSolid($iColor) Local Const $hFormat = _GDIPlus_StringFormatCreate() ;~ _GDIPlus_StringFormatSetAlign($hFormat, 1) ; Center text horizontally _GDIPlus_StringFormatSetAlign($hFormat, 0) ; Left Align for better text control Local Const $hFamily = _GDIPlus_FontFamilyCreate($sFontName) Local Const $hFont = _GDIPlus_FontCreate($hFamily, $fSize, $fStyle) Local Const $aDim = _GDIPlus_ImageGetDimension($hImage) ;~ Local Const $tLayout = _GDIPlus_RectFCreate($iX, $iY, $aDim[0], $aDim[1]) Local Const $tLayout = _GDIPlus_RectFCreate($iX, $iY, $aDim[0] - $iX, $aDim[1] - $iY) ; Adjusted layout for better text control _GDIPlus_GraphicsDrawStringEx($hGraphic, $sText, $hFont, $tLayout, $hFormat, $hBrush) _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGraphic) EndFunc ;==>_add_TEXT_to_IMG Func _WinAPI_BitmapDisplayTransparentInGUI(ByRef $hHBitmap, ByRef $hGUI, $iOpacity = 0xFF, $bReleaseGDI = True) ; (by @UEZ) If Not BitAND(GUIGetStyle($hGUI)[1], $WS_EX_LAYERED) = $WS_EX_LAYERED Then Return SetError(1, 0, 0) Local $tDim = DllStructCreate($tagBITMAP) If Not _WinAPI_GetObject($hHBitmap, DllStructGetSize($tDim), DllStructGetPtr($tDim)) Then Return SetError(2, 0, 0) Local $tSize = DllStructCreate($tagSIZE), $tSource = DllStructCreate($tagPOINT), $tBlend = DllStructCreate($tagBLENDFUNCTION) Local Const $hScrDC = _WinAPI_GetDC(0), $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC), $hOld = _WinAPI_SelectObject($hMemDC, $hHBitmap) $tSize.X = $tDim.bmWidth $tSize.Y = $tDim.bmHeight $tBlend.Alpha = $iOpacity $tBlend.Format = 1 _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, DllStructGetPtr($tSize), $hMemDC, DllStructGetPtr($tSource), 0, DllStructGetPtr($tBlend), $ULW_ALPHA) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteDC($hMemDC) If $bReleaseGDI Then _WinAPI_DeleteObject($hHBitmap) Return True EndFunc ;==>_WinAPI_BitmapDisplayTransparentInGUI
    2 points
  25. 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
  26. .. a bit off-topic. Did you try "My fine tuned High Contrast theme editor" ? Bet you'll enjoy it . Edit: a full screen. I think I can get used to this Win95 theme.
    2 points
  27. 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
  28. 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.2.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=b #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 <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.82 build 2025-09-09 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 #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 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 = 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_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, $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) 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 $iTrayAbout = TrayCreateItem("About") TrayCreateItem("") Global Const $iTrayExit = TrayCreateItem("Exit") If RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Run", "Toolbar Desktop") = '"' & @ScriptDir & '\Toolbar Desktop.exe"' Then TrayItemSetState($iTrayAutostart, $TRAY_CHECKED) Global $hTmp, $hBMP_Restart, $hBMP_About, $hBMP_Exit, $hBMP_Check, $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_About, $hBMP_About) _GUICtrlMenu_SetItemBitmaps($hMenu_Tray, 4, $hBMP_Exit, $hBMP_Exit) 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 Then DarkMode($hGUI) 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 $iTrayAbout About() Case $iTrayExit _Exit() EndSwitch Until False 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) ;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 Func _Exit() $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 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 Return $CDRF_NOTIFYITEMDRAW Case $CDDS_ITEMPREPAINT If $dwItemSpec = $iHot Then $tNMLVCUSTOMDRAW.ClrText = $iLVTxtColor $tNMLVCUSTOMDRAW.ClrTextBk = 0x98FF98 Else ; Other rows $tNMLVCUSTOMDRAW.ClrText = $iLVTxtColor $tNMLVCUSTOMDRAW.ClrTextBk = $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+fab5woecfBgaubBKWOYJo8xCtFSlSI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+67/7EW35iTrutKMpUmN5GEk0iEz8lMoGBFhJLnY/KUBjz68P2Y3Xw7lFIwxuDCxU+x/8Ah7PxwH5gZuWw2TtTcjCESSIdYA8/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 &= 'i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F4yLWvU7MIiiRJWFhYgG3bkCQpsoQq6iBLqSiKOHXqVAMYYb4FnScJ2t6k24tR4sVWHoZds6vPUn2C0KBrsR+S4/WTtiDG+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,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oBsWwBlJzjNMl4mr9EYORc5JekZBwq+iOhKwg6DX5nwalrNKj7pZzzEeYR/sQSH/cW/wV+wRAph4vY0tqKsb75WZacUhQ8sTZE7+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 &= 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAADAFBMVEVHcEwAAQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAgQAAQIAAAAERo4AAAAAAAAERo4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LTov2BIDotvRIiEJOY6AxEt5ITd1wAC6RFO4FUOHWunDLlM0jAQNcYaIiR8ZmLx46d+cLAoGuQF+Rzw8cnSNvg/n2QFt1op7AUS8uUMKfoV8/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/YALfL8ro7odUMApzAfQr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oibUqwCW8+Byu+/5BAC/8IP7+55zzwDvd+79nnNqygAYxBzuooGD4AAvoI13WMexPgAwjw1Mo16w1wDDth4f7YnnWADUPxZjT9dgEwBOj4k0aD1J8wAXXnfZdB4D4QCT4zuu4jK2OwAX0EocBnAzngDh4B7hYayHMQBUCNzCYBUHuwCaGIZwCx8wGwBcDVWsL4V/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 &= 'lbkAiVBORw0KGgoAAAAADUlIRFIlAHAUARgIBgAojYkAHQ0AAALyelQAWHRSYXcgcHIAb2ZpbGUgdHkAcG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A/w8ADwBPBi8BDwAPAA8ADwABAwCssTogAAAKAUBdAK3JCjwAP3hwYWNrZXQAIGVuZD0idyIAPz4l53wHAAAAAAZiS0dEAP8hQQCgvaeTQAQJcIBIWXMAAAsTwQAgAQCanBgABQd0AElNRQfnBw0NAAA12bTSJwAAAAERSURBVDjLALXUvUrDUBQAAODPmqV2cRDcAESk1MHBRxBcAHwDcVYRurnbAMlJVHyBgiKuAPoADn0AH8BFAKEWN59A/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 &= 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAUCAYAAACEYr13AAAACXBIWXMAAAsSAAALEgHS3X78AAADgklEQVQ4jYWS3UssZRzHv888zz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LnPNFQggXQuDq6kqsra39XqlUVsijT6SUUs45Z4wplFJOCJEJITSOYxpFkRqG4Z1kMnmPc657nvdzs9n8Ughx+heduWqeDdOyegAAAABJRU5ErkJggg==' 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_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P8FAPvw4OH/3pMdCjstAwF7A3v9j3/mpSv/5J8gHP/jnhuAhRr/BOKbgQEZ/+KaGBD/+/Pjhn/9+fBw/+GaI/9//z/KJO8Ay4D/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/DABzMAwIlGCFBQUGg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8ADwAPAA8ADwD/DwAPAA8ADwAPAA8ADwAPABcPAAMA0R5EgJoQsQIBMB8QAOmkYS6PABefD/YJvwaPAAW+BMkDhQHCAAB5AGEAIAATAAAMAKSmbTyxAB5bFPoMygg+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 #EndRegion #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 &= 'DrkAUFNJRAACAHwAAAAQABADAAEDABAAAFVuaWNvcoBuZm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ZgPAWCAwKMCQgPYAAgMIBAAGVwV3yrhpAGmZbXkAAgULwBcjJigAATAIIAhgAAEFBwfhfQQA8SMEAOtnEABAsAFABQGgAAQDoHAoBQEEAgEABgME/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 ;---------------------------------------------------------------------------------------- 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
  29. experimentally: #include <GUIConstantsEx.au3> #include <WinAPIGdi.au3> #include <WindowsConstants.au3> #include <WinAPIEx.au3> #include <Timers.au3> Global $hGUI, $idColor1, $idColor2, $idColor3 Example() Func Example() ; Create a GUI. $hGUI = GUICreate("HLS Rainbow Controls Example", 500, 300, -1, -1, $WS_POPUP) $idColor1 = GUICtrlCreateLabel("", 0, 0, 500, 30, -1, $GUI_WS_EX_PARENTDRAG) $idColor2 = GUICtrlCreateLabel("", 0, 100, 500, 30) $idColor3 = GUICtrlCreateLabel("", 0, 200, 500, 30) Local $idBtn = GUICtrlCreateButton("CLOSE", 400, 250, 85, 30) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; set timer to check every nnn Local $i_TimerInterval = 40 _Timer_SetTimer($hGUI, $i_TimerInterval, "_TimerCheck") ; Register the time-based color update function. AdlibRegister("RandomColorViaTimer", 40) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idBtn ExitLoop EndSwitch DoBorder() WEnd ; Cleanup ConsoleWrite("Killed All Timers? " & _Timer_KillAllTimers($hGUI) & @CRLF) AdlibUnRegister("RandomColorViaTimer") GUIDelete($hGUI) EndFunc ;==>Example Func RandomColorViaTimer() Local Const $iHueSpeed = 3 Local Const $iMaxHLS = 240 Local Const $iLuminance = 120 Local Const $iSaturation = 240 Local Static $iHue = 0 Local Static $hTimer = TimerInit() ; Calculate Hue $iHue = Mod($iHue + $iHueSpeed, $iMaxHLS) ; Time for a full Hue cycle If $iHue = 0 Then ConsoleWrite("<< << << Adlib: Time for a full Hue cycle: " & Round(TimerDiff($hTimer) / 1000, 3) & " seconds >> >> >>" & @LF) $hTimer = TimerInit() EndIf ; Convert HLS (0-240) to RGB Local $iColorRef = _WinAPI_ColorHLSToRGB($iHue, $iLuminance, $iSaturation) Local $sRGB = '0x' & Hex(_WinAPI_ColorHLSToRGB($iHue, $iLuminance, $iSaturation), 6) ; Apply Colors GUICtrlSetBkColor($idColor1, $sRGB) Local $sRef = _ColorRef($sRGB) ConsoleWrite("Adlib: " & $sRef & @CRLF) EndFunc ;==>RandomColorViaTimer ; Timer call back function Func _TimerCheck($hWnd, $iMsg, $iIDTimer, $iTime) #forceref $hWnd, $iMsg, $iIDTimer, $iTime Local Const $iHueSpeed = 3 Local Const $iMaxHLS = 240 Local Const $iLuminance = 120 Local Const $iSaturation = 240 Local Static $iHue = 160 Local Static $hTimer = TimerInit() ; Calculate Hue (reverse to fit with DoBorder) $iHue -= $iHueSpeed If $iHue < 0 Then $iHue = $iMaxHLS ; Time for a full Hue cycle If $iHue = $iMaxHLS Then ConsoleWrite("<< << << Timer: Time for a full Hue cycle: " & Round(TimerDiff($hTimer) / 1000, 3) & " seconds >> >> >>" & @LF) $hTimer = TimerInit() EndIf ; Convert HLS (0-240) to RGB Local $iColorRef = _WinAPI_ColorHLSToRGB($iHue, $iLuminance, $iSaturation) Local $sRGB = '0x' & Hex(_WinAPI_ColorHLSToRGB($iHue, $iLuminance, $iSaturation), 6) ; Apply Colors GUICtrlSetBkColor($idColor2, $sRGB) Local $sRef = _ColorRef($sRGB) ConsoleWrite("Timer: " & $sRef & @CRLF) EndFunc ;==>_TimerCheck Func DoBorder() Local Const $fSpeed = 4 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 $hTimer1 = 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) ConsoleWrite("<< << << Bordr: Time for a full Hue cycle: " & Round(TimerDiff($hTimer1) / 1000, 3) & " seconds >> >> >>" & @LF) $hTimer1 = TimerInit() EndIf ;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)) GUICtrlSetBkColor($idColor3, $iRGB) Local $sRef = _ColorRef($iRGB) ConsoleWrite("Bordr: " & $sRef & @CRLF) EndFunc ;==>DoBorder Func _ColorRef($sRGB) ; Optionaly RGB analysis Local $iHue, $iLuminance, $iSaturation _WinAPI_ColorRGBToHLS($sRGB, $iHue, $iLuminance, $iSaturation) Local $R = _WinAPI_GetRValue($sRGB) Local $G = _WinAPI_GetGValue($sRGB) Local $B = _WinAPI_GetBValue($sRGB) Local $iAutoItColor = _WinAPI_RGB($R, $G, $B) Local $sHexColor = "0x" & Hex($iAutoItColor, 6) Local $sRef = "HLS(" & $iHue & "," & $iLuminance & "," & $iSaturation & ") => RGB(" & $R & "," & $G & "," & $B & ") => " & $sHexColor Return $sRef EndFunc ;==>_ColorRef
    2 points
  30. 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
  31. 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
  32. @Resiak1811 Hi For the record, as soon as "beta - autoit-v3.3.15.1 (Map management)" was released on May 2020, then the listbox wouldn't appear over your listview #2 (tested) . Probably Jon changed some internal behavior starting 3.3.15.1 If you want your 1st script to run on AutoIt 3.3.16.1 (and probably on 3.3.18.0) then this simple change should do it : ; $Title2 = GUICtrlCreateListView("1 col|2 col|3 col|4 col|5 col", 5, 151, 610, 175, $LVS_NOCOLUMNHEADER) $Title2 = GUICtrlCreateListView("1 col|2 col|3 col|4 col|5 col", 5, 151, 610, 175, BitOr($LVS_NOCOLUMNHEADER, $WS_CLIPSIBLINGS)) Tested on AutoIt 3.3.16.1 : it works fine when $WS_CLIPSIBLINGS is present, it doesn't work without it (on 3.3.16.1) To be compatible with any AutoIt version, here are the 5 include files I used : #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GuiListBox.au3> #include <GuiListView.au3> #include <WindowsConstants.au3> Its not the 1st time this $WS_CLIPSIBLINGS style solves issues when controls overlap, let's hope it will solve your issue too, fingers crossed !
    2 points
  33. f in C# means float, but you are treating them as Hex. So it's just $t =$Hue * 6 in AU3, removing the f.
    2 points
  34. FadeSoft

    AutoIt Snippets

    This script forces all new and existing tray icons in Windows 11 to always show on the taskbar (instead of being hidden in the overflow). It does this by running a PowerShell command that sets the IsPromoted registry value for every app under HKCU:\Control Panel\NotifyIconSettings to 1, then restarts Explorer so changes take effect. You must compile this script if you want to run it every reboot. $Startup = @StartupDir & "\" & @ScriptName If Not FileExists($Startup) Then     FileCopy(@ScriptFullPath, $Startup, 1) EndIf Run(@ComSpec & " /c powershell -NoProfile -Command ""Get-ChildItem 'HKCU:\Control Panel\NotifyIconSettings' | ForEach-Object { Set-ItemProperty -Path $_.PsPath -Name IsPromoted -Value 1 }""", "", @SW_HIDE)
    2 points
  35. it is fix for the next delivery
    2 points
  36. Oh no. I love these AI things. I run one at home. I Always start with a smiley to set the tone ( is a thinking model ) and treated as if a human. In translations is very considerate of the tone and how the translation is perceived. And as stupid as it may be, I always thank it when it finished a task. Even if it wont remember. Alright then. Your idea was shit. And I don't want to sound hostile but .... I follow your doings with admiration since a long time now. This one post is astonishingly nonsensical. Looks beautiful. I wish the claims were real just to admire its beauty, but is horseshit. Worst of all, new users may find it awesome.. and does leaves one in awe, but is gravely misleading and that is my big problem with the post. Is so easy for a human LLM ( you or me or anyone ) to be mesmerized by the AI output that one is just enamored with it and without much judgment justify it, take it in and believe !, this irrational LLM. These AI can make an excellent politician Yes, my big problem with this post is how beautifully misleading it is. I'd say that it, is diabolical ( in a very innocent way ). These AI are innocent and that is a problem. Associating words is a lot of what we humans do, but this neuro-LLM-thigs are justifying what they came to conclude and sounds convincing but ... they are innocent yet, deceptive. As any court judge, I too blame the "orchestrator". You read proof the text before posting, and posted anyway. The post is detrimental. I would say, "thank you all, I stand corrected" and delete the post ( via a moderator, move it to test ? ). @Trong, I sill hold you in high regard ( I'd say I love you instead, but I fear @Somerset's take on my speech ) All this is no big deal. Wrong, very wrong, but "no big deal"
    2 points
  37. New version available.
    2 points
  38. UDF and DLL updated! See post#1. The DLLs are too big to post it here. You can find it on my 1Drv! Feel free to post examples here!
    2 points
  39. #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <ComboConstants.au3> Local $hGUI = GUICreate("COMBOBOX", 500, 500) GUISetBkColor(0xE9E6DF) Local $idBttnFocus = GUICtrlCreateButton("=P", -20, -20, 5, 5) ; my trick Local $idComboBox = GUICtrlCreateCombo("Item 1", 100, 200, 260, 20, $CBS_DROPDOWNLIST) GUICtrlSetFont(-1, 18, 700, 0, "Segoe UI", 4) GUICtrlSetData($idComboBox, "COMBOBOX|COMBOBOX1|COMBOBOX2|COMBOBOX3", "COMBOBOX") ; WildByDesign ;~ Global Const $WM_CHANGEUISTATE = 0x0127 ;~ GUICtrlSendMsg($idComboBox, $WM_CHANGEUISTATE, 65537, 0) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI) ..am a bit late but, this is what I use.
    2 points
  40. I just came across some odd behavior when automating a third party software app. On this third party app, there's a dialog with an edit control where you can enter an ID number that's 9 digits long. As soon as you enter the 9th digit the app immediately checks to see if it recognizes the ID as being an existing customer and if it does, it pops up a modal Yes/No window asking if you want to autofill the customer's information on the rest of the dialog. This popup correctly occurs whether my AutoIt app fills the edit control with 9 digits using ControlSetText or ControlSend. My AutoIt app needs to know whether the popup happens in order to determine its next action, so I follow the ControlSetText or ControlSend with a WinWait call looking for the popup, with a 2 second timeout. Here's where the odd behavior comes. If I fill the edit control using ControlSetText and the popup window appears, my WinWait doesn't start looking for the popup window until after the user has clicked Yes or No on it (and thereby dismissed the window). The AutoIt app just sits there idle the entire time that the Yes/No window is visible. Then as soon as the user clicks Yes or No (and dismisses the modal window), the WinWait immediately begins looking for that (now dismissed) window and of course never finds it. If I instead fill the edit control with ControlSend, AutoIt doesn't hang while the Yes/No window is visible, and WinWait immediately finds the window as expected. My guess is that the 3rd party app is popping up the modal Yes/No window before the original dialog can provide the return code from ControlSetText's underlying SendMessage command (probably due to some improper subclassing in the 3rd party app that shows the popup dialog before allowing the WndProc function to complete its operation and return a value). As a result, AutoIt is left sitting there waiting for that message before the ControlSetText function completes and it can move on to the next line of the script. Once the user dismisses the modal Yes/No window and the original dialog can continue, the return code gets received by AutoIt, the ControlSetText command finishes, and the script continues. With the ControlSend command, AutoIt apparently doesn't get stuck waiting for a return message, and can proceed with finding the window and acting accordingly. So I'm not looking for a solution, since using ControlSend is the workaround. Just posting here in case someone else comes across something similar and is banging their head on the keyboard as I was.
    2 points
  41. May you release it on github.com ? Then we be able to look over enttire udf and have a better look
    2 points
  42. argumentum

    MustReturnArray()

    #include <WinAPIProc.au3> ; for the example Func MustReturnArray($aArray, $iColumns = 0, $iErr = @error, $iExt = @extended) If UBound($aArray) Then Return SetError($iErr, $iExt, $aArray) If $iColumns Then Dim $aArray[1][$iColumns] = [[0]] Else Dim $aArray[1] = [0] EndIf Return SetError($iErr, $iExt, $aArray) EndFunc ;==>MustReturnArray Exit MustReturnArray_Example() Func MustReturnArray_Example() ; worry free return Local $aWinList = WinList("nah, is not there") For $n = 1 To $aWinList[0][0] ConsoleWrite($aWinList[$n][1] & @TAB & $aWinList[$n][0] & @CRLF) Next ; worry free return Local $aProcessList = ProcessList("nah, is not there") For $n = 1 To $aProcessList[0][0] ConsoleWrite($aProcessList[$n][1] & @TAB & $aProcessList[$n][0] & @CRLF) Next ; solution ; create a "worry free return" Local $aArray = MustReturnArray(_WinAPI_EnumProcessWindows(4), 2) For $n = 1 To $aArray[0][0] ConsoleWrite($aArray[$n][1] & @TAB & $aArray[$n][0] & @CRLF) Next ; problem ; not a "worry free return" Local $aArray = _WinAPI_EnumProcessWindows(4) For $n = 1 To $aArray[0][0] ConsoleWrite($aArray[$n][1] & @TAB & $aArray[$n][0] & @CRLF) Next EndFunc ;==>MustReturnArray_Example Before I start with my problem ( and solution ), a big thank you to everyone coding these UDFs. AutoIt would not be what it is without them. ... a coder should always check @error, but is a pain, or not. In any case, the internal AutoIt functions return an array even if nothing there when an array is what it returns on success. Am so used to it, that when I use a UDF function I have to RTFM and I don't like reading ( nor writing but here we are 🤷‍♂️ ) How should I solve this problem given my coding style that does not include a failing function returning a zero stead of the array I was expecting. AutoIt does it, why does the UDFs not do it ?, ... must be a professional coders thing but, am a scripter. I write scripts. So, if it should return an array, then MustReturnArray() !. I hope this idea/function helps you avoid the " ==> Subscript used on non-accessible variable. " and/or simplify your code
    2 points
  43. argumentum

    EndIf "overhead"

    ..perhaps.. . Perhaps is good. Not because one of your questions did not bring the house down, or you were right or not about making a big deal out of, something. Is good, is all good. So keep asking if there is a question. I enjoy the threads even if I don't have either time, or anything to contribute to it. This if-then-else thing, ...I had no idea, nor ever came up in my brain. Thinking about it, at times I use Switch as an If when is practical ( I don't care much about speed or memory with today's hardware )
    2 points
  44. @argumentum @WildByDesign checked, as you say, this effect does not work in virtualized mode, thanks for trying it. and in the local environment 24h2 by inertia deactivate the transfer effect, it was the one that caused the detail
    2 points
  45. UEZ

    _CircularProgress

    To use _WinAPI_BitmapDisplayTransparentInGUI() you must create a complete frame within the function. Example: ; https://www.autoitscript.com/forum/topic/213118-_circularprogress/ ;---------------------------------------------------------------------------------------- ; Title...........: _CircularProgress.au3 ; Description.....: Creates a customizable circular progress bar using GDI+ graphics. ; AutoIt Version..: 3.3.16.1 Author: ioa747 Script Version: 0.5 ; Note............: Testet in Win10 22H2 Date:08/09/2025 ; Based on post ..: https://www.autoitscript.com/forum/topic/213113-simple-circular-progressbar-with-smooth-edges-gradient-color/#findComment-1545755 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WinAPISysWin.au3> #include <Constants.au3> #include <WindowsConstants.au3> #include <WinAPIConstants.au3> #include <Array.au3> _GDIPlus_Startup() Global $hGUI _Example() ; as demo _GDIPlus_Shutdown() Func _Example() $hGUI = GUICreate("RingProgressBar", 300, 300, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST)) GUISetState(@SW_SHOW) Local $aList[2000] Local $iCnt = UBound($aList) ConsoleWrite("$iCnt=" & $iCnt & @CRLF) Local $nProgress For $i = 1 To UBound($aList) $nProgress = Int($i / $iCnt * 100) ConsoleWrite($i & ") $nProgress=" & $nProgress & @CRLF) _CircularProgress($nProgress) Next Sleep(200) ; Give it some time to see the 100%. EndFunc ;==>_Example ; #FUNCTION# ==================================================================================================================== ; Name...........: _CircularProgress ; Description....: Creates a customizable circular progress bar using GDI+ graphics. ; Syntax.........: _CircularProgress($iPercent [, $iLeft = -1 [, $iTop = -1 [, $iSize = 300 [, $iThickness = 30 [, $TextCol = 0xFFFFFF [, $StartCol = 0xFF0000, $EndCol = 0xFFFF00]]]]]]) ; Parameters.....: $iPercent - The percentage complete for the progress bar (0 to 100). ; $iLeft - [optional] X-coordinate of the top-left corner. (Default is -1 for center) ; $iTop - [optional] Y-coordinate of the top-left corner. (Default is -1 for center) ; $iSize - [optional] width and height of the circular progress bar. (Default is 300) ; $iThickness - [optional] Thickness of the progress arc. (Default is 30) ; $TextCol - [optional] Color of the text within the progress bar. (Default is White) ; $StartCol - [optional] Start color of the progress arc gradient. (Default is Yellow) ; $EndCol - [optional] End color of the progress arc gradient. (Default is Red) ; Return values .: Success: create the progress bar GUI ; Author ........: ioa747 ; Modified ......: 08/09/2025 - v0.5 ; Remarks .......: Cleanup is handled automatically by passing an $iPercent > 100. ; Avoid using 0x050505 Color for $TextCol, $StartCol, or $EndCol, as it is used as a transparency color for the background. ; Related .......: _GDIPlus_Startup, _GDIPlus_GraphicsCreateFromHWND, etc. ; Link ..........: https://www.autoitscript.com/forum/topic/213113-simple-circular-progressbar-with-smooth-edges-gradient-color/#findComment-1545755 ; Example .......: _CircularProgress(50, -1, -1, 300, 20, 0x00FF00, 0xFF00FF, 0xFFFFFF) ; =============================================================================================================================== Func _CircularProgress($iPercent, $iSize = 300, $iThickness = 30, $TextCol = 0xFF404040, $StartCol = 0xFFFFFF00, $EndCol = 0xFFFF0000) Local $hBmp, $hBmpGraphics, $inSize, $iRadius, $iX, $iY $inSize = $iSize $iRadius = ($inSize - 4) / 2 $iX = $inSize / 2 $iY = $iX ; Create an off-screen bitmap for double-buffering $hBmp = _GDIPlus_BitmapCreateFromScan0($inSize, $inSize) $hBmpGraphics = _GDIPlus_ImageGetGraphicsContext($hBmp) _GDIPlus_GraphicsSetSmoothingMode($hBmpGraphics, 4) _GDIPlus_GraphicsSetTextRenderingHint($hBmpGraphics, 4) ; Draw progress arc as pie Local $angle = ($iPercent / 100) * 360 Local $hBrushProg = _GDIPlus_LineBrushCreate($iX - $iRadius, $iY, $iX + $iRadius, $iY, $EndCol, $StartCol, 1) Local $hPen = _GDIPlus_PenCreate2($hBrushProg, $iThickness) _GDIPlus_GraphicsDrawArc($hBmpGraphics, $iX - $iRadius + $iThickness / 2, $iY - $iRadius + $iThickness / 2, $iRadius * 2 - $iThickness, $iRadius * 2 - $iThickness, -90, $angle, $hPen) _GDIPlus_BrushDispose($hBrushProg) _GDIPlus_PenDispose($hPen) Local $hFontFamily = _GDIPlus_FontFamilyCreate("Times New Roman") Local $iFontSize = $iRadius * 0.3 Local $hFont = _GDIPlus_FontCreate($hFontFamily, $iFontSize, 1) Local $hFormat = _GDIPlus_StringFormatCreate() _GDIPlus_StringFormatSetAlign($hFormat, 2) _GDIPlus_StringFormatSetLineAlign($hFormat, 2) Local $hBrushText = _GDIPlus_BrushCreateSolid($TextCol) ; Draw percentage text Local $rect = _GDIPlus_RectFCreate(($inSize - ($iFontSize * 4)) / 2, ($inSize - ($iFontSize * 2)) / 2, $iFontSize * 4, $iFontSize * 2) _GDIPlus_GraphicsDrawStringEx($hBmpGraphics, $iPercent & "%", $hFont, $rect, $hFormat, $hBrushText) _GDIPlus_FontFamilyDispose($hFontFamily) _GDIPlus_FontDispose($hFont) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BrushDispose($hBrushText) Local $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp) _WinAPI_BitmapDisplayTransparentInGUI($hHBmp, $hGUI) _GDIPlus_BitmapDispose($hBmp) _GDIPlus_GraphicsDispose($hBmpGraphics) EndFunc ;==>_CircularProgress Func _WinAPI_BitmapDisplayTransparentInGUI(ByRef $hHBitmap, ByRef $hGUI, $iOpacity = 0xFF, $iFlags = $ULW_ALPHA, $bReleaseGDI = True, $tDest = Null, $iBGR = 0) If Not BitAND(GUIGetStyle($hGUI)[1], $WS_EX_LAYERED) = $WS_EX_LAYERED Then Return SetError(1, 0, 0) Local $tDim = DllStructCreate($tagBITMAP) If Not _WinAPI_GetObject($hHBitmap, DllStructGetSize($tDim), DllStructGetPtr($tDim)) Then Return SetError(2, 0, 0) Local $tSize = DllStructCreate($tagSIZE), $tSource = DllStructCreate($tagPOINT), $tBlend = DllStructCreate($tagBLENDFUNCTION) Local Const $hScrDC = _WinAPI_GetDC(0), $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC), $hOld = _WinAPI_SelectObject($hMemDC, $hHBitmap) $tSize.X = $tDim.bmWidth $tSize.Y = $tDim.bmHeight $tBlend.Alpha = $iOpacity $tBlend.Format = 1 _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, $tDest, $tSize, $hMemDC, $tSource, $iBGR, $tBlend, $iFlags) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteDC($hMemDC) If $bReleaseGDI Then _WinAPI_DeleteObject($hHBitmap) Return True EndFunc ;==>_WinAPI_BitmapDisplayTransparentInGUI If you have static variable, such as bitmap, brushes, etc., you can put out these parts off the _CircularProgress() function.
    2 points
  46. This is probably the case. I would add _WinAPI_DwmIsCompositionEnabled to the myLogin script to ensure that composition is available and enabled. The hardware has to be capable (possibly the VM may not) plus Transparency has to be enabled in the Settings app in Win11.
    2 points
  47. Then that's that. A VM will not be the same as a HW one. The remote desktop that connects to it is the "viewer". Not quite a hardware monitor on the PC. Not sure if it can be done personally. It should I guess. But in my VMs I didn't even try. Edit: Well, I did. And it worked too Enable rounded corners: reg add HKLM\SOFTWARE\Microsoft\Windows\Dwm /v ForceEffectMode /t REG_DWORD /d 2 /f Disable the effects (restore defaults): reg delete HKLM\SOFTWARE\Microsoft\Windows\Dwm /v ForceEffectMode /f funny enough, all the settings were as expected but, nothing. Added this "ForceEffectMode" that was for "round corners" in a remote desktop, and that did it.
    2 points
  48. Yes just hide the window, or do not show them at all.
    2 points
  49. argumentum

    WinRT - WinUI3

    ... #AutoIt3Wrapper_UseX64=Y #AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 If Not @AutoItX64 And Not @Compiled Then ShellExecute(StringTrimRight(@AutoItExe, 4) & "_x64.exe", '"' & @ScriptFullPath & '"') Exit EndIf #include <GUIConstants.au3> ... It asked me to GetRuntime() but I installed it yesterday so, the above is a good solution for those not in SciTE, just click-clicking the file from explorer
    2 points
  50. MattyD

    WinRT - WinUI3

    This is the same example - but I'm playing around with adding another layer of functions on top of the interface libraries. It should make building GUIs quite a bit simpler, and introduce some semblance of resource management. At this stage its just a rough proof of concept, so I'm not worried about naming conventions etc, or any mistakes in these functions. They'll all probably be rewritten anyway! So anyway, as an example: I'm now doing this to add rows and columns to the grid. ;Params - $pGrid, $fValue, $vUnit ("Auto", "Pixel" or "Star") ;$vUnit can also be the enum in its numeric form. (Microsoft.UI.Xaml.GridUnitType) GridAddRow($pGrid, 2, "Star") GridAddRow($pGrid, 1, "Star") GridAddColumn($pGrid, 3, "Star") GridAddColumn($pGrid, 5, "Star") And the underlying func. Func GridAddColumn($pGrid, $fWidth = 1, $vUnit = "Star") _WinRT_SwitchInterface($pGrid, $sIID_IGrid) If @error Then Return SetError(@error, @extended, False) Local $tGridLen = DllStructCreate("align 4;double Value;ulong GridUnitType") $tGridLen.Value = $fWidth $tGridLen.GridUnitType = IsString($vUnit) ? $mGridUnitType[$vUnit] : $vUnit Local $pColDef, $pColDefs = IGrid_GetColumnDefinitions($pGrid) $pColDef = _WinRT_ActivateInstance("Microsoft.UI.Xaml.Controls.ColumnDefinition") _WinRT_SwitchInterface($pColDef, $sIID_IColumnDefinition) IRowDefinition_SetHeight($pColDef, $tGridLen) Local $iError = @error If Not $iError Then IVector_Append($pColDefs, $pColDef) IUnknown_Release($pColDef) IUnknown_Release($pColDefs) Return SetError($iError, 0, $iError = $S_OK) EndFunc ;==>GridAddColumn Most funcs that accept an object will start with a SwitchInterface() - this serves 2 purposes: in your main script you don't need to bother about setting the correct interface on the object. and also if you feed the func an invalid pointer (to the wrong object for eg.), it should gracefully fail. Factories and other supporting objects used in these funcs are all released before returning. This is probably not be the most efficient thing to do if you're creating a bunch of instances of something - but it does mean you're cleaning up after yourself as you go. I'm getting way ahead of myself - but this new layer wouldn't be a comprehensive wrapper. It'd probably just some basic/common functionality to improve quality of life. I figure people can always jump down to the interface libraries if need be. Whether this will form part of an "official" release I don't know (if I ever get my act together!) - but I think building a full project without anything would just be downright tedious... And hey, if anyone else wants write/drive some of it I won't be complaining!!! WindowTest Grid.zip
    2 points
×
×
  • Create New...