AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Double-click desktop to hide icons

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
IconBoy



Joined: 24 Feb 2006
Posts: 106

PostPosted: Wed Feb 25, 2009 8:47 pm    Post subject: Double-click desktop to hide icons Reply with quote

I was trying Stardocks Fences program and if you double click on the desktop, the icons hide/unhide.
Instead of installing a program for this (and other features), is there an AHK script that will accomplish this for me please?
Thanks very much.
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Wed Feb 25, 2009 10:31 pm    Post subject: Reply with quote

Code:
^#d::PostMessage,0x111,28755,,,ahk_class Progman

~LButton::
 If ( A_PriorHotKey = A_ThisHotKey && A_TimeSincePriorHotkey < 400 ) {
   WinGetClass, Class, A
   If Class in Progman,WorkerW
     SetTimer, ToggleDesktopIcons, -50
 }
Return

ToggleDesktopIcons:
 WinActivate, ahk_class Progman
 ControlGet, Selected, List, Selected, SysListView321, ahk_class Progman
 IfEqual,Selected,,PostMessage,0x111,28755,,,ahk_class Progman
Return


Tested ony in XP. If Double-Click-On-Desktop does not work for you, you may use the Hotkey Ctrl+Win+d
You need to Double-Click on the empty area of the desktop, which is the intended feature.
_________________
URLGet - Internet Explorer based Downloader
Back to top
View user's profile Send private message Send e-mail
firace



Joined: 08 Feb 2009
Posts: 28

PostPosted: Wed Feb 25, 2009 11:13 pm    Post subject: Reply with quote

I have taken SKAN's script above and replaced "toggledesktopicons"
with a variant that should do the job with less delay:
Code:

~LButton::
 If ( A_PriorHotKey = A_ThisHotKey && A_TimeSincePriorHotkey < 400 ) {
   WinGetClass, Class, A
   If Class in Progman,WorkerW
     SetTimer, ToggleDesktopIcons, -50
 }
Return

ToggleDesktopIcons:

var := (flag=0)? "Show" : "Hide"

flag := !flag
Run, ping,, min

WinExist("ahk_class Progman")
Control,%var%,, SysListView321

Return
Back to top
View user's profile Send private message
Z_Gecko
Guest





PostPosted: Wed Feb 25, 2009 11:43 pm    Post subject: Reply with quote

what is
Code:
Run, ping,, min
supposed to do?
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Thu Feb 26, 2009 12:07 am    Post subject: Reply with quote

Used as Sleep in Batch files
Back to top
View user's profile Send private message Send e-mail
Drugwash



Joined: 07 Sep 2008
Posts: 921
Location: Ploiesti, RO

PostPosted: Thu Feb 26, 2009 7:32 pm    Post subject: Reply with quote

SKAN's script won't work in Win98SE. lazygeek's does, but only for hiding icons; they won't get restored until right-click > Refresh on desktop.
And as we know, the tilde (~) is ignored on 9x systems but looks like neither simple LButton/MButton are not read for me.
No big deal, just sayin'.
_________________
AHK tools by Drugwash
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
qweru



Joined: 21 Mar 2009
Posts: 1

PostPosted: Sat Mar 21, 2009 1:26 pm    Post subject: Reply with quote

lazygeek's script is fast but unfortunately it hides the icons even when i open folders on desktop or double click on icons can you fix it somehow? thanks
Back to top
View user's profile Send private message
Coeluh
Guest





PostPosted: Fri Jul 03, 2009 8:55 am    Post subject: Reply with quote

qweru wrote:
lazygeek's script is fast but unfortunately it hides the icons even when i open folders on desktop or double click on icons can you fix it somehow? thanks
Back to top
legionliu



Joined: 10 Dec 2009
Posts: 1

PostPosted: Thu Dec 10, 2009 1:50 am    Post subject: Reply with quote

qweru wrote:
lazygeek's script is fast but unfortunately it hides the icons even when i open folders on desktop or double click on icons can you fix it somehow? thanks


yes i have the same problem. icons was hided when double click on icons and icons can not be displayed when double click the area icons should be placed (in the case of icons have already been hided).
Back to top
View user's profile Send private message
SDRapha
Guest





PostPosted: Mon Jan 03, 2011 3:08 am    Post subject: Reply with quote

I've had some different problems from you guys, like needing to click six times or more to show/hide the icons.
I've made a few changes in the above code, now it's working fine to me in Win7. Very Happy

Code:

~LButton::
 If ( A_PriorHotKey = A_ThisHotKey && A_TimeSincePriorHotkey < 400 ) {
   WinGetClass, Class, A
   If Class in Progman,WorkerW
   var := (flag=0) ? "Show" : "Hide"
   flag := !flag
   Control,%var%,, SysListView321, ahk_class Progman
   Control,%var%,, SysListView321, ahk_class WorkerW
}
Return


And about the double clicking the icon and everythings get hidden, it's a nice feature for me, maybe you can substitute the double click with a middle button click if you don't want to this happen.
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group