AutoHotkey Community

It is currently May 26th, 2012, 5:09 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: February 27th, 2009, 1:48 pm 
Offline

Joined: October 13th, 2008, 4:14 pm
Posts: 60
Location: South Park, Colorado
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 27th, 2009, 5:51 pm 
Offline

Joined: February 8th, 2009, 5:52 pm
Posts: 47
You can fix the hide-on-launch-app issue by checking if any icon is selected before performing the show/hide.
See SKAN's code at http://www.autohotkey.com/forum/viewtopic.php?t=41388&highlight=


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 27th, 2009, 7:12 pm 
Offline

Joined: October 13th, 2008, 4:14 pm
Posts: 60
Location: South Park, Colorado
lazygeek wrote:


Sweet. Awesome. Glad to see that I re-invented the wheel.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 6th, 2009, 9:27 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
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

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: sks, Yahoo [Bot] and 11 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group