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 

Autohide desktop icons with an idle mouse
Goto page 1, 2  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
rock
Guest





PostPosted: Sat Jan 31, 2009 5:03 pm    Post subject: Autohide desktop icons with an idle mouse Reply with quote

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?
Back to top
Obi-Wahn



Joined: 20 Apr 2006
Posts: 75
Location: Vienna

PostPosted: Sat Jan 31, 2009 5:41 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
rock
Guest





PostPosted: Sat Jan 31, 2009 6:25 pm    Post subject: Reply with quote

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
Back to top
rock
Guest





PostPosted: Sat Jan 31, 2009 6:38 pm    Post subject: Reply with quote

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?
Back to top
Lexikos



Joined: 17 Oct 2006
Posts: 7295
Location: Australia

PostPosted: Sun Feb 01, 2009 12:54 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
IconBoy



Joined: 24 Feb 2006
Posts: 106

PostPosted: Sun Feb 01, 2009 6:20 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Slanter



Joined: 28 May 2008
Posts: 739
Location: Minnesota, USA

PostPosted: Sun Feb 01, 2009 6:31 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
rock
Guest





PostPosted: Sun Feb 01, 2009 2:41 pm    Post subject: Reply with quote

thanks guys this script is pretty killer
Back to top
rock
Guest





PostPosted: Mon Feb 02, 2009 7:26 pm    Post subject: Reply with quote

Lexikos, can you add to that script, a command to make the cursor dissappear also?????
Back to top
Slanter



Joined: 28 May 2008
Posts: 739
Location: Minnesota, USA

PostPosted: Mon Feb 02, 2009 7:36 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
SirG
Guest





PostPosted: Tue Sep 29, 2009 10:03 pm    Post subject: Works for the mouse, but not the icons (Windows 7) Reply with quote

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?
Back to top
Lexikos



Joined: 17 Oct 2006
Posts: 7295
Location: Australia

PostPosted: Wed Sep 30, 2009 7:38 am    Post subject: Reply with quote

Change "Progman" to "WorkerW".
Back to top
View user's profile Send private message Visit poster's website
SirG
Guest





PostPosted: Wed Sep 30, 2009 5:04 pm    Post subject: Awesome! Reply with quote

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!
Back to top
Eric Lathrop
Guest





PostPosted: Thu Jan 14, 2010 4:59 pm    Post subject: Now with Mouse Idle Reply with quote

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
Back to top
mindtricks1



Joined: 14 Jan 2010
Posts: 24

PostPosted: Thu Jan 14, 2010 6:14 pm    Post subject: Reply with quote

Any way to hide the icons if the desktop is not focused (even if the mouse cursor is moving)?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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