HideMyIcon
AHK v2
AutoHotkey is a powerful tool that can help you customize your Windows operating system in a variety of ways. One of the most useful features it offers is the ability to auto-hide your desktop icons, even in newer versions of Windows like Windows 10. This can be a great way to keep your desktop organized and free of clutter, improving your productivity in the process.
When you have too many icons on your desktop, it can quickly become a chaotic mess that affects your effectiveness. With the power of AutoHotkey, however, you can easily hide and show your icons based on your needs. For instance, if your desktop is the active window, you can see your icons, but if another window is active, they will be hidden. Additionally, you can also add a fancy fading animation that can be used during window transitions, making the experience even more visually appealing.
The AutoHotkey script that is used to auto-hide desktop icons works by changing the transparency of the icons based on certain conditions. For example, when the active window is on the desktop, the icons will be visible, but when another window is active, they will be hidden. The script also includes a fading animation that can be used during window transitions, giving you complete control over how the icons appear and disappear from your desktop.
There are two ways to use the script: you can download the script in a compiled format (exe) and run it directly, or you can create an ahk file and use it with the installed AutoHotkey. For those who are not familiar with AutoHotkey, it is recommended to download the script in the compiled format.
Overall, AutoHotkey is a powerful tool that can help you customize your Windows operating system in a variety of ways. One of the most useful features it offers is the ability to auto-hide your desktop icons, even in newer versions of Windows like Windows 10. With the power of AutoHotkey, you can easily hide and show your icons based on your needs, and add a touch of animation for a more visually appealing experience.
As an advanced user, you can use a lot of other features provided by AutoHotkey, like remapping keys, creating hotkeys and shortcuts, automating repetitive tasks, and even creating your own tools and scripts. With AutoHotkey, the possibilities are endless, you can create a script to open your most frequently used applications, or even create a script to automate a tedious task you have to do every day.
AutoHotkey is a free, open-source tool that is available for Windows, and it is easy to learn and use, even for people with no programming experience. With a little bit of effort, you can create your own scripts and automate repetitive tasks, making your life a lot easier.
In conclusion, AutoHotkey is a great tool for anyone who wants to customize their Windows operating system. With its ability to auto-hide desktop icons and add fading effects, it can help you keep your desktop organized and improve your productivity. With its many other features, you can also automate repetitive tasks and create your own tools and scripts. AutoHotkey is a free, open-source tool that is easy to learn and use, and it is definitely worth checking out if you want to customize your Windows experience.
The AutoHotkey v2 code:
; Script HideMyIcon_ahk_v2.ahk
; License: MIT License
; Author: Bence Markiel (bceenaeiklmr)
; Github: https://github.com/bceenaeiklmr/HideMyIcon
; Date 19.01.2023
; Version 0.4
#Requires AutoHotkey >=2.0
#Warn
/*
; Hover: effect triggered by clicking (0) or hovering (1)
; Speed: 1 (frames 256), 3 (86), 5 (52), 15 (18), 17 (16), 51 (6), 85 (4), 255 (2)
; works with any number between 0, 255
; Delay: sleep time between changing the transparency, use "" or 0 for best performance
; Recommended presets:
; SetTimer(HideMyIcon.Bind(1, 15, 20), 10)
; SetTimer(HideMyIcon.Bind(1, 51, 0), 10)
; SetTimer(HideMyIcon.Bind(0, 85, 0), 10)
; SetTimer(HideMyIcon.Bind(0, 255, 0), 10)
*/
HideMyIcon(Hover := 0, Speed := 17, Delay := 16.67) {
static init := 0, hDesk := 0, hIcon := 0, Transparent := 255
if !init {
; get handles
if !hDesk := winExist("ahk_class Progman") ; credit to SKAN
hDesk := winExist("ahk_class WorkerW")
hIcon := ControlGetHwnd("SysListView321", "ahk_id" hDesk)
; raising proc priority makes the fade animation smoother (could be placebo)
ProcessSetPriority("AboveNormal")
; exiting the script will restore the icons" transparency to 255
OnExit(RestoreIcons)
init := 1
}
Step := 0, id := ctrl := cls := wnd := ""
; active windows and transparency
Desk := WinActive("ahk_id" hDesk)
Tray := WinActive("ahk_class Shell_TrayWnd")
; start menu button gives an error
try {
MouseGetPos(,, &id, &ctrl)
cls := WinGetClass("ahk_id" id)
wnd := WinGetTitle("ahk_id" id)
}
; class under mouse
MousePos := ((cls ~= "Shell_TrayWnd" && ctrl ~= "TrayShowDesktopButton")
|| (cls ~= "Progman|WorkerW" && wnd == "") ? "ShowDesk"
: (cls ~= "Progman|WorkerW") ? "Desktop"
: (cls ~= "Shell_TrayWnd") ? "Taskbar"
: (cls ~= "DFTaskbar") ? "DisplayFusion" : "")
; decrease or increase transparency
if !Hover
Step := (Desk||Tray) ? 1 : -1
else
Step := (MousePos) ? 1 : -1
; forcing fade in effect at TrayShowDesktopButton
if (MousePos ~= "ShowDesk|Tray")
Step := 1
NextStep := Transparent + Step * Speed,
before := Transparent
; a minimum value of 1 is required for proper use of the taskbar and showdesk button
if (NextStep == 1) || (NextStep == 0) || (0 > NextStep)
Transparent := 1
else if (NextStep > 255)
Transparent := 255
else
Transparent := NextStep
; set the transparency of the icon
if (Transparent!=Before)
WinSetTransparent(Transparent, "ahk_id" hIcon)
if Delay
Sleep(Delay)
return
RestoreIcons(*) => WinSetTransparent(255, "ahk_id" hIcon)
}
Leave A Comment