 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
klbatbcl Guest
|
Posted: Sun Nov 22, 2009 12:22 am Post subject: How to sense that all open windows are minimized? |
|
|
I need a script that tests whether all open windows are minimized / the user is looking at the Desktop.
If yes, I want to:
SendInput #{m} ; To put the mouse focus on the current Desktop icon.
If no, do nothing.
Any help would be appreciated .. thx.
KLB |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 2428
|
Posted: Sun Nov 22, 2009 12:30 am Post subject: |
|
|
From here, will test what window is under the mouse:
| Code: | MouseGetPos,,,win
WinGetClass, class, ahk_id %win%
If class in Progman,WorkerW
MsgBox, You're on the Desktop!
else
MsgBox, You're so not on the Desktop!
Return |
_________________ Try Quick Search for Autohotkey or see the tutorial for newbies. |
|
| Back to top |
|
 |
klbatbcl Guest
|
Posted: Sun Nov 22, 2009 12:58 am Post subject: How to sense that all open windows are minimized? |
|
|
Didn't quite work ..
With two open windows, I closed the first, ran the test and it minimized the second window, which should have been left open.
Any way to use a WinActive test?
Thanks,
KLB |
|
| Back to top |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 1770 Location: MN, USA
|
Posted: Sun Nov 22, 2009 3:07 am Post subject: |
|
|
This literally checks each window to determine if it is minimized. | Code: | #z::
WinGet, list, List
Loop,% list {
WinGet, state, MinMax,% "ahk_id" list%A_Index%
If (state != -1) {
WinGetClass, class,% "ahk_id" list%A_Index%
If class not in Progman,WorkerW,Shell_TrayWnd
{
MsgBox,% class "`tis not minimized."
return
}
}
}
SendInput, {F4}
return |
_________________ http://autohotkey.net/~jaco0646/ |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 2428
|
Posted: Sun Nov 22, 2009 4:13 am Post subject: Re: How to sense that all open windows are minimized? |
|
|
| klbatbcl wrote: | | With two open windows, I closed the first, ran the test and it minimized the second window, which should have been left open. |
Hopefully you realize that there's no WinMinimize command in the code I posted, so I don't think it's possible the code I posted did that unless you modified it, in which case we need to see your code. _________________ Try Quick Search for Autohotkey or see the tutorial for newbies. |
|
| Back to top |
|
 |
klbatbcl Guest
|
Posted: Sun Nov 22, 2009 11:42 am Post subject: How to sense that all open windows are minimized? |
|
|
Thank you for the code! My script is still not working every time the way I want it to, but now I'm into / learning AHK and running some tests.
KLB |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|