name22

Disable All Controls

Jun 3rd, 2012
118
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <GUIConstants.au3>
  2.  
  3. $hWnd = GUICreate("")
  4. $cEdit = GUICtrlCreateEdit("", 5, 5, 200, 100)
  5. $cButton = GUICtrlCreateButton("OK", 5, 210, 60, 20)
  6. $cInput = GUICtrlCreateInput("Test", 210, 5, 80, 20)
  7. GUISetState()
  8. _DisableAllControls($hWnd, $cEdit, $cInput)
  9.  
  10. While GUIGetMsg() <> -3
  11. WEnd
  12.  
  13. Func _DisableAllControls($hWnd_Disable, $cStart, $cEnd, $bDisable = True)
  14.     GUISwitch($hWnd_Disable)
  15.     For $iID = $cStart To $cEnd
  16.         GUICtrlSetState($iID, $GUI_ENABLE * (1 + $bDisable))
  17.     Next
  18. EndFunc
RAW Paste Data