Deye Posted July 25, 2018 Posted July 25, 2018 (edited) Hi, what is the best way to tackle this for some reason can't wrap my head about it too much at this time or investigate .. expandcollapse popup#include <GUIConstantsEx.au3> Global $bReturn = 0 Example() Func Example() ; Create a GUI with various controls. Local $hGUI = GUICreate("Example") Local $idOK1 = GUICtrlCreateButton("OK", 310, 370, 85, 25) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idOK1 If $bReturn <> 0 Then $bReturn = 2 ;<-------- ContinueLoop EndIf _function() ;~ Case $idOK2 ;~ If $bReturn <> 0 Then ;~ $bReturn = 3 <-------- ;~ ContinueLoop ;~ EndIf ;~ _function2() EndSwitch Sleep(10) WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc ;==>Example Func _function() $bReturn = 99 ; wait for button evaluation .. While 1 If $bReturn <> 99 Then ExitLoop Sleep(1000) WEnd MsgBox(0, '', $bReturn) $bReturn = 0 EndFunc ;==>function Thanks Deye Edit : never mind ..got it working with using something like : Func _function() Local $sread $bReturn = 99 ; wait for button evaluation .. While 1 $sread = ControlGetFocus($hGUI) If StringInStr($sread, "Button", "") Then $sread = StringReplace($sread, "Button", "") Sleep(100) ExitLoop EndIf Sleep(100) WEnd ConsoleWrite($sread & @CRLF) $bReturn = 0 EndFunc ;==>_function Edited July 25, 2018 by Deye
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