;-- TIME_STAMP   2021-02-13 15:39:36

#include-once
#include <Debug.au3>
#include <WinGetControls.au3>

_Example()

Func _Example()
	Local $aHeader, $iStart = 1, $bProcessInfo = True, $bExtended = True, $iMaxTextLen = -2
	Local $aControls = _WinGetControls(WinGetHandle('[Active]'), $WGC_SHOWALL, $bProcessInfo, $bExtended, $iMaxTextLen)

	If UBound($aControls) Then
		_DebugArrayDisplay($aControls, '$aControls')

		If $bProcessInfo Then
			$iStart = 4
			$aHeader = StringSplit(_WGC_GetHeader($eHeader_ProcessInfo), '|', 2)
			_DebugArrayDisplay($aHeader, '$aHeader - Process')
			For $j = 0 To UBound($aHeader) -1 Step 1
				If IsArray($aControls[1][$j]) Then
					ConsoleWrite(StringFormat("! ProcessInfo[  1][%2i] : %-12s  %-21s  = %s\r\n", $j, VarGetType($aControls[1][$j]), $aHeader[$j], _ArrayToString($aControls[1][$j], ', ', -1, -1, ', ')))
					_DebugArrayDisplay($aControls[1][$j], 'ProcessInfo['&$aHeader[$j]&']')
				Else
					ConsoleWrite(StringFormat("> ProcessInfo[  1][%2i] : %-12s  %-21s  = %s\r\n", $j, VarGetType($aControls[1][$j]), $aHeader[$j], $aControls[1][$j]))
				EndIf
			Next
			ConsoleWrite(@CRLF)
		EndIf

		$aHeader = StringSplit(_WGC_GetHeader($eHeader_Controls), '|', 2)
		For $i = $iStart To UBound($aControls) -1 Step 1
			For $j = 0 To UBound($aHeader) -1 Step 1
				If IsArray($aControls[$i][$j]) Then
					ConsoleWrite(StringFormat("- Controls[%3i][%2i]    : %-12s  %-21s  = %s\r\n", $i, $j, VarGetType($aControls[1][$j]), $aHeader[$j], _ArrayToString($aControls[1][$j], ', ', -1, -1, ', ')))
					_DebugArrayDisplay($aControls[$i][$j], 'Control['&$aHeader[$j]&']')
				Else
					ConsoleWrite(StringFormat("+ Controls[%3i][%2i]    : %-12s  %-21s  = %s\r\n", $i, $j, VarGetType($aControls[$i][$j]), $aHeader[$j], $aControls[$i][$j]))
				EndIf
			Next
			ConsoleWrite(@CRLF)
		Next
	EndIf
EndFunc

