If your desktop is full of icons (shortcuts) and you launch your applications/files by clicking on them,
this is a script for you.
Please read description in script. Change settings in "settings" section.
By default, script hides all your desktop icons. Don't be scared, icons will show again when you press & hold %ShowDeskHotkey% or ExitApp.
You can check/uncheck Hide desktop icons in tray menu.
For maximum efficiency;
1) place you desktop icons around center of desktop
2) set CenterMouseOnShow = 1 and ReturnMouseTo = Initial position
This script is
Radial menu co-product. Similar goal realized on simpler way.
If you like it or have some suggestions post reply.
Show desktop launcher
Code:
#NoEnv
CoordMode, mouse, screen
;===Description=========================================================================
/*
Show desktop launcher by Learning one
Minimizes all windows when you press & hold defined mouse hotkey (RButton by default).
Release mouse button above desktop icon to launch it (and unminimize windows), or anywhere else to unminimize windows.
Hotkey can be any key, not just mouse button. Hotkey combinations are not supported!
Desktop will show after %ShowDeskDelay% miliseconds. To show it instantly, set 0. This delay gives you opportunity to send normal RButton click.
THE BEST THING TO DO is to change hotkey to XButton1 or XButton1 and use ShowDeskDelay = 0.
LICENCE:
Free for non-commercial, personal use.
For commercial use, e-mail me please.
Do not (re)distribute without my permission!
Author: Boris Mudrinic (Learning one on AHK forum)
Contact: http://www.autohotkey.net/~Learning%20one/Learning%20one%20contact.png
*/
;===Settings============================================================================
ShowDeskHotkey = RButton ; Show desktop hotkey
ShowDeskDelay = 220 ; Show desktop delay
AutoHideIcons = 1 ; If 1, script hides all your desktop icons. Icons will be shown again when you press & hold %ShowDeskHotkey% or ExitApp
ClickCount = 2 ; If your computer is set to "double click to open item" (default) specify 2. If it is set to "single click to open item" specify 1.
CenterMouseOnShow = ; If 1, mouse will be moved to the center of screen after %ShowDeskHotkey%. Ahything else will not move mouse.
ReturnMouseTo = center ; Returns mouse to specified position when you release %ShowDeskHotkey%.
; Allowed values: "Initial position", "center", or anything else --> doesn't move mouse
;===Auto-execute end====================================================================
OnExit, ExitSub
XCenter := A_ScreenWidth/2, YCenter := A_ScreenHeight/2
ControlGet, hwnd, Hwnd,, SysListView321, ahk_class Progman
Menu, tray, add
Menu, tray, add, Hide desktop icons, HideIcons
if AutoHideIcons = 1
{
WinHide, ahk_id %hwnd%
Menu, tray, Check, Hide desktop icons
}
Hotkey, %ShowDeskHotkey%, ShowDeskHotkey
Return
;===ShowDeskHotkey Subroutine===========================================================
ShowDeskHotkey:
QuitShowDesk =
MouseGetPos, InitialX, InitialY, ActiveWin
SetTimer, QuitShowDesk, 20
While (A_TimeSinceThisHotkey < ShowDeskDelay or QuitShowDesk ! 1)
Sleep, 20
SetTimer, QuitShowDesk, off
if QuitShowDesk = 1
Return
if CenterMouseOnShow = 1
MouseMove, %XCenter%, %YCenter%
WinMinimizeAll
if AutoHideIcons = 1
WinShow, ahk_id %hwnd%
KeyWait, %ShowDeskHotkey%, u
BlockInput, MouseMove
MouseClick, Left,,, %ClickCount%
BlockInput, MouseMoveOff
if ReturnMouseTo = Initial position
MouseMove, %InitialX%, %InitialY%
else if ReturnMouseTo = center
MouseMove, %XCenter%, %YCenter%
if AutoHideIcons = 1
WinHide, ahk_id %hwnd%
WinMinimizeAllUndo
Return
;===Subroutines=========================================================================
QuitShowDesk:
if not (GetKeyState(ShowDeskHotkey,"p"))
{
SetTimer, QuitShowDesk, off
QuitShowDesk = 1
SendInput, {%ShowDeskHotkey%}
}
Return
HideIcons:
if AutoHideIcons = 1
{
Menu, tray, Uncheck, Hide desktop icons
AutoHideIcons =
WinShow, ahk_id %hwnd%
}
Else
{
Menu, tray, Check, Hide desktop icons
AutoHideIcons = 1
WinHide, ahk_id %hwnd%
}
Return
ExitSub:
WinShow, ahk_id %hwnd%
ExitApp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Escape::ExitApp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Merry Christmas!
