sublimnl Posted April 24, 2007 Posted April 24, 2007 (edited) I need to be able to abort a function if a button is pressed in my GUI. This function is basically a sleep(5000) command that allows the users time to abort the exit by pressing a button. I know I can test after the sleep(5000) line to see if the button was pressed, but I would really like something that will kill the function immediately and not sit there for a couple seconds before proceeding. Any ideas? Edited April 24, 2007 by sublimnl
Uten Posted April 24, 2007 Posted April 24, 2007 (edited) You have to set a flag and react on that in your function. Sleep is not so easy as you would know if you did create a small sample. Sleep suspends your process (thats not really the case with AutoIt but close enough). You have to create your own Sleep functionallity in your message loop. EDIT: Provide some basic sample code for us to work with and Someone might give you a nice solution. Edited April 24, 2007 by Uten Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
Developers Jos Posted April 24, 2007 Developers Posted April 24, 2007 Try using the GuiEvent options... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
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