zone97 Posted July 30, 2018 Share Posted July 30, 2018 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 More sharing options...
Earthshine Posted July 30, 2018 Share Posted July 30, 2018 do the same thing. turn off the tray icon when you run. My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
zone97 Posted July 30, 2018 Author Share Posted July 30, 2018 I'd like to keep the ability to pause the app. 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 More sharing options...
FrancescoDiMuro Posted July 30, 2018 Share Posted July 30, 2018 If I am understanding right, you want to create a custom Tray Menu with custom functions? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Earthshine Posted July 30, 2018 Share Posted July 30, 2018 good luck My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
zone97 Posted July 30, 2018 Author Share Posted July 30, 2018 (edited) 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 July 30, 2018 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 More sharing options...
BrewManNH Posted July 30, 2018 Share Posted July 30, 2018 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. Earthshine 1 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 GudeHow 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 More sharing options...
FrancescoDiMuro Posted July 30, 2018 Share Posted July 30, 2018 @zone97 I think you could easily create a custom Tray Menu, which does perform only the Exit from the script. Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Earthshine Posted July 30, 2018 Share Posted July 30, 2018 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 More sharing options...
zone97 Posted July 31, 2018 Author Share Posted July 31, 2018 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 More sharing options...
LarsJ Posted July 31, 2018 Share Posted July 31, 2018 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. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now