czardas Posted June 22, 2012 Posted June 22, 2012 (edited) Click the Disable button and then press the escape key on your keyboard. Does the program exit? If not, click on another window and then back on the GUI. Then press Escape a second time. Does the program exit? #include <GUIConstantsEx.au3> _FocusExample_1() Func _FocusExample_1() $hGUI = GUICreate("Focus Example", 200, 80) $hButton = GUICtrlCreateButton("Disable",5,5, 70,20) $hLabelFocus = GUICtrlCreateLabel("Press escape" & @LF & "key to quit", 10, 30, 70, 30) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $hButton GUICtrlSetState($hButton, $GUI_DISABLE) EndSwitch WEnd EndFunc The answers I get on XP pro SP3 are NO and YES in that order. Do you get the same result? Edited June 22, 2012 by czardas operator64 ArrayWorkshop
water Posted June 22, 2012 Posted June 22, 2012 Windows 7 SP1 64Bit.Click the Disable button and then press the escape key on your keyboard.Does the program exit? NOIf not, click on another window and then back on the GUI. Then press Escape a second time.Does the program exit? YES My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
czardas Posted June 22, 2012 Author Posted June 22, 2012 Thanks water that's everything I needed to know. operator64 ArrayWorkshop
JohnOne Posted June 22, 2012 Posted June 22, 2012 (edited) Same. EDIT: Win 7 32 Edited June 22, 2012 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
water Posted June 22, 2012 Posted June 22, 2012 (edited) Hi czardas, unfortunately your example _FocusExample_2 doesn't work here. Press disable and ESC: Script exits. Press disable, set focus to another window and back to the script, press ESC: Script exits Edited June 22, 2012 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
czardas Posted June 22, 2012 Author Posted June 22, 2012 (edited) water, do you mean Example 2 doesn't always quit when you hit escape? Please check I didn't accidently paste the wrong code. The forum boxes are all messed up. I had better delete my post if this is the case. I want it to exit every time you hit the escape key.Oops, I just reread what you posted. It seems to be the way I intended. A slight misunderstanding. Press disable and ESC: Script exits.Press disable, set focus to another window and back to the script, press ESC: Script exitsGood, thanks for the feedback. Edited June 22, 2012 by czardas operator64 ArrayWorkshop
water Posted June 22, 2012 Posted June 22, 2012 Oops, misunderstood the goal of your script. You always want it to exit. I thought it was the other way round. Ignore my post My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
czardas Posted June 22, 2012 Author Posted June 22, 2012 I added an extra comment because what I wrote wasn't all that clear. Boy these code boxes are really hard work at the moment. Just one spelling mistake can take more than a minute to fix because all the indents are removed from your code every time you try and edit somehing. Arghh` operator64 ArrayWorkshop
AZJIO Posted June 22, 2012 Posted June 22, 2012 because all the indents are removedSwitch to text mode (button above B (Bold)). In this mode, the indents are not removed. My other projects or all
czardas Posted June 22, 2012 Author Posted June 22, 2012 Thanks AZJIO for the tip. I'll definately try that next time. operator64 ArrayWorkshop
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