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 

Pause this script

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
MarkyMark



Joined: 28 Sep 2007
Posts: 26

PostPosted: Tue Feb 12, 2008 10:17 pm    Post subject: Pause this script Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
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