Leaderboard
Popular Content
Showing content with the highest reputation on 09/21/2025 in all areas
-
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
-
Smooth Color Transistions
argumentum and one other reacted to Werty for a topic
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 -
AutoIt Snippets
WildByDesign and one other reacted to FadeSoft for a topic
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 -
Help File/Documentation Issues. (Discussion Only)
pixelsearch and one other reacted to jpm for a topic
it is fix for the next delivery2 points -
Smooth Color Transistions
argumentum reacted to WildByDesign for a topic
Recently, I have been experimenting with enabling a random color border coloring transitions (rainbow) effect in external processes with my Immersive UX (DwmColorBlurMica) project. The idea (and code) comes from the great @argumentum's Win11myOwnBorderColor project. Since my project would color the borders of whichever happens to be the active window at the time and therefore working with separate processes, I don't believe that I can use _Timer_SetTimer() and related functions because "This window must be owned by the calling thread", unfortunately. Therefore in my example, I have had to resort to using AdlibRegister. #include <GUIConstantsEx.au3> Global $hGUI 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) AdlibRegister("BorderMeRandomColorViaTimer", 300) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idBtn_OK ExitLoop EndSwitch WEnd ; Delete the previous GUI and all controls. AdlibUnRegister("BorderMeRandomColorViaTimer") GUIDelete($hGUI) EndFunc ;==>Example Func BorderMeRandomColorViaTimer() Local $color = '0x' & Hex(Random(2, 13, 1), 1) & Hex(Random(2, 13, 1), 1) & Hex(Random(2, 13, 1), 1) & Hex(Random(2, 13, 1), 1) & Hex(Random(2, 13, 1), 1) & Hex(Random(2, 13, 1), 1) DllCall('dwmapi.dll', 'long', 'DwmSetWindowAttribute', 'hwnd', $hGUI, 'dword', 34, 'dword*', $color, 'dword', 4) ; border ;DllCall('dwmapi.dll', 'long', 'DwmSetWindowAttribute', 'hwnd', $g_hForm, 'dword', 35, 'dword*', $color, 'dword', 4) ; caption 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__ Now the question that I have and what I am asking for help with is making those color transitions smoother. There is a recent example in a program that I follow that is in C# that has achieved a very smooth transition of colors. But since I am not very familiar with C#, I don't understand exactly how it is being done. Particularly, the transition of one color to the next. Link: https://github.com/HotCakeX/Harden-Windows-Security/blob/4966307bc06257b37307d0660e3d821b9944d67b/AppControl Manager/CustomUIElements/AppWindowBorderCustomization.cs#L211-L264 private static void TickUpdate() { long currentTimestamp = Stopwatch.GetTimestamp(); long deltaTicks = currentTimestamp - LastTimestamp; LastTimestamp = currentTimestamp; // Convert ticks to seconds. float deltaSeconds = deltaTicks * TickToSeconds; // Increment hue based on elapsed time and speed. Hue += deltaSeconds * InverseSpeed; // Wrap hue to [0,1) without using modulo. if (Hue >= 1f) { // (int)Hue removes the integer portion (if a long pause made it exceed by more than 1). Hue -= (int)Hue; } #region Convert hue to RGB border color. float t = Hue * 6f; float r = MathF.Abs(t - 3f) - 1f; float g = 2f - MathF.Abs(t - 2f); float b = 2f - MathF.Abs(t - 4f); r = r < 0f ? 0f : (r > 1f ? 1f : r); g = g < 0f ? 0f : (g > 1f ? 1f : g); b = b < 0f ? 0f : (b > 1f ? 1f : b); byte rr = (byte)(r * 255f); byte gg = (byte)(g * 255f); byte bb = (byte)(b * 255f); // https://learn.microsoft.com/windows/win32/gdi/colorref // COLORREF format expected: 0x00BBGGRR uint computedBorderColor = (uint)((bb << 16) | (gg << 8) | rr); #endregion // Main Apply int result = NativeMethods.DwmSetWindowAttribute(GlobalVars.hWnd, DWMWA_BORDER_COLOR, ref computedBorderColor, sizeof(uint)); if (result != 0) { // If setting the border color failed, stop the timer to avoid further errors. if (Timer is not null && Timer.IsRunning) { Timer.Stop(); } Logger.Write($"Failed to set window border color. DwmSetWindowAttribute returned error code: {result}", LogTypeIntel.Error); } } The app is in the Microsoft Store in case anyone wants to see the smooth transitions. It's called AppControl Manager and the rainbow border effect is in the Settings for it. Although many of you will probably understand better what is happening in the C# code. Does anybody have any ideas on what can be done to make the color transition appear smoother? I may be somewhat limited since I don't think I can use timers in external processes. Thank you for your time.1 point -
need help with GUICtrlCreateList
Resiak1811 reacted to pixelsearch for a topic
@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 !1 point -
Updated my version with this change. thanks.1 point
-
Smooth Color Transistions
WildByDesign reacted to argumentum for a topic
8:00 here. Working on a Sunday Anywayz, .. float t = Hue * 6f; is the same in AutoIt, $t = $Hue * 0x6f .. float r = MathF.Abs(t - 3f) - 1f; would be $r = Abs($t - 0x3f) if nobody does it, I'll do it ... next week ? 😅 PS: you should be able to do it by throwing code at it. I have faith in you1 point -
Thanks for the extensive update of the AutoItIndentFix.lua! I have merged your changes into my version and had a quick play, which looks good. Also did the update in AutoItAutoComplete.lua . They will be part of the next upload unless any issues are found. Cheers Jos1 point
-
Thanks, I'll have a look later to see what your change does. 🙂1 point