title image


Smiley Re: Registry durchsuchen


'Zweck: Diese Funktion listet elle Schlüssel aus einem Schlüssel auf.'Parameter: nClassKey   Klass, in dem der folgender Schlüssel existiert.'Parameter: sSectionKey Schlüssel, der alle seine Schlüssel liefert.'Parameter: sSect       Auflistung aller Schlüssel im oberen Schlüssel.'Parameter: nSectCount  Anzahl aller Schlüssel in dem Schlüssel.Public Function REG_Enumerate_Sections(ByVal nClassKey As REG_ClassConstants, _                                        ByVal sSectionKey As String, _                                        ByRef sSect() As String, _                                        ByRef nSectCount As Long) As Boolean    On Error GoTo EnumerateSectionsError    Dim nReturn    As Long    Dim nKey       As Long    Dim dwReserved As Long    Dim szBuffer   As String    Dim nBuffSize  As Long    Dim nIndex     As Long    Dim nPos       As Long    nSectCount = 0    Erase sSect    nIndex = 0    nReturn = RegOpenKeyEx(nClassKey, sSectionKey, 0, KEY_ENUMERATE_SUB_KEYS, nKey)   Do While nReturn = ERROR_SUCCESS        'Set buffer space       szBuffer = String$(255, 0)       nBuffSize = Len(szBuffer)      'Get next value       nReturn = RegEnumKey(nKey, nIndex, szBuffer, nBuffSize)       If (nReturn = ERROR_SUCCESS) Then            nSectCount = nSectCount + 1            ReDim Preserve sSect(1 To nSectCount) As String            nPos = InStr(szBuffer, Chr$(0))           If (nPos > 0) Then               sSect(nSectCount) = Left(szBuffer, nPos - 1)           Else               sSect(nSectCount) = Left(szBuffer, nBuffSize)           End If        End If        nIndex = nIndex + 1    Loop    If (nKey <> 0) Then       RegCloseKey nKey    End If    REG_Enumerate_Sections = True    Exit Function EnumerateSectionsError:    If (nKey <> 0) Then       RegCloseKey nKey    End If    Err.Raise vbObjectError + 1048 + 26002, App.EXEName & ".modRegistry", Err.Description    Exit Function End Function

Mit freundlichen Grüßen

AndyG

E-Mail:  Andreas_Graf [öt] DevPlanet.de
Homepage:  http://www.DevPlanet.de



geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: