MarkyMark
Joined: 28 Sep 2007 Posts: 26
|
Posted: Tue Feb 12, 2008 10:17 pm Post subject: Pause this script |
|
|
Hi. I was wondering what's a good way of pausing this script.
So I can turn it off/on from a click in the tray.
This is what I want. (If you have other suggestions of stopping it, please advise.)
START
click on menuitem "minimother"
- starts the script.
- show checkmark on menu item named minimother
STOP
Another click on menuitem "minimother"
- stops the script
- remove checkmark on menu item named minimother
Here's the script:
| Code: |
menu, tray, add, MinimOther, start
menu, tray, default,MinimOther
menu, tray, click, 1
START:
menu, tray, ToggleCheck, MinimOther
Sleep,200
IfWinNotExist,ahk_id %id%
WinRestore,A
WinGet,id,ID,A
WinGet,style,Style,ahk_id %id%
If(style & 0x20000)
{
WinGet,winid_,List,,,Program Manager
Loop,%winid_%
{
StringTrimRight,winid,winid_%A_Index%,0
If id=%winid%
Continue
WinGet,style,Style,ahk_id %winid%
If(style & 0x20000)
{
WinGet,state,MinMax,ahk_id %winid%,
If state=-1
Continue
WinGetClass,class,ahk_id %winid%
If class=Shell_TrayWnd
Continue
IfWinExist,ahk_id %winid%
WinMinimize,ahk_id %winid%
}
}
}
Goto,START
|
Reloading can stop it. But I just want to know if there's another way other than reloading.
Thanks much. |
|