Bert Posted March 18, 2016 Share Posted March 18, 2016 Can someone check this please? According to the help file I should be able to nest an expression. However when I run this script it will run UNTIL I move my mouse then it exits. #include <Process.au3> #include <Inet.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <String.au3> #include <TrayConstants.au3> #include <WinAPIFiles.au3> DIM $button1, $button2 WindowXX() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE or $button2 _exit() ;~ Case $button2 ;~ _exit() EndSwitch WEnd Func WindowXX() $hGUI = GUICreate("Launcher", 270, 190,-1,-1,-1,$WS_EX_TOPMOST ) $button1 = GUICtrlCreateButton("Launch",195, 40, 50, 20) $button2 = GUICtrlCreateButton("Exit",195, 100, 50, 20) GUISetState(@SW_SHOW, $hGUI) EndFunc func _exit() Exit EndFunc The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Bert Posted March 18, 2016 Author Share Posted March 18, 2016 I know I can simply use a second case to fix it but I like to nest it or learn the proper way to nest something like this so the same function can be called when the action occurs. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Danyfirex Posted March 18, 2016 Share Posted March 18, 2016 Hi. Should be Case $GUI_EVENT_CLOSE , $button2 Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
UEZ Posted March 18, 2016 Share Posted March 18, 2016 (edited) While 1 $iMsg = GUIGetMsg() ; -> mouse move $iMsg = -11 Switch $iMsg Case $GUI_EVENT_CLOSE or $button2 ; -> -3 OR 4 = True ConsoleWrite($iMsg & "/" & $GUI_EVENT_CLOSE & "/" & $button2 & @CRLF) ConsoleWrite($GUI_EVENT_CLOSE or $button2 & @CRLF) _exit() ;~ Case $button2 ;~ _exit() EndSwitch WEnd $iMsg = -11 which is <> 0 and thus = True Case $GUI_EVENT_CLOSE or $button2 ; -> -3 OR 4 = True Thus it will switch into the case condition! As @Danyfirex already said, the OR condition of the values is a comma -> Case $GUI_EVENT_CLOSE, $button2 Edited March 18, 2016 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Bert Posted March 18, 2016 Author Share Posted March 18, 2016 Thanks! The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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