| View previous topic :: View next topic |
| Author |
Message |
Renfro
Joined: 06 Jul 2008 Posts: 22
|
Posted: Sat Oct 03, 2009 9:26 pm Post subject: Activate only when Desktop has focus |
|
|
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 |
|
| Back to top |
|
 |
Roland
Joined: 08 Jun 2006 Posts: 307
|
Posted: Sat Oct 03, 2009 9:58 pm Post subject: |
|
|
Use the window title? I.e.
| Code: | | IfWinActive Program Manager ahk_class Progman |
|
|
| Back to top |
|
 |
Renfro
Joined: 06 Jul 2008 Posts: 22
|
Posted: Sat Oct 03, 2009 11:09 pm Post subject: |
|
|
I can't believe it was that simple.
Thanks! |
|
| Back to top |
|
 |
Renfro
Joined: 06 Jul 2008 Posts: 22
|
Posted: Sat Oct 03, 2009 11:14 pm Post subject: |
|
|
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). |
|
| Back to top |
|
 |
Renfro
Joined: 06 Jul 2008 Posts: 22
|
Posted: Sun Oct 04, 2009 12:51 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Renfro
Joined: 06 Jul 2008 Posts: 22
|
Posted: Fri Oct 09, 2009 12:32 am Post subject: |
|
|
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!
 |
|
| Back to top |
|
 |
|