VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Comprehensive registry access code. Everything from associating file types, putting an app in start

DiskJunky  (16 Submissions)   Registry   VB 6.0   Unknown Difficulty   Fri 17th January 2003   Mon 8th February 2021

Comprehensive registry access code. Everything from associating file types, putting an app in startup to disabling NT menus, getting cpu usage

API Declarations


'AUTHOR : Eric O'Sullivan
' -----------------------------------------------
'DATE : 11 Januarary 2001
' -----------------------------------------------
'CONTACT: [email protected]
' -----------------------------------------------
'TITLE : Registry Access Module
' -----------------------------------------------
'COMMENTS :
'This was made to retrieve various information
'that is stored in the registry.


'all variables must be declared
Option Explicit

'this module cannot be accessed from outside this project
Option Private Module

'text comparisons are not case sensitive
Option Compare Text

'------------------------------------------------
' API DECLARATIONS
'------------------------------------------------

'api calls to retereive the system and windows folders
Private Declare Function GetSystemDirectory _
Lib "kernel32" _
Alias "GetSystemDirectoryA" _
(ByVal lpBuffer As String, _
ByVal nSize As Long) _
As Long
Private Declare Function GetWindowsDirectory _
Lib "kernel32" _
Alias "GetWindowsDirectoryA" _
(ByVal lpBuffer As String, _
ByVal nSize As Long) _
As Long

'get the location of the temp directory on the system
Private Declare Function GetTempDirectory _
Lib "kernel32" _
Alias "GetTempPathA" _
(ByVal lBufferLength As Long, _
ByVal strBuffer As String) _
As Long

'get information about the current operating system
Private Declare Function GetVersionEx _
Lib "kernel32" _
Alias "GetVersionExA" _
(ByRef lpVersionInformation As OSVERSIONINFO) _
As Long

'registry api calls

'close an open registry key
Private Declare Function RegCloseKey _
Lib "advapi32.dll" _
(ByVal hKey As Long) _
As Long

'connect with the registry on a remote machine
Private Declare Function RegConnectRegistry _
Lib "advapi32.dll" _
Alias "RegConnectRegistryA" _
(ByVal lpMachineName As String, _
ByVal hKey As Long, _
phkResult As Long) _
As Long

'create a new registry key
Private Declare Function RegCreateKey _
Lib "advapi32.dll" _
Alias "RegCreateKeyA" _
(ByVal hKey As Long, _
ByVal lpSubKey As String, _
phkResult As Long) _
As Long
'create new - entended
Private Declare Function RegCreateKeyEx _
Lib "advapi32.dll" _
Alias "RegCreateKeyExA" _
(ByVal hKey As Long, _
ByVal lpSubKey As String, _
ByVal Reserved As Long, _
ByVal lpClass As String, _
ByVal dwOptions As Long, _
ByVal samDesired As Long, _
lpSecurityAttributes As SECURITY_ATTRIBUTES, _
phkResult As Long, _
lpdwDisposition As Long) _
As Long

'delete the specified registry key (also any sub keys
'for non-NT based systems)
Private Declare Function RegDeleteKey _
Lib "advapi32.dll" _
Alias "RegDeleteKeyA" _
(ByVal hKey As Long, _
ByVal lpSubKey As String) _
As Long

'delete a registry value
Private Declare Function RegDeleteValue _
Lib "advapi32.dll" _
Alias "RegDeleteValueA" _
(ByVal hKey As Long, _
ByVal lpValueName As String) _
As Long

'return a list of registry sub keys in the specified key
Private 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
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 FILETIME) _
As Long

'get a list of registry values in a key

Rate Comprehensive registry access code. Everything from associating file types, putting an app in start (2(2 Vote))
Comprehensive registry access code. Everything from associating file types, putting an app in start.bas

Comprehensive registry access code. Everything from associating file types, putting an app in start Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters