Visual Basic, .NET, ASP, VBScript
 

   
   
     

Форум - Общий форум

Страница: 1 |

 

  Вопрос: реестр Добавлено: 07.08.06 16:16  

Автор вопроса:  Leha
как узнать какие подразделы содержит в себе раздел?

Ответить

  Ответы Всего ответов: 5  

Номер ответа: 1
Автор ответа:
 Sacred Phoenix



ICQ: 304238252 

Вопросов: 52
Ответов: 927
 Профиль | | #1 Добавлено: 07.08.06 19:24
Public Declare Function RegEnumKey Lib "advapi32.dll" Alias "RegEnumKeyA" (ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpName As String, ByVal cbName As Long) As Long

Public Declare Function RegEnumKeyEx Lib "advapi32.dll" Alias "RegEnumKeyExA" (ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpName As String, lpcbName As Long, ByVal lpReserved As Long, ByVal lpClass As String, lpcbClass As Long, lpftLastWriteTime As FILETIME) As Long

Ответить

Номер ответа: 2
Автор ответа:
 Sacred Phoenix



ICQ: 304238252 

Вопросов: 52
Ответов: 927
 Профиль | | #2 Добавлено: 07.08.06 19:25
афаик

Ответить

Номер ответа: 3
Автор ответа:
 Серёга



ICQ: 262809473 

Вопросов: 17
Ответов: 561
 Web-сайт: houselab.narod.ru
 Профиль | | #3
Добавлено: 07.08.06 19:31
Чуть - чуть конкретнее:
Const ERROR_NO_MORE_ITEMS = 259&
Const HKEY_CURRENT_CONFIG = &H80000005
Const HKEY_LOCAL_MACHINE = &H80000002
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegEnumKeyEx Lib "advapi32.dll" Alias "RegEnumKeyExA" (ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpName As String, lpcbName As Long, ByVal lpReserved As Long, ByVal lpClass As String, lpcbClass As Long, lpftLastWriteTime As Any) As Long
Private Declare Function RegEnumValue Lib "advapi32.dll" Alias "RegEnumValueA" (ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpValueName As String, lpcbValueName As Long, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
Private Sub Form_Load()
    Dim hKey As Long, Cnt As Long, sName As String, sData As String, Ret As Long, RetData As Long
    Const BUFFER_SIZE As Long = 255
    'Set the forms graphics mode to persistent
    Me.AutoRedraw = True
    Me.Print "RegEnumKeyEx"
    Ret = BUFFER_SIZE
    'Open the registry key
    If RegOpenKey(HKEY_LOCAL_MACHINE, "software", hKey) = 0 Then
        'Create a buffer
        sName = Space(BUFFER_SIZE)
        'Enumerate the keys
        While RegEnumKeyEx(hKey, Cnt, sName, Ret, ByVal 0&, vbNullString, ByVal 0&, ByVal 0&;) <> ERROR_NO_MORE_ITEMS
            'Show the enumerated key
            Me.Print "  " + Left$(sName, Ret)
            'prepare for the next key
            Cnt = Cnt + 1
            sName = Space(BUFFER_SIZE)
            Ret = BUFFER_SIZE
        Wend
        'close the registry key
        RegCloseKey hKey
    Else
        Me.Print "  Error while calling RegOpenKey"
    End If
    Me.Print vbCrLf + "RegEnumValue"
    Cnt = 0
    'Open a registry key
    If RegOpenKey(HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion", hKey) = 0 Then
        'initialize
        sName = Space(BUFFER_SIZE)
        sData = Space(BUFFER_SIZE)
        Ret = BUFFER_SIZE
        RetData = BUFFER_SIZE
        'enumerate the values
        While RegEnumValue(hKey, Cnt, sName, Ret, 0, ByVal 0&, ByVal sData, RetData) <> ERROR_NO_MORE_ITEMS
            'show data
            If RetData > 0 Then Me.Print "  " + Left$(sName, Ret) + "=" + Left$(sData, RetData - 1)
            'prepare for next value
            Cnt = Cnt + 1
            sName = Space(BUFFER_SIZE)
            sData = Space(BUFFER_SIZE)
            Ret = BUFFER_SIZE
            RetData = BUFFER_SIZE
        Wend
        'Close the registry key
        RegCloseKey hKey
    Else
        Me.Print "  Error while calling RegOpenKey"
    End If
End Sub

Ответить

Номер ответа: 4
Автор ответа:
 Leha



Вопросов: 37
Ответов: 68
 Профиль | | #4 Добавлено: 07.08.06 19:38
вери сенкс

Ответить

Номер ответа: 5
Автор ответа:
 Sacred Phoenix



ICQ: 304238252 

Вопросов: 52
Ответов: 927
 Профиль | | #5 Добавлено: 07.08.06 20:48
гы, Серёга продолжил мыслю)))

Ответить

Страница: 1 |

Поиск по форуму



© Copyright 2002-2011 VBNet.RU | Пишите нам