Код:
- Код: Выделить всё
Module RegistryData
Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Integer, ByVal lpSubKey As String, ByVal ulOptions As Integer, ByVal samDesired As Integer, ByVal phkResult As Integer) As Integer
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Integer) As Integer
Private Const HKEY_LOCAL_MACHINE = &H80000002
Private Const KEY_READ = &H20019
Public Function isRegistryDataExists() As Boolean
Dim iResult As Integer
Dim RetVal As Integer
RetVal = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\7-Zip", 0, KEY_READ, iResult)
If RetVal = 0 Then
isRegistryDataExists = True
RegCloseKey(iResult)
Else
isRegistryDataExists = False
End If
End Function
End Module