|
|
|
|
|
Dicas
|
|
Visual Basic (ActiveX/Controles/DLL)
|
|
|
Título da Dica: Detectando alterações no registro do windows
|
|
|
|
Postada em 9/12/2004 por Josefh Hennyere
hennyere@hotmail.com
'Para testar esta função, execute o projeto, abra o regedit e tente fazer alguma alteração na chave HKEY_CURRENT_USER
Const HKEY_CLASSES_ROOT = &H80000000 Const HKEY_CURRENT_USER = &H80000001 Const HKEY_LOCAL_MACHINE = &H80000002 Const HKEY_USERS = &H80000003 Const HKEY_PERFORMANCE_DATA = &H80000004 Const HKEY_CURRENT_CONFIG = &H80000005 Const HKEY_DYN_DATA = &H80000006
Const REG_NOTIFY_CHANGE_NAME = &H1 Const REG_NOTIFY_CHANGE_ATTRIBUTES = &H2 Const REG_NOTIFY_CHANGE_Max_SET = &H4 Const REG_NOTIFY_CHANGE_SECURITY = &H8 Const REG_NOTIFY_ALL = (REG_NOTIFY_CHANGE_NAME Or REG_NOTIFY_CHANGE_ATTRIBUTES Or REG_NOTIFY_CHANGE_Max_SET Or REG_NOTIFY_CHANGE_SECURITY) Private Declare Function RegNotifyChangeKeyValue Lib "advapi32" (ByVal hKey As Long, ByVal bWatchSubtree As Boolean, ByVal dwNotifyFilter As Long, ByVal hEvent As Long, ByVal fAsynchronous As Boolean) As Long Private Sub Form_Load() RegNotifyChangeKeyValue HKEY_CURRENT_USER, True, REG_NOTIFY_ALL, ByVal 0&, False MsgBox "Registro modificado" Unload Me End Sub
'Josefh Hennyere
|
|
|
|
|