AutoHotkey Community

It is currently May 26th, 2012, 2:52 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: January 31st, 2009, 6:03 pm 
Ive been thinkin about a script that autohides all desltop icons when the cursor is on the desktop only... and idle for 5 or 10 seconds or whatever, than makes the icons reappear when the mouse is moved. I think thats a pretty good idea ive looked everywhere for a program or script like this. theres similar ones but nothing that hides icons with an idle mouse.

Anyone care to write one?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 31st, 2009, 6:41 pm 
Offline

Joined: April 20th, 2006, 5:11 pm
Posts: 75
Location: Vienna
Sorry, but I'm late. So at least it let the Icons disappear, but then appears again...

Code:
#Persistent
SetTimer, HideCheck, 1000
Return

HideCheck:
If (A_TimeIdlePhysical >= 5000) AND WinActive("ahk_class Progman")
   WinHide, ahk_class Progman
Else, WinShow, ahk_class Progman
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 31st, 2009, 7:25 pm 
Ive gotta say that was one hell of a fast responce...

thats pretty close to what i want to do, but any idea how to stop the persistant "annoying blinking of icons?"
a slight modification and this script would be perfect


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 31st, 2009, 7:38 pm 
i was thinking telling it to right click the desktop than check or uncheck show desktop, after after the mouse is idle, or starts moving

maybe?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2009, 1:54 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
The following works perfectly for me:
Code:
#Persistent
was_hidden := false
SetTimer, HideCheck, 1000
Return

HideCheck:
should_be_hidden := (A_TimeIdlePhysical >= 5000) AND WinActive("ahk_class Progman")
if (should_be_hidden != was_hidden)
{
    Control, % should_be_hidden ? "Hide" : "Show",, SysListView321, ahk_class Progman
    was_hidden := should_be_hidden
}
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2009, 7:20 am 
Offline

Joined: February 24th, 2006, 10:19 pm
Posts: 108
Thanks Lexikos!

Is there any way to get it to work no matter what window is in focus, i.e. the desktop icons disappear after 5 seconds even if you have not clicked/got focus of the desktop?
So, if an explore window is showing on the desktop, the icons will disappear and the only thing showing is the explorer window.
Thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2009, 7:31 am 
Offline

Joined: May 28th, 2008, 2:11 am
Posts: 739
Location: Minnesota, USA
Code:
#Persistent
was_hidden := false
SetTimer, HideCheck, 1000
Return

HideCheck:
should_be_hidden := (A_TimeIdlePhysical >= 5000) ; AND WinActive("ahk_class Progman")
if (should_be_hidden != was_hidden)
{
    Control, % should_be_hidden ? "Hide" : "Show",, SysListView321, ahk_class Progman
    was_hidden := should_be_hidden
}
Return

_________________
Unless otherwise stated, all code is untested

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2009, 3:41 pm 
thanks guys this script is pretty killer


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2009, 8:26 pm 
Lexikos, can you add to that script, a command to make the cursor dissappear also?????


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2009, 8:36 pm 
Offline

Joined: May 28th, 2008, 2:11 am
Posts: 739
Location: Minnesota, USA
SystemCursor() function is from the help file on the DllCall page.
Code:
#Persistent
was_hidden := false
SetTimer, HideCheck, 1000
Return

HideCheck:
   should_be_hidden := (A_TimeIdlePhysical >= 5000)
   if (should_be_hidden != was_hidden)
   {
      Control, % should_be_hidden ? "Hide" : "Show",, SysListView321, ahk_class Progman
      SystemCursor(!should_be_hidden)
      was_hidden := should_be_hidden
   }
Return

SystemCursor(T=1)
{
   static AndMask, XorMask, $, h_cursor
      ,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13
      , b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13
      , h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h12,h13
   if (T = "Init" or T = "I" or $ = "")
   {
      $ = h
      VarSetCapacity( h_cursor,4444, 1 )
      VarSetCapacity( AndMask, 32*4, 0xFF )
      VarSetCapacity( XorMask, 32*4, 0 )
      system_cursors = 32512,32513,32514,32515,32516,32642,32643,32644,32645,32646,32648,32649,32650
      StringSplit c, system_cursors, `,
      Loop %c0%
      {
         h_cursor   := DllCall( "LoadCursor", "uint",0, "uint",c%A_Index% )
         h%A_Index% := DllCall( "CopyImage",  "uint",h_cursor, "uint",2, "int",0, "int",0, "uint",0 )
         b%A_Index% := DllCall("CreateCursor","uint",0, "int",0, "int",0
            , "int",32, "int",32, "uint",&AndMask, "uint",&XorMask )
      }
   }
   $ := T=0 ? "b" : "h"

   Loop %c0%
   {
      h_cursor := DllCall( "CopyImage", "uint",%$%%A_Index%, "uint",2, "int",0, "int",0, "uint",0 )
      DllCall( "SetSystemCursor", "uint",h_cursor, "uint",c%A_Index% )
   }
}

_________________
Unless otherwise stated, all code is untested

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: September 29th, 2009, 11:03 pm 
I'm trying to find a replacement for iconoid, which stopped working for some reason. Which is how I found this site/script.

I'm completely new to this (as in I found this 5 minutes ago) but the script works to remove the mouse, but does not remove the icons. How would I modify it to work with Windows 7?

Thanks for the help?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 30th, 2009, 8:38 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
Change "Progman" to "WorkerW".


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Awesome!
PostPosted: September 30th, 2009, 6:04 pm 
Lexikos wrote:
Change "Progman" to "WorkerW".


Thank you soo much for such a quick response - especially on a thread that would be considered dead by most people.

Thank you!

btw, it works great!


Report this post
Top
  
Reply with quote  
 Post subject: Now with Mouse Idle
PostPosted: January 14th, 2010, 5:59 pm 
On v1.0.48.05, A_TimeIdlePhysical wasn't changing on mouse movement for me, so I changed the script to track mouse movement idle time, and wanted to share it:

Code:
#Persistent
idlePoll := 250
idleHideTime := 3000

; initialize variables for idle functionality
was_hidden := false
MouseGetPos, LastMouseX, LastMouseY
SetTimer, HideCheck, %idlePoll%
return

HideCheck:
   MouseGetPos, MouseX, MouseY
   if (MouseX == LastMouseX) && (MouseY == LastMouseY)
   {
      MouseIdle := MouseIdle + idlePoll
   }
   else
   {
      MouseIdle := 0
   }
   LastMouseX := MouseX
   LastMouseY := MouseY

   should_be_hidden := (A_TimeIdlePhysical >= idleHideTime) && (MouseIdle >= idleHideTime)

   if (should_be_hidden != was_hidden)
   {
      Control, % should_be_hidden ? "Hide" : "Show",, SysListView321, ahk_class Progman
      was_hidden := should_be_hidden
   }
Return


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 14th, 2010, 7:14 pm 
Offline

Joined: January 14th, 2010, 4:27 pm
Posts: 24
Any way to hide the icons if the desktop is not focused (even if the mouse cursor is moving)?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: G. Sperotto, Google Feedfetcher, patgenn123 and 20 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