Skip to content

Instantly share code, notes, and snippets.

@dsaad68
Created March 5, 2024 12:31
Show Gist options
  • Save dsaad68/b8c66ce1f6020c93428a0d16205d6933 to your computer and use it in GitHub Desktop.
Save dsaad68/b8c66ce1f6020c93428a0d16205d6933 to your computer and use it in GitHub Desktop.
Hide Desktop Icons with Auto Hotkey
#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