 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
EricCartman
Joined: 13 Oct 2008 Posts: 60 Location: South Park, Colorado
|
Posted: Fri Feb 27, 2009 1:48 pm Post subject: Toggle Visibility of Desktop Icons by DoubleClicking Desktop |
|
|
Overall, I found the Stardock app Fences to be a little more trouble than it is worth. It did, however, have one feature that I liked: double clicking the desktop would toggle the visibility of the desktop Icons. The following code mimics that feature.
| Code: | #IfWinActive, ahk_class Progman
~LButton::
KeyWait, LButton ; Thank you, Lexikos.
KeyWait, LButton, D T0.2 ; http://www.autohotkey.com/forum/viewtopic.php?t=25485
If ErrorLevel
Return
Else
{
ControlGet, hwnd, Hwnd,, SysListView321, ahk_class Progman
ToggleVisibility(hwnd)
}
Return
ToggleVisibility(hwnd)
{
If DllCall("IsWindowVisible", UInt,hwnd)
WinHide, ahk_id %hwnd%
Else
WinShow, ahk_id %hwnd%
Return
} |
One note is that this code will hide your desktop icons when you launch an app by double clicking a desktop icon. Fences does not do this. At first, I was trying to think of how to prevent this from happening, but I then decided that 99 times out of 100, I'd just be hiding the icons after I launched something anyway. |
|
| Back to top |
|
 |
lazygeek
Joined: 08 Feb 2009 Posts: 17
|
|
| Back to top |
|
 |
EricCartman
Joined: 13 Oct 2008 Posts: 60 Location: South Park, Colorado
|
Posted: Fri Feb 27, 2009 7:12 pm Post subject: |
|
|
Sweet. Awesome. Glad to see that I re-invented the wheel. |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 7187
|
Posted: Fri Mar 06, 2009 9:27 pm Post subject: |
|
|
Using #InWinactive is better, only that it did not work for me when I tried.
I think I have isolated the problem to Zune Desktop Theme which activates a WorkerW class window when show desktop is done..
I have worked around it:
| Code: | #IfWinActive, ahk_class WorkerW ; workaround for
~LButton::Send !{Esc}{LButton 1} ; Zune Desktop Theme
#IfWinActive ; http://en.wikipedia.org/wiki/Zune_desktop_theme
#IfWinActive, ahk_class Progman
~LButton Up::
If ! ( A_PriorHotKey=A_ThisHotKey && A_TimeSincePriorHotkey<400 )
Return
ControlGet,Vis,Visible,,SysListView321,ahk_class Progman
ControlGet,Selected,List,Selected,SysListView321,ahk_class Progman
IfNotEqual,Selected,, Return
IfEqual,cHwnd,,ControlGet, chwnd, Hwnd,, SysListView321,ahk_class Progman
DllCall( "ShowWindow", UInt,cHwnd, UInt, Vis ? 0 : 5 )
Return
#IfWinActive |
_________________ Suresh Kumar A N |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|