#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <TreeViewConstants.au3>
#include <StaticConstants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <TreeViewConstants.au3>
#include <Array.au3>
$Form1 = GUICreate("RegExplo", 615, 438, 192, 124)
$tree = GUICtrlCreateTreeView(8, 8, 257, 425)
$listview = GUICtrlCreateListView("", 280, 8, 321, 313)
GUICtrlCreateGroup("Informations", 280, 336, 321, 89)
;GUISetState(@SW_SHOW)
Dim $registry[5] = ["HKLM", "HKCU","HKU", "HKCR", "HKCC"]
If StringInStr(@CPUArch,"64") Then Dim $registry[5] = ["HKLM64", "HKCU64","HKU64", "HKCR64", "HKCC64"]

$counts = 1
$length = UBound($registry)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $length = ' & $length & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
Do
	For $i=$counts To $length
		$c = 1
	While 1 ;Subkeys
		$newdata = RegEnumKey($registry[$counts],$c)
		If @error Then ExitLoop
		_ArrayAdd($registry,$registry[$counts]&"/"&$newdata)
		;ConsoleWrite($registry[$counts]&"/"&$newdata&@CRLF)
		$c = $c +1
	WEnd
	$counts = $counts +1

	Next
$length = UBound($registry)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $length = ' & $length & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $counts = ' & $counts & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
Until $counts==$length

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

	EndSwitch
WEnd