fikri1979 Posted October 7, 2013 Posted October 7, 2013 Hello... i'm beginner programing how to enable button when other gui close? my script #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 294, 146, 192, 114) $START = GUICtrlCreateButton("START", 88, 48, 113, 41) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $START run("notepad.exe") GUICtrlSetState($START, $GUI_DISABLE) Case $START ProcessClose("notepad.exe") GUICtrlSetState($START, $GUI_ENABLE) EndSwitch WEnd
Terenz Posted October 7, 2013 Posted October 7, 2013 #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 294, 146, 192, 114) $START = GUICtrlCreateButton("START", 88, 48, 113, 41) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $START run("notepad.exe") GUICtrlSetState($START, $GUI_DISABLE) EndSwitch If Not ProcessExists("notepad.exe") And BitAnd(GUICtrlGetState($START), $GUI_DISABLE) = $GUI_DISABLE Then ; <<<<<<<<<<<< check if process not exist and if botton is disabled GUICtrlSetState($START, $GUI_ENABLE) EndIf WEnd Check the comment part, don't make 2 cases for the same button fikri1979 1 Nothing is so strong as gentleness. Nothing is so gentle as real strength
Solution fikri1979 Posted October 7, 2013 Author Solution Posted October 7, 2013 #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 294, 146, 192, 114) $START = GUICtrlCreateButton("START", 88, 48, 113, 41) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $START run("notepad.exe") GUICtrlSetState($START, $GUI_DISABLE) EndSwitch If Not ProcessExists("notepad.exe") And BitAnd(GUICtrlGetState($START), $GUI_DISABLE) = $GUI_DISABLE Then ; <<<<<<<<<<<< check if process not exist and if botton is disabled GUICtrlSetState($START, $GUI_ENABLE) EndIf WEnd Check the comment part, don't make 2 cases for the same button thanks you very much...
Terenz Posted October 7, 2013 Posted October 7, 2013 Hope did you understand what is the problem with that script... fikri1979 1 Nothing is so strong as gentleness. Nothing is so gentle as real strength
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