#include <GUIConstantsEx.au3>
$hGUI = GUICreate('_ControlSetAllInputs', 200, 160)
$iInput1 = GUICtrlCreateInput('Text1', 20, 20, 160, 20)
$iInput2 = GUICtrlCreateInput('Text2', 20, 50, 160, 20)
$iInput3 = GUICtrlCreateInput('Text3', 20, 80, 160, 20)
$iClear_Button = GUICtrlCreateButton('Clear All', 20, 120, 80, 20)
GUISetState(@SW_SHOW, $hGUI)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $iClear_Button
_ControlSetAllInputs($hGUI)
EndSwitch
WEnd
Func _ControlSetAllInputs($hWnd, $sText = '', $bOnlyVisible = True)
Local $aClasses = StringSplit(WinGetClassList($hWnd), @LF)
Local $iC = 0
For $i = 1 To $aClasses[0]
If $aClasses[$i] = 'Edit' Then
$iC += 1
If Not $bOnlyVisible Or ($bOnlyVisible And ControlCommand($hWnd, '', $aClasses[$i] & $iC, 'IsVisible')) Then
ControlSetText($hWnd, '', $aClasses[$i] & $iC, $sText)
EndIf
EndIf
Next
EndFunc