AutoHotkey Community

It is currently May 27th, 2012, 12:02 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: October 3rd, 2009, 10:26 pm 
Offline

Joined: July 6th, 2008, 10:27 am
Posts: 22
How can I ensure that a particular action only runs when the Desktop has focus?

I used Window Spy and clicked on the Desktop to get the window title and class (Program Manager & ahk_class Progman) but when I use these values

e.g.

Code:
IfWinActive, ahk_class Progman


it applies to all Explorer windows and is not restricted to the Desktop.

Thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 3rd, 2009, 10:58 pm 
Offline

Joined: June 8th, 2006, 9:38 pm
Posts: 307
Use the window title? I.e.

Code:
IfWinActive Program Manager ahk_class Progman


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 4th, 2009, 12:09 am 
Offline

Joined: July 6th, 2008, 10:27 am
Posts: 22
:oops:

I can't believe it was that simple.

Thanks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 4th, 2009, 12:14 am 
Offline

Joined: July 6th, 2008, 10:27 am
Posts: 22
I think I knew where my confusion came from.

I had another script running (with no icon) that was performing the same function (in a different way) in Explorer windows. This made it appear as if the Desktop and Explorer windows were being treated as one (when in fact it was actually 2 separate scripts each operating on a different area).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 4th, 2009, 1:51 am 
Offline

Joined: July 6th, 2008, 10:27 am
Posts: 22
I have another question relating to the above topic:

How can I prevent the script from running if focus is on a Desktop icon (as opposed to the Desktop itself)?

the command IfWinActive Program Manager ahk_class Progman does not distinguish between the Desktop and icons that are on the Desktop.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 9th, 2009, 1:32 am 
Offline

Joined: July 6th, 2008, 10:27 am
Posts: 22
Can anyone help with the question that I asked above?

Quote:
How can I prevent the script from running if focus is on a Desktop icon (as opposed to the Desktop itself)?


Thanks!

:)


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Google [Bot], Leef_me, Pulover, rbrtryn, XstatyK, Yahoo [Bot] and 15 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