1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
Option Explicit
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 Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hkey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hkey As Long) As Long
Private Const HKEY_LOCAL_MACHINE = &H80000002
Private Const REG_DWORD = 4
Dim nBufferKey As Long
Dim nVal As Long
Private Sub CommandButton1_Click()
nVal = 2'Valeur modifée dans la clef
RegOpenKey HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", nBufferKey
RegSetValueEx nBufferKey, "hidden", 0, REG_DWORD, nVal, Len(nVal)
RegCloseKey nBufferKey
End Sub |
Partager