registry in array laden

  • Hmh ich seh nich wo der fehler liegt. Die logik entzieht sich mir.
    Eigentlich sind die bedingungen eindeutig und true und es giebt das was angeblich fehlt..

    [autoit]

    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 ConsoleDo 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 ConsoleConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $counts = ' & $counts & @crlf & '>Error code: ' & @error & @crlf) ;### Debug ConsoleUntil $counts==$length

    [/autoit]


    error

    [autoit]

    $newdata = RegEnumKey($registry[$counts],$c)$newdata = RegEnumKey(^ ERROR

    [/autoit]

    EDIT Die Formatierung funktioniert mal wieder nicht X(
    EDIT 2 Als datei angehängt nach 5facher bearbeitung.....

  • hier mal richtig formatiert :

    Spoiler anzeigen
    [autoit]

    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

    [/autoit]
  • Vielleicht hilft die ja meine _GetRegSubKeys() - Funktion weiter, siehe Signatur ;)

    Wozu brauchst du das eigentlich? 8|

    Mfg

    There's a joke that C has the speed and efficieny of assembly language combined with readability of....assembly language. In other words, it's just a glorified assembly language. - Teh Interwebz

    C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, you blow off your whole leg. - Bjarne Stroustrup
    Genie zu sein, bedeutet für mich, alles zu tun, was ich will. - Klaus Kinski

  • Wird n regedit :D nur besser^^
    wär halt geil wenn ich das in nem array hätte. Würde gern die funktionen so benutzen wie sie gegeben sind hatte aber
    schonmal das problem mit sich selbst erweiternden arrays in einer schleife nur leider is das script untergegangen


    EDIT habs selbst gemacht, das lädt erstmal alles. Dynamisch Laden hab ich versucht kratzt aber immer ab X( muss ich mal dran arbeiten.
    Werds dann hier rein Posten

    [autoit]

    #include <GUIConstantsEx.au3>#include <EditConstants.au3>#include <Array.au3>#include <ButtonConstants.au3>#include <GUIConstantsEx.au3>#include <ListViewConstants.au3>#include <ProgressConstants.au3>#include <TreeViewConstants.au3>#include <WindowsConstants.au3>Opt("GUIOnEventMode", 1)$1 = GUICreate("RegExplo", 824, 526, 375, 226)$tree = GUICtrlCreateTreeView(8, 8, 257, 505)$listview = GUICtrlCreateListView("Name|Form|Wert", 280, 8, 529, 313)GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 100)GUICtrlCreateGroup("Informations", 280, 336, 385, 153)$querry = GUICtrlCreateLabel("Query : ...",285,470,220,15)$Progress = GUICtrlCreateProgress(280, 496, 529, 17)GUICtrlCreateGroup("Options", 680, 336, 129, 153)GUISetState(@SW_SHOW)$i = 0Dim $handels[1]Dim $registry[1] = ["HKLM"]$handels[0] = GUICtrlCreateTreeViewItem($registry[0],$tree)
    If StringInStr(@OSArch,"64") ThenDim $registry[1] = ["HKLM64"]$toadd = "HKCU64 HKCR64 HKU64 HKCC64"Else$toadd = "HKCU HKCR HKU HKCC"EndIf$keys = StringSplit($toadd," ")For $k=1 To $keys[0] recurse() _ArrayAdd($registry,$keys[$k])Nextrecurse()
    While 1 Sleep(110) WEnd

    [/autoit][autoit][/autoit][autoit]

    Func recurse()Do $a = 1 $timerinit = TimerInit() While 1 $x = RegEnumKey($registry[$i],$a) If @error Then ExitLoop _ArrayAdd($registry,$registry[$i]&"\"&$x) $x1 = GUICtrlCreateTreeViewItem($x,$handels[$i]) GUICtrlSetOnEvent(-1,"ReciveData") _ArrayAdd($handels,$x1) $a = $a +1 WEnd $timerend = TimerDiff($timerinit) $i = $i +1 $t = UBound($registry) GUICtrlSetData($Progress,$i/$t*100) GUICtrlSetData($querry,"Querry : "&$registry[$i])Until $i==$tEndFunc
    Func ReciveData()
    EndFunc

    [/autoit]

    -

    2 Mal editiert, zuletzt von Nachid (7. Februar 2013 um 17:42)

  • Für alle dies mal brauchen können.
    Dynamisches nachladen der registry.

    Spoiler anzeigen
    [autoit]

    #cs ----------------------------------------------------------------------------
    AutoIt Version: 3.3.8.1 Author: myName
    Script Function: Template AutoIt script.
    #ce ----------------------------------------------------------------------------
    ; Script Start - Add your code below here
    #include <GUIConstantsEx.au3>#include <TreeViewConstants.au3>#include <WindowsConstants.au3>#include <Array.au3>#include <GUITreeView.au3>Opt("GUIDataSeparatorChar", "\")Opt("GUIOnEventMode", 1)$Form1 = GUICreate("test", 449, 442, 192, 124)$Tree = GUICtrlCreateTreeView(8, 8, 425, 417)GUICtrlSetOnEvent(-1,"TreeClick")GUISetState(@SW_SHOW)
    Dim $registry[5] = ["HKLM64","HKCU64","HKCR64","HKU64","HKCC64"]Dim $handles[5]For $i=0 To UBound($registry)-1 $handles[$i] = GUICtrlCreateTreeViewItem($registry[$i],$Tree) GUICtrlSetOnEvent(-1,"TreeClick")Next
    While 1 Sleep(100)WEnd
    Func TreeClick() $clickedhandle = GUICtrlRead($Tree) $nameclicked = GUICtrlRead($Tree,1) $arrayposition = _ArraySearch($handles,$clickedhandle) $instance = 1 If Not _GUICtrlTreeView_GetChildren($Tree,$clickedhandle) Then While 1 $x = RegEnumKey($registry[$arrayposition],$instance) If @error Then ExitLoop $newhandel = GUICtrlCreateTreeViewItem($x,$handles[$arrayposition]) GUICtrlSetOnEvent(-1,"TreeClick") _ArrayAdd($handles,$newhandel) _ArrayAdd($registry,$registry[$arrayposition]&"\"&$x) $instance = $instance +1 WEnd EndIfEndFunc

    [/autoit]

    -


  • Dein Browser hat mal wieder die Formatierung zerrissen.

    Füg es bitte nochmal mit FF im "Quellcode" - Tab ein, da sollt es funktionieren.

    Mfg

    There's a joke that C has the speed and efficieny of assembly language combined with readability of....assembly language. In other words, it's just a glorified assembly language. - Teh Interwebz

    C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, you blow off your whole leg. - Bjarne Stroustrup
    Genie zu sein, bedeutet für mich, alles zu tun, was ich will. - Klaus Kinski

  • Okay mach ich sobald ich daheim bin hab 2 funktionen gebastelt. Einmal komplettes Laden (~100mb dauert seine Zeit)
    und einmal Dynamisches Nachladen im ListView.

    -