📄 clsregistryaccess.cls
字号:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "clsRegistryAccess"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'--------------------------------------------[-][x]--'
'----------------[ Registry Access ]-----------------'
'----------------------------------------------------'
' ______________________ '
' Name: clsRegistryAccess '
' Source type: Class Module '
' Version: 2.05 '
' Author: Aleksandar Ruzicic a.k.a. krckoorascic '
' Modified by: <nobady so far> '
' Contact: krckoorascic@gmail.com '
' Last update: Friday, April 08, 2005 20:51 '
' ______________________ '
' BIG Thanx goes to: '
' -The KPD-Team for their API-Guide! '
' -Chirstoph von Wittich for his ApiViewer 2004 '
' -mladenovicz & Shadowed for all their help '
' -and all folks from EliteSecurity.org '
'-------------------------------------------------------------------------------'
'[-]Licence: '
'You are free to use this class in the way you like it, but it will be nice to '
'to put me in credits ;o). If you modify something (fix bug or add new features)'
'please put your name above (in 'Modified by') and mail me. '
' '
'[-]Contents: '
' [1] - rcMainKey (Enum) '
' [2] - rcRegType (Enum) '
' [3] - CreateKeyIfDoesntExists (Property) '
' [4] - GetKeys (Private Function) '
' [5] - CreateKey (Function) '
' [6] - KillKey (Function) '
' [7] - KeyExists (Function) '
' [8] - EnumKeys (Function) '
' [9] - HaveSubKey (Function) '
' [10] - WriteString (Function) '
' [11] - ReadString (Function) '
' [12] - WriteDWORD (Function) '
' [13] - ReadDWORD (Function) '
' [14] - WriteBinary (Function) '
' [15] - ReadBinary (Function) '
' [16] - KillValue (Function) '
' [17] - ValueExists (Function) '
' [18] - EnumValues (Function) '
' [19] - ExportToReg (Function) '
' [20] - generateReg (Private Function) '
' [21] - ImportFromReg Function) '
' [22] - StrToBin (Private Function) '
' [23] - BinToStr (Private Function) '
' [24] - isBinValid (Function) '
' _____________________________________ '
' [1] rcMainKey (Enum) '
' Enum (public) which holds all root keys (hkeys). Its only possible to write to'
' first five: HKCR, HKCU, HKLM, HKUS, HKPD. '
' '
' [2] rcRegType (Enum) '
' Enum (Public) holds allregistry data types. In this class only tree main are '
' covered, that are: REG_SZ, REG_BINARY and REG_DWORD. '
' '
' [3] CreateKeyIfDoesntExists (Property) '
' Property, Boolean, Let/Get; when writting some value to registry, in some key,'
' if that key doesnt exist then it will be created if this property is true, but'
' if is set to false then writting function will return error (0). '
' '
' [4] GetKeys (Private Function) '
' Used to separate given path (to some key) in two values, the hkey value and to'
' subkey of that hkey. This function also alows you to use short constants, e.g.'
' for: '
' HKEY_LOCAL_MACHINE '
' you may use: '
' HKLM '
' which is very simpler. '
' This is the list of short consts: '
' HKEY_CLASSES_ROOT ........ HKCR '
' HKEY_CURRENT_USER ........ HKCU '
' HKEY_LOCAL_MACHINE ....... HKLM '
' HKEY_USERS ............... HKUS '
' HKEY_PERFORMANCE_DATA .... HKPD '
' HKEY_CURRENT_CONFIG ...... HKCC '
' HKEY_DYN_DATA ............ HKDD '
' '
' [5] CreateKey (Function) '
' Creates new key in Registry '
' CreateKey(sPath) As Long '
' sPath - string; path to the key to create '
' CreateKey("HKCU\Software\ES") '
' Function returns: '
' 0 - if there is an error '
' handle of created key, non-zero, if success '
' '
' [6] KillKey (Function) '
' Deletes existing key (and all of his subkeys) from Registry '
' KillKey(sPath) As Long '
' sPath - string; path to the key to delete '
' KillKey("HKCU\Software\ES") '
' Function returns:: '
' 0 - if there is an error '
' handle deleted key, non-zero, if success '
' '
' [7] KeyExists (Function) '
' Cheks if key exists. '
' KeyExists(sPath) As Boolean '
' sPath - string; path to the key to check '
' KeyExists("HKCU\Software\ES\Login") '
' Function returns: '
' True - key exists '
' False - key doesn't exists '
' '
' [8] EnumKeys (Function) '
' Returns an array of all subkeys of given key. '
' EnumKeys(sPath As String, Key() As String) As Long '
' sPath - string; path to the key which subkeys will be returned '
' Key() - string array; empty array which will hold names of subkeys '
' EnumKeys("HKCU\Software",Ime) '
' Function returns: '
' -1 - if there is an error '
' number of subkeys if success '
' filled zero-based string array (filled with names) '
' '
' [9] HaveSubKey (Function) '
' Returns true if given key have atleast one key '
' HaveSubKey(sPathAs String) As Boolean '
' sPath - string; path to the key which will be checked for subkeys '
' HaveSubKeys("HKCU\Software\ES") '
' Function returns: '
' true - in given key exists atleast one subkey '
' false - no subkeys in this key '
' '
' [10] WriteString (Function) '
' Writes/edits string data type into registry '
' WriteString(sPath, sName, sValue) As Long '
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -