Created
March 5, 2024 12:31
-
-
Save dsaad68/b8c66ce1f6020c93428a0d16205d6933 to your computer and use it in GitHub Desktop.
Hide Desktop Icons with Auto Hotkey
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires AutoHotkey 2.0+ | |
#SingleInstance Force | |
#HotIf WinActive("ahk_class Progman") || WinActive("ahk_class WorkerW") | |
^+d::DesktopIcons() | |
#HotIf | |
DesktopIcons(){ | |
hProgman:=WinExist("ahk_class WorkerW","FolderView")?WinExist():WinExist("ahk_class Progman","FolderView") | |
hShellDefView:=DllCall("user32.dll\GetWindow","ptr",hProgman,"int",5,"ptr") | |
hSysListView:=DllCall("user32.dll\GetWindow","ptr",hShellDefView,"int",5,"ptr") | |
If (DllCall("user32.dll\IsWindowVisible","ptr",hSysListView)!=-1) | |
DllCall("user32.dll\SendMessage","ptr",hShellDefView,"ptr",0x111,"ptr",0x7402,"ptr",0) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment