Accueil > > > REGISTRE WINDOWS
REGISTRE WINDOWS
Information sur la source
Description
Je partage mon module qui me permet de manipuler le registre avec assez de facilité. Le principe de lecture ou d'écriture est haché donc plus besoin de se préoccuper du type de la donnée. Vous pouvez le tester, le changer, l'améliorer a votre guise ! Par exemple, une fonction de suppression :) Pour les explications: GetStringRegisterError - Fonction qui récupère un message d'erreur pré formaté ClearRegister - Vide les informations d'accès registre temporaires CloseRegister - Ferme l'accès au registre SetSubRoot - Change le chemin clé après utilisation de SetRoot SetRoot - Ouvre un chemin clé OpenRegister - Ouvre l'accès au registre CheckRoot - Routine qui contrôle si le chemin clé existe CreateSubKey - Création d'une sous-clé CreateKey - Création d'un chemin clé SetValue - Modifie ou écrit une valeur de sous-clé GetValue - Lecture d'une valeur de sous-clé DIRECT_QueryValueEx - Lecture direct sans utiliser OpenRegister / CloseRegister
Source
- Public Enum enREG_KEYS
- HKEY_CLASSES_ROOT = &H80000000
- HKEY_CURRENT_USER = &H80000001
- HKEY_LOCAL_MACHINE = &H80000002
- HKEY_USERS = &H80000003
- HKEY_PERFORMANCE_DATA = &H80000004
- HKEY_CURRENT_CONFIG = &H80000005
- HKEY_DYN_DATA = &H80000006
- End Enum
-
- Enum enREG_TYPES
- REG_NONE = 0 ' No value type
- REG_SZ = 1 ' Unicode nul terminated string
- REG_EXPAND_SZ = 2 ' Unicode nul terminated string
- REG_BINARY = 3 ' Free form binary
- REG_BINARY_HEX = 8 ' Free form binary hex
- REG_BINARY_LONG = 9 ' Free form binary lng
- REG_DWORD = 4 ' 32-bit number
- REG_DWORD_BIG_ENDIAN = REG_DWORD
- REG_LINK = 6 ' Symbolic Link (unicode)
- REG_MULTI_SZ = 7 ' Multiple Unicode strings
- End Enum
-
- Private Type tyRegister
- hKey As Long 'Handle clé registre depuis constante
- hSKey As Long 'Handle de retour apres ouverture registre
- SubKey As String 'Chaine de la sous clé
- TypeKey As Long 'Type de donnée écrire ou lue
- HaveError As Boolean 'Erreur dans la fonction executé
- HaveErrorDescription As String 'Description de l'erreur
- End Type
- Public MyRegister As tyRegister
-
- Const KEY_READ = &H20019
-
- Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
- Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
- Private Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) 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 RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long
- Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
- Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
- Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As Any, source As Any, ByVal numBytes As Long)
-
- Public Function DIRECT_QueryValueEx(ByRef myKey As enREG_KEYS, ByRef mySubKey As String, ByRef myValueKey As String) As Variant
- Dim lResult As Long, lRtData As Long
- Dim lRtType As enREG_TYPES
-
- Call OpenRegister(myKey, mySubKey)
-
- lResult = RegQueryValueEx(MyRegister.phKey, myValueKey, 0, lRtType, ByVal 0, lRtData)
- TypeKey = lRtType
-
- '0 = Success de lecture de la valeur
- If lResult = 0 Then
- DIRECT_QueryValueEx = True
- Else
- DIRECT_QueryValueEx = False
- End If
- DIRECT_QueryValueEx = GetStringRegisterError("ERROR", "DIRECT_QueryValueEx", 0, lRt)
-
- Call CloseRegister
- End Function
-
- Public Function GetValue(ByVal sKeyValue As String) As Variant
- Dim lResult As Long, sDataBuf() As Byte, lDataBufSize As Long
- Dim lRtType As enREG_TYPES
- Dim rtString As String
- Dim rtLong As Long
-
- lResult = RegQueryValueEx(MyRegister.hSKey, sKeyValue, 0, lRtType, ByVal 0, lDataBufSize)
- TypeKey = lRtType
-
- If lResult = 0 Then
-
- ReDim sDataBuf(0 To lDataBufSize) As Byte
- lResult = RegQueryValueEx(MyRegister.hSKey, sKeyValue, 0, 0, sDataBuf(0), lDataBufSize)
-
- Select Case lRtType
-
- Case REG_SZ, REG_EXPAND_SZ
- rtString = Space$(lDataBufSize - 1)
- CopyMemory ByVal rtString, sDataBuf(0), lDataBufSize - 1
- GetValue = Trim(rtString)
-
- Case REG_MULTI_SZ
- rtString = Space$(lDataBufSize - 1)
- CopyMemory ByVal rtString, sDataBuf(0), lDataBufSize - 1
- GetValue = Replace(rtString, Chr(0), vbNewLine)
-
- Case REG_DWORD
- CopyMemory rtLong, sDataBuf(0), 4
- GetValue = rtLong
-
- Case REG_BINARY
- If lDataBufSize <> UBound(sDataBuf) + 1 Then
- ReDim Preserve sDataBuf(0 To lDataBufSize - 1) As Byte
- End If
- GetValue = sDataBuf()
-
- End Select
- End If
-
- Call GetStringRegisterError("ERROR", "GETVALUE", 0, lResult)
-
- End Function
-
- Private Function GetStringToBytesNumber(sAny As String) As Long
- Static i As Long
- Dim j As Long
-
- j = 0
- For i = 1 To Len(sAny) Step 2
- j = j + 1
- Next i
- GetStringToBytesNumber = j
- End Function
-
- Public Sub SetValue(ByVal lRtType As enREG_TYPES, sKeyValue As String, strData As Variant)
- Dim lResult As Long
- Dim lenTmp As Long
- Dim sDataBuf() As Byte
- Dim rtString As String
- Dim rtLong As Long
-
- Select Case lRtType
- Case REG_SZ, REG_EXPAND_SZ, REG_MULTI_SZ, REG_EXPAND_SZ
- rtString = CStr(strData)
- lResult = RegSetValueEx(MyRegister.hSKey, sKeyValue, 0, lRtType, ByVal rtString, Len(rtString))
- Case REG_BINARY
- If IsNumeric(strData) = True Then
- rtLong = CLng(strData)
- Else
- rtLong = CLng("&h" & strData)
- End If
- lenTmp = GetStringToBytesNumber(CStr(rtLong))
- ReDim sDataBuf(lenTmp - 1) As Byte
- CopyMemory sDataBuf(0), rtLong, lenTmp
- lResult = RegSetValueEx(MyRegister.hSKey, sKeyValue, 0, lRtType, sDataBuf(0), lenTmp - 1)
- Case REG_BINARY_HEX
- lenTmp = GetStringToBytesNumber(CStr(strData))
- ReDim sDataBuf(lenTmp - 1) As Byte
- rtLong = "&h" & strData
- CopyMemory sDataBuf(0), rtLong, lenTmp
- lResult = RegSetValueEx(MyRegister.hSKey, sKeyValue, 0, REG_BINARY, sDataBuf(0), lenTmp)
- Case REG_BINARY_LONG
- rtLong = strData
- lenTmp = GetStringToBytesNumber(CStr(Hex(strData)))
- lResult = RegSetValueEx(MyRegister.hSKey, sKeyValue, 0, REG_BINARY, rtLong, lenTmp)
- Case REG_DWORD
- rtLong = CLng(strData)
- lResult = RegSetValueEx(MyRegister.hSKey, sKeyValue, 0, lRtType, rtLong, 4)
- End Select
-
- Erase sDataBuf
- Call GetStringRegisterError("ERROR", "SETVALUE", 0, lResult)
- End Sub
-
- Public Sub CreateKey(ByVal myNewSKey As String, Optional CreateAndRoot As Boolean = False)
- Dim lResult As Long, rtKey As Long
-
- If CheckRoot(myNewSKey) = True Then Exit Sub
- lResult = RegCreateKey(MyRegister.hKey, myNewSKey, rtKey)
- If GetStringRegisterError("ERROR", "CREATEKEY", 0, lResult) = "" Then
- If CreateAndRoot = True Then
- MyRegister.hSKey = rtKey
- MyRegister.SubKey = myNewSKey
- SetRoot myNewSKey
- End If
- End If
- End Sub
-
- Public Sub CreateSubKey(ByVal myNewSKey As String, Optional CreateAndRoot As Boolean = False)
- Dim lResult As Long, rtKey As Long
-
- If CheckRoot(myNewSKey) = True Then Exit Sub
- lResult = RegCreateKey(MyRegister.hSKey, myNewSKey, rtKey)
- If GetStringRegisterError("ERROR", "CreateSubKey", 0, lResult) = "" Then
- If CreateAndRoot = True Then
- MyRegister.hSKey = rtKey
- MyRegister.SubKey = MyRegister.SubKey & "\" & myNewSKey
- SetSubRoot MyRegister.SubKey
- End If
- End If
- End Sub
-
- Public Function CheckRoot(ByVal mySKey As String) As Boolean
- Dim hRead As Long, hResult As Long
-
- hResult = RegOpenKeyEx(MyRegister.hKey, mySKey, 0, KEY_READ, hRead)
- If hResult = 0 Then RegCloseKey hRead
- Call GetStringRegisterError("ERROR", "CheckRoot", 0, lResult)
- End Function
-
- Public Sub OpenRegister(myKey As enREG_KEYS)
- If MyRegister.hKey > 0 Then CloseRegister
- Call ClearRegister
- MyRegister.hKey = myKey
- End Sub
-
- Public Sub SetRoot(mySKey As String)
- Dim lResult As Long
- MyRegister.SubKey = mySKey
- If MyRegister.hSKey > 0 Then RegCloseKey MyRegister.hSKey
- lResult = RegOpenKey(MyRegister.hKey, MyRegister.SubKey, MyRegister.hSKey)
- Call GetStringRegisterError("ERROR", "SetRoot", 0, lResult)
- End Sub
-
- Public Sub SetSubRoot(mySKey As String)
- Dim lResult As Long
- If Not MyRegister.SubKey = mySKey Then
- MyRegister.SubKey = MyRegister.SubKey & "\" & mySKey
- End If
- If MyRegister.hSKey > 0 Then RegCloseKey MyRegister.hSKey
- lResult = RegOpenKey(MyRegister.hKey, MyRegister.SubKey, MyRegister.hSKey)
- Call GetStringRegisterError("ERROR", "SetRoot", 0, lResult)
- End Sub
-
- Public Sub CloseRegister()
- RegCloseKey MyRegister.hSKey
- Call ClearRegister
- End Sub
-
- Private Sub ClearRegister()
- With MyRegister
- .hKey = 0
- .hSKey = 0
- .SubKey = ""
- .TypeKey = 0
- .HaveError = False
- .HaveErrorDescription = ""
- End With
- End Sub
-
- Private Function GetStringRegisterError(sLabel As String, sFunction As String, lTrueResult As Long, ByVal lResult As Long) As String
- 'Error ; Function Error ;
- 'Retour Query ; Key Handle ; SubKey Handle ; Root String
- Dim rtERR As String
- If lTrueResult = lResult Then
- MyRegister.HaveError = False
- rtERR = ""
- Else
- MyRegister.HaveError = True
- rtERR = UCase(sLabel) & "[;]" & _
- UCase(sFunction) & "[;]" & _
- CStr(lResult) & "[;]" & _
- MyRegister.hKey & "[;]" & _
- MyRegister.hSKey & "[;]" & _
- MyRegister.SubKey & "[;]"
- End If
- MyRegister.HaveErrorDescription = rtERR
- GetStringRegisterError = rtERR
- End Function
Public Enum enREG_KEYS
HKEY_CLASSES_ROOT = &H80000000
HKEY_CURRENT_USER = &H80000001
HKEY_LOCAL_MACHINE = &H80000002
HKEY_USERS = &H80000003
HKEY_PERFORMANCE_DATA = &H80000004
HKEY_CURRENT_CONFIG = &H80000005
HKEY_DYN_DATA = &H80000006
End Enum
Enum enREG_TYPES
REG_NONE = 0 ' No value type
REG_SZ = 1 ' Unicode nul terminated string
REG_EXPAND_SZ = 2 ' Unicode nul terminated string
REG_BINARY = 3 ' Free form binary
REG_BINARY_HEX = 8 ' Free form binary hex
REG_BINARY_LONG = 9 ' Free form binary lng
REG_DWORD = 4 ' 32-bit number
REG_DWORD_BIG_ENDIAN = REG_DWORD
REG_LINK = 6 ' Symbolic Link (unicode)
REG_MULTI_SZ = 7 ' Multiple Unicode strings
End Enum
Private Type tyRegister
hKey As Long 'Handle clé registre depuis constante
hSKey As Long 'Handle de retour apres ouverture registre
SubKey As String 'Chaine de la sous clé
TypeKey As Long 'Type de donnée écrire ou lue
HaveError As Boolean 'Erreur dans la fonction executé
HaveErrorDescription As String 'Description de l'erreur
End Type
Public MyRegister As tyRegister
Const KEY_READ = &H20019
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) 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 RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long
Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As Any, source As Any, ByVal numBytes As Long)
Public Function DIRECT_QueryValueEx(ByRef myKey As enREG_KEYS, ByRef mySubKey As String, ByRef myValueKey As String) As Variant
Dim lResult As Long, lRtData As Long
Dim lRtType As enREG_TYPES
Call OpenRegister(myKey, mySubKey)
lResult = RegQueryValueEx(MyRegister.phKey, myValueKey, 0, lRtType, ByVal 0, lRtData)
TypeKey = lRtType
'0 = Success de lecture de la valeur
If lResult = 0 Then
DIRECT_QueryValueEx = True
Else
DIRECT_QueryValueEx = False
End If
DIRECT_QueryValueEx = GetStringRegisterError("ERROR", "DIRECT_QueryValueEx", 0, lRt)
Call CloseRegister
End Function
Public Function GetValue(ByVal sKeyValue As String) As Variant
Dim lResult As Long, sDataBuf() As Byte, lDataBufSize As Long
Dim lRtType As enREG_TYPES
Dim rtString As String
Dim rtLong As Long
lResult = RegQueryValueEx(MyRegister.hSKey, sKeyValue, 0, lRtType, ByVal 0, lDataBufSize)
TypeKey = lRtType
If lResult = 0 Then
ReDim sDataBuf(0 To lDataBufSize) As Byte
lResult = RegQueryValueEx(MyRegister.hSKey, sKeyValue, 0, 0, sDataBuf(0), lDataBufSize)
Select Case lRtType
Case REG_SZ, REG_EXPAND_SZ
rtString = Space$(lDataBufSize - 1)
CopyMemory ByVal rtString, sDataBuf(0), lDataBufSize - 1
GetValue = Trim(rtString)
Case REG_MULTI_SZ
rtString = Space$(lDataBufSize - 1)
CopyMemory ByVal rtString, sDataBuf(0), lDataBufSize - 1
GetValue = Replace(rtString, Chr(0), vbNewLine)
Case REG_DWORD
CopyMemory rtLong, sDataBuf(0), 4
GetValue = rtLong
Case REG_BINARY
If lDataBufSize <> UBound(sDataBuf) + 1 Then
ReDim Preserve sDataBuf(0 To lDataBufSize - 1) As Byte
End If
GetValue = sDataBuf()
End Select
End If
Call GetStringRegisterError("ERROR", "GETVALUE", 0, lResult)
End Function
Private Function GetStringToBytesNumber(sAny As String) As Long
Static i As Long
Dim j As Long
j = 0
For i = 1 To Len(sAny) Step 2
j = j + 1
Next i
GetStringToBytesNumber = j
End Function
Public Sub SetValue(ByVal lRtType As enREG_TYPES, sKeyValue As String, strData As Variant)
Dim lResult As Long
Dim lenTmp As Long
Dim sDataBuf() As Byte
Dim rtString As String
Dim rtLong As Long
Select Case lRtType
Case REG_SZ, REG_EXPAND_SZ, REG_MULTI_SZ, REG_EXPAND_SZ
rtString = CStr(strData)
lResult = RegSetValueEx(MyRegister.hSKey, sKeyValue, 0, lRtType, ByVal rtString, Len(rtString))
Case REG_BINARY
If IsNumeric(strData) = True Then
rtLong = CLng(strData)
Else
rtLong = CLng("&h" & strData)
End If
lenTmp = GetStringToBytesNumber(CStr(rtLong))
ReDim sDataBuf(lenTmp - 1) As Byte
CopyMemory sDataBuf(0), rtLong, lenTmp
lResult = RegSetValueEx(MyRegister.hSKey, sKeyValue, 0, lRtType, sDataBuf(0), lenTmp - 1)
Case REG_BINARY_HEX
lenTmp = GetStringToBytesNumber(CStr(strData))
ReDim sDataBuf(lenTmp - 1) As Byte
rtLong = "&h" & strData
CopyMemory sDataBuf(0), rtLong, lenTmp
lResult = RegSetValueEx(MyRegister.hSKey, sKeyValue, 0, REG_BINARY, sDataBuf(0), lenTmp)
Case REG_BINARY_LONG
rtLong = strData
lenTmp = GetStringToBytesNumber(CStr(Hex(strData)))
lResult = RegSetValueEx(MyRegister.hSKey, sKeyValue, 0, REG_BINARY, rtLong, lenTmp)
Case REG_DWORD
rtLong = CLng(strData)
lResult = RegSetValueEx(MyRegister.hSKey, sKeyValue, 0, lRtType, rtLong, 4)
End Select
Erase sDataBuf
Call GetStringRegisterError("ERROR", "SETVALUE", 0, lResult)
End Sub
Public Sub CreateKey(ByVal myNewSKey As String, Optional CreateAndRoot As Boolean = False)
Dim lResult As Long, rtKey As Long
If CheckRoot(myNewSKey) = True Then Exit Sub
lResult = RegCreateKey(MyRegister.hKey, myNewSKey, rtKey)
If GetStringRegisterError("ERROR", "CREATEKEY", 0, lResult) = "" Then
If CreateAndRoot = True Then
MyRegister.hSKey = rtKey
MyRegister.SubKey = myNewSKey
SetRoot myNewSKey
End If
End If
End Sub
Public Sub CreateSubKey(ByVal myNewSKey As String, Optional CreateAndRoot As Boolean = False)
Dim lResult As Long, rtKey As Long
If CheckRoot(myNewSKey) = True Then Exit Sub
lResult = RegCreateKey(MyRegister.hSKey, myNewSKey, rtKey)
If GetStringRegisterError("ERROR", "CreateSubKey", 0, lResult) = "" Then
If CreateAndRoot = True Then
MyRegister.hSKey = rtKey
MyRegister.SubKey = MyRegister.SubKey & "\" & myNewSKey
SetSubRoot MyRegister.SubKey
End If
End If
End Sub
Public Function CheckRoot(ByVal mySKey As String) As Boolean
Dim hRead As Long, hResult As Long
hResult = RegOpenKeyEx(MyRegister.hKey, mySKey, 0, KEY_READ, hRead)
If hResult = 0 Then RegCloseKey hRead
Call GetStringRegisterError("ERROR", "CheckRoot", 0, lResult)
End Function
Public Sub OpenRegister(myKey As enREG_KEYS)
If MyRegister.hKey > 0 Then CloseRegister
Call ClearRegister
MyRegister.hKey = myKey
End Sub
Public Sub SetRoot(mySKey As String)
Dim lResult As Long
MyRegister.SubKey = mySKey
If MyRegister.hSKey > 0 Then RegCloseKey MyRegister.hSKey
lResult = RegOpenKey(MyRegister.hKey, MyRegister.SubKey, MyRegister.hSKey)
Call GetStringRegisterError("ERROR", "SetRoot", 0, lResult)
End Sub
Public Sub SetSubRoot(mySKey As String)
Dim lResult As Long
If Not MyRegister.SubKey = mySKey Then
MyRegister.SubKey = MyRegister.SubKey & "\" & mySKey
End If
If MyRegister.hSKey > 0 Then RegCloseKey MyRegister.hSKey
lResult = RegOpenKey(MyRegister.hKey, MyRegister.SubKey, MyRegister.hSKey)
Call GetStringRegisterError("ERROR", "SetRoot", 0, lResult)
End Sub
Public Sub CloseRegister()
RegCloseKey MyRegister.hSKey
Call ClearRegister
End Sub
Private Sub ClearRegister()
With MyRegister
.hKey = 0
.hSKey = 0
.SubKey = ""
.TypeKey = 0
.HaveError = False
.HaveErrorDescription = ""
End With
End Sub
Private Function GetStringRegisterError(sLabel As String, sFunction As String, lTrueResult As Long, ByVal lResult As Long) As String
'Error ; Function Error ;
'Retour Query ; Key Handle ; SubKey Handle ; Root String
Dim rtERR As String
If lTrueResult = lResult Then
MyRegister.HaveError = False
rtERR = ""
Else
MyRegister.HaveError = True
rtERR = UCase(sLabel) & "[;]" & _
UCase(sFunction) & "[;]" & _
CStr(lResult) & "[;]" & _
MyRegister.hKey & "[;]" & _
MyRegister.hSKey & "[;]" & _
MyRegister.SubKey & "[;]"
End If
MyRegister.HaveErrorDescription = rtERR
GetStringRegisterError = rtERR
End Function
Conclusion
Petit exemple avec une liste avec toutes les clés dans l'ordre (voir enREG_KEYS), Un textbox ou est inscrit le chemin, et un textbox avec le nom de la clé a lire.
modRegistre.OpenRegister CLng(&H80000000 + Me.lstKeyRoot.ListIndex) Call modRegistre.SetRoot(Me.txtRegSubRoot) rt = modRegistre.GetValue(Me.txtRegSubValue) If rt <> "" Then MsgBox "Lecture avec succès !" & vbNewLine & vbNewLine & _ "hKey= " & MyRegister.hKey & vbNewLine & _ "hSKey= " & MyRegister.hSKey & vbNewLine & _ "SubKey= " & MyRegister.SubKey & vbNewLine & _ "TypeKey= " & MyRegister.TypeKey & vbNewLine & _ "HaveError= " & MyRegister.HaveError & vbNewLine & _ "ErrorDescription= " & MyRegister.HaveErrorDescription & vbNewLine & vbNewLine & _ "Value= " & rt, vbInformation Else MsgBox "Erreur de Lecture !" & vbNewLine & vbNewLine & _ "hKey= " & MyRegister.hKey & vbNewLine & _ "hSKey= " & MyRegister.hSKey & vbNewLine & _ "SubKey= " & MyRegister.SubKey & vbNewLine & _ "TypeKey= " & MyRegister.TypeKey & vbNewLine & _ "HaveError= " & MyRegister.HaveError & vbNewLine & _ "ErrorDescription= " & MyRegister.HaveErrorDescription, vbExclamation End If modRegistre.CloseRegister
Historique
- 20 décembre 2008 01:16:26 :
- Correction description
Sources du même auteur
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
Editeur de Registre sans REGEDIT??? [ par TheGuern ]
Bonjour tt le monde, j'aimerai savoir si quelqu'un sait s'il il est possible d'accéeder aux registre sans passer par Regedit. Ou s'il est possible de
systray + regedit + icone [ par kinatas ]
Bonjour, Je n'arrive pas a trouver un source ou mieux un exe qui me permette de: - de lire une key registre - de modifier l'icône systray en fonction
Registre statut du port parallele [ par elkinaniz17 ]
Bonjour Je vous demande de m'informer sur les pin du registre statut du port parallèle je vais essayer de lire 4 bit par 4 registre statut dans des
changer le proxy d'une fenêtre IE contrôlée par VBS [ par salut67 ]
Bonjour, sous windows xp, j'ai un script VBS qui ouvre une fenêtre IE et accède à plusieurs pages d'un site : set ie = CreateObject("InternetExplorer.
Verifier l'existance d'une clé dans la base de registre [ par Light666 ]
Comme le titre l'indique, je cherche une API qui me permettra de vérifier l’existence d'une clé dans la base du registre, j'ai chercher sur le n
lecture d'une clé dans la base de registre HKLM [ par bidouille007 ]
Bonjour Malgré des tentatives hélas vaines je me tourne vers vous pour savoir si il y a une procédure particulière pour lire la valeur d'une clé dans
Créer une valeur chaine dans la base de registre [ par Jeromedu79 ]
Bonjour, Je suis entrain de créer une application qui a besoin d’accéder à la base de registre de Windows, mais je rencontre un problème ... J
Modifier valeur d'une clé registre [ par FaonManager ]
Bonjour, j'ai un problème pour modifier la valeur d'une clé registre, j'utilise le code suivant mais il ne marche pas : [code=vb]Dim key As Microsoft
Recherche dans la base de registre de Windows [ par shamantao ]
Y-a-t il un moyen de faire une recherche sur une clef ou une valeur dans la base de registre ?Merci
Données Binaires de la Base de registre. [ par Steph21 ]
Avant tout, je me présente ! Je débute actuellement le VB (version 5), et j'ai déjà utilisé le VBA 97 et 2K.Passons aux choses sérieuses :)J'aimerai e
|
Derniers Blogs
[SHAREPOINT] LES SESSIONS TECHDAYS 2012.[SHAREPOINT] LES SESSIONS TECHDAYS 2012. par Patrick Guimonet
Voici donc pour ceux qui n'ont pas pu venir, ou ceux qui n'ont pas pu toutes les suivre la liste des sessions SharePoint aux TechDays 2012, que je mettrais à jour dès que les liens des vidéo seront disponibles. Ou ici : http...
Cliquez pour lire la suite de l'article par Patrick Guimonet TECHDAYS PARIS 2012 : SESSION PLEINIèRE JOUR 3TECHDAYS PARIS 2012 : SESSION PLEINIèRE JOUR 3 par ROMELARD Fabrice
Speaker: Bernard Ourghanlian Cette session est comme chaque jour transmise en live par BrainSonic, et j'ai donc suivi cette troisième pleinière par ce moyen sur mon iPad . Elle est dédiée comme chaque année à la mise en perspective de l'é...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice MISHRA READER : UN LECTEUR RSS TRèS ZUNE STYLE EN OPEN SOURCE !MISHRA READER : UN LECTEUR RSS TRèS ZUNE STYLE EN OPEN SOURCE ! par Vko
Hier durant une session dédiée aux Techdays 2012, j'ai eu le plaisir d'annoncer la sortie de la Béta 2 de Mishra Reader. C'est quoi ? Pour les utilisateurs, c'est une vraie expérience de lecture de flux RSS sur Windows. Rien à voir avec les produit...
Cliquez pour lire la suite de l'article par Vko [FRAMEWORK 4] LES TASKS ET LE THREAD UI[FRAMEWORK 4] LES TASKS ET LE THREAD UI par fathi
Je viens de passer quelques temps au TechDay's et j'ai pu voir pas mal de session intéressante. Par contre une chose m'a un peu étonné lors de certaines de ces sessions qui abordaient les améliorations du framework .NET (donc le 4.5) : en gros, bea...
Cliquez pour lire la suite de l'article par fathi WORKFLOW FOUNDATION 3 A UN PIED DANS LA TOMBEWORKFLOW FOUNDATION 3 A UN PIED DANS LA TOMBE par JeremyJeanson
Depuis déjà un an, je conseille vivement les utilisateurs de Workflow Foundation 3 à migrer vers la version 4. L'information qui va suivre ne devrait donc pas trop prendre au dépourvu les personnes qui m'ont suivi. Je profite de ce poste, pour faire le re...
Cliquez pour lire la suite de l'article par JeremyJeanson
Logiciels
Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Easy-Planning (1.0.0.1)EASY-PLANNING (1.0.0.1)Basé sur les mêmes principes que MyPlanning, Easy-Planning permet de créer des plannings sous la ... Cliquez pour télécharger Easy-Planning COLLECTOR PLUS (3.00B)COLLECTOR PLUS (3.00B)COLLECTOR PLUS version 3.00B est un logiciel utilisant une base de données alimentée par :
- L... Cliquez pour télécharger COLLECTOR PLUS PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO LettresFaciles 2011 (8.0.0.1)LETTRESFACILES 2011 (8.0.0.1)LettresFaciles est un logiciel facilitant la création et la rédaction de lettres types.
Son inte... Cliquez pour télécharger LettresFaciles 2011
|