Jump to content

Right click tray icon and Script paused


kripz
 Share

Recommended Posts

  • Moderators

When i right click the icon there is script paused and its ticked, what does this mean?

That you've paused the script/exe from running.

If you want to "un-pause", click the check mark.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

How do i disable users from pausing the script, get rid of the pause option from the right click menu completely?

Look in the help file index under Opt

Find your choice:

TrayAutoPause Script pauses when click on tray icon.

0 = no pause

1 = pause (default). If there is no DefaultMenu no pause will occurs.

TrayIconDebug If enabled shows the current script line in the tray icon tip to help debugging.

0 = no debug information (default)

1 = show debug

TrayIconHide Hides the AutoIt tray icon. Note: The icon will still initially appear ~750 milliseconds.

0 = show icon (default)

1 = hide icon

TrayMenuMode Extend the behaviour of the script tray icon/menu. This can be done with a combination (adding) of the following values.

0 = default menu items (Script Paused/Exit) are appended to the usercreated menu; usercreated checked items will automatically unchecked; if you double click the tray icon then the controlid is returned which has the "Default"-style (default).

1 = no default menu

2 = usercreated checked items will not automatically unchecked if you click it

4 = don't return the menuitemID which has the "default"-style in the main contextmenu if you double click the tray icon

8 = turn off auto check of radio item groups

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

You could try something like this:

HotKeySet("{PAUSE}", "TogglePause")
Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(10)
    WEnd
EndFunc

Add this to your script and you can pause the execution pressing the pause key.

Link to comment
Share on other sites

Im kinda curious how autoit does this?

Ive never been able to pause scripts from my GUIs before if they were already in a while loop, but they do pause if I hit the tray button.

How can I call whatever function its using?

The easiest way to pause a script is to do the following:

Global $Paused = 0

HotKeySet("{PAUSE}", "pause")

Func pause()

$Paused= NOT $Paused

While $Paused

sleep(100)

TraySetState(4)

WEnd

TraySetState(8)

EndFunc

Modified from somewhere within the help file.

Edited by Tasmania
Link to comment
Share on other sites

You could try something like this:

HotKeySet("{PAUSE}", "TogglePause")
Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(10)
    WEnd
EndFunc

Add this to your script and you can pause the execution pressing the pause key.

I don't reccomend putting the sleep at 10 miliseconds as this causes more polling on the CPU. I reccomend setting sleep to 100 ms or maybe even 2 or 300 ms... however what you may need is up to you.
Link to comment
Share on other sites

I don't reccomend putting the sleep at 10 miliseconds as this causes more polling on the CPU. I reccomend setting sleep to 100 ms or maybe even 2 or 300 ms... however what you may need is up to you.

Yeah, that's actually a typo. It said 100. Thanks for noticing.

Link to comment
Share on other sites

I don't reccomend putting the sleep at 10 miliseconds as this causes more polling on the CPU. I reccomend setting sleep to 100 ms or maybe even 2 or 300 ms... however what you may need is up to you.

Ya I will fool with the timing. I'm a big fan of straining the CPU as little as possible.

Thanks for the lighning quick replies too :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...