Gidiyorsun Posted November 2, 2018 Posted November 2, 2018 Hello, I would like to know, if there is a way to terminate a script, if it has been paused. I made a script 4-5 years ago, where pressing CTRL-ALT-DELETE wouldn't allow the script to continue, but this is no longer the case. Is there a way to terminate a script if CTRL-ALT-DELETE has been pressed?
Xandy Posted November 2, 2018 Posted November 2, 2018 (edited) A paused script does not run. That's my theory on it anyways. Using a second unpaused script, you could monitor the heartbeat of the first script. If the heart is beating; it is not paused. I would check for CTRL, ALT, DELETE with _IsPressed() Edited November 2, 2018 by Xandy Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker)
Nine Posted November 2, 2018 Posted November 2, 2018 Ctrl+Alt+Delete : It is reserved by Windows You cannot intercept that key. 3 hours ago, Xandy said: I would check for CTRL, ALT, DELETE with _IsPressed() Won't work because Windows will take over. Just set a HotkeySet of whatever key you like... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Gidiyorsun Posted November 2, 2018 Author Posted November 2, 2018 I do not wish to intercept, interfere or stop CTRL-ALT-DELETE. I just want the script to terminate or cancel if it's been pressed. Is it possible to terminate the script if a mouse click or mouse movement is detected?
Nine Posted November 2, 2018 Posted November 2, 2018 of course, but your "problem" is way TOO evasive to give you a correct answer, start with a detailed explanation of your needs, what you exactly want to achieve, a current example of your script that doesnt work, and then we will help you “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Xandy Posted November 3, 2018 Posted November 3, 2018 (edited) You can absolutely detect [CTRL, ALT, DELETE] with _IsPressed(). #include <Misc.au3> While Sleep(10) If _IsPressed(11) And _IsPressed(12) Then; CTRL, ALT If _IsPressed('2E') Then; DEL Beep() EndIf EndIf WEnd If you want to monitor when a script is paused give it a heart beat signal. When it's paused the signal will stop. Other script can end the paused script when signal stops. Edited November 3, 2018 by Xandy Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker)
Gidiyorsun Posted November 5, 2018 Author Posted November 5, 2018 I am working on a login script, that uses parameters to detect which login to use. I have used BlockInput, but if you click CTRL-ALT-DELETE, you cancel BlockInput and can click anywhere. If you do this, the script can start writing the password in the incorrect field. That's why I need a way to cancel the script. I will try with IsPressed, but I don't think it works in conjunction with BlockInput.
Nine Posted November 5, 2018 Posted November 5, 2018 it will work, just replace the beep by exit, job's done “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Gidiyorsun Posted November 9, 2018 Author Posted November 9, 2018 (edited) I finally solved this, by using some kind of while loop with _BlockInputEx This at the start #include <BlockInputEx.au3> HotKeySet("{ESC}", "_Quit") _BlockInputEx: _BlockInputEx(1, "{ESC}") and this at the end While 1 Sleep(100) WEnd Func _Quit() Exit EndFunc Exit This keeps BlockInputEx running, which keeps inputs blocked, even if you use CTRL-ALT-DELETE. Absolutely amazing. Pressing ESC terminates the script! Thanks for the assistance in here, it gave me inspiration! Edited November 9, 2018 by Gidiyorsun Added _BlockInputEx(1, "{ESC}") Xandy 1
Juvigy Posted November 12, 2018 Posted November 12, 2018 Are you sure it blocks CTRL-ALT-DELETE ? On my Win764bit PC it doesnt.
Skeletor Posted November 12, 2018 Posted November 12, 2018 This is the second post I have seen where the OP wants to Pause, Stop and Exit their script... is it me or am I missing something here? Kind RegardsSkeletor "Coffee: my defense against going postal." Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI
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