CheshireSoft Posted May 18, 2010 Share Posted May 18, 2010 Hi. I have been struggling with this issue for a long time now. I am unable to get my autoit programs to properly respond to user input while my program is performing any sort of operations. For instance, initial/main program loop checks for button presses successfully but after I enter any other loop this does not work properly even if I add $nMsg = GUIGetMsg() and corresponding conditional statements within the nested loops. When I add this sort of code to the nested loops what winds up happening if lets say someone tries to exit the program is that it wont exit until several iterations of the loop later. I don't understand this. How is this done properly? Link to comment Share on other sites More sharing options...
somdcomputerguy Posted May 18, 2010 Share Posted May 18, 2010 This function, HotKeySet, may help.. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
CheshireSoft Posted May 18, 2010 Author Share Posted May 18, 2010 This function, HotKeySet, may help..this isnt what im looking for. buttons need to work when user clicks them even if loops are iterating. Link to comment Share on other sites More sharing options...
Tvern Posted May 18, 2010 Share Posted May 18, 2010 (edited) A few suggestions: - Use Opt("GUIOnEventMode", 1) instead of messageloop. - Use smaller functions that return to the main loop more regularly - Put your GUIGetMsg() in a function which you call in the main loop, but also regularly in your functions. ;I wouldn't reccomend this as it's not commonly done this way. There's progably a reason for that. - Post your script here so you'll get more response edit: The suggestions are different ways to fix your problem, they're not meant to all be implemented, but rather you pick the one that best fits your needs and discard the others. Edited May 19, 2010 by Tvern Link to comment Share on other sites More sharing options...
GEOSoft Posted May 18, 2010 Share Posted May 18, 2010 A few suggestions:- Put your GUIGetMsg() in a function which you call in the main loop, but also regularly in your functions. ;I wouldn't reccomend this as it's not commonly done this way. There's progably a reason for that.There is a good reason for that.If the GUIOnEventMode option is set to 1 then the return from GUIGetMsg is always 0 and the @error is set to 1. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" 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