Jump to content

On Pause


Recommended Posts

I looked but couldn't find this answer, but certain it has been asked before. Is there anyway a function can be triggered just before a script is "paused" when its icon is clicked. The default autoit gui will cause the script to pause if the trey icon is clicked right or left. I have a script that while running removes the close button from another application (to prevent accidental closure), when my script closes it restores the close button. But i'd like this to also happen should the script be paused. Any way to capture this, short of a whole context menu creation with a new pause function..

Thanks.

 

Spoiler

WinSizer 2.1 (01/04/2017) - Download - [ Windows Layout Manager ]
Folder+Program (12/23/2016) - Download - [ USB Shortcut Creator ]

 

Link to comment
Share on other sites

Actually trying to avoid that, my question is... Is there a way to trigger an action/function just before a script gets paused when its icon gets clicked.. For instance, say if a left or right click is detected, enable the button, then script gets paused. I know I can create a custom context menu and create function that simulates the pause.. Trying to avoid doing that. Didn't know if there was a built in functions like "onPause" that can be used instead of coding a whole menu and pause function. I am already using the "OnAutoItExitRegister("OnClose")" just curious if a similar function was available to catch a pause event.

Edited by zone97

 

Spoiler

WinSizer 2.1 (01/04/2017) - Download - [ Windows Layout Manager ]
Folder+Program (12/23/2016) - Download - [ USB Shortcut Creator ]

 

Link to comment
Share on other sites

The whole point of pausing the script is so that it stop processing until you unpause it. That would defeat the entire purpose of pausing the script. You can't do something if you tell it to stop doing anything.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

3 minutes ago, BrewManNH said:

The whole point of pausing the script is so that it stop processing until you unpause it. That would defeat the entire purpose of pausing the script. You can't do something if you tell it to stop doing anything.

this....

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

Ok, i get that COMPLETEDLY.. What I am needing is a trap, to do something JUST before pause takes effect. Just like the example I gave. OnAutoItExitRegister("OnClose") which does something just before closing the script.. If a function doesnt exist to do this, i'm out of luck as its too much work to build a custom context menu to pause/unpause just to do what i need.

 

Spoiler

WinSizer 2.1 (01/04/2017) - Download - [ Windows Layout Manager ]
Folder+Program (12/23/2016) - Download - [ USB Shortcut Creator ]

 

Link to comment
Share on other sites

You must ask yourself what is paused and what is not paused. Is it the entire Windows system that's paused? I doubt it. It's probably only the internal AutoIt message handling system that's paused.

Therefore your problem can be solved with a technique called subclassing. If you know how to implement subclassing in AutoIt then it's not that hard. If you don't know, then it's not a trivial task.

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...