#include <WinAPI.au3>
#include <LocalSecurityAuthority.au3>
$hKey = _RegOpenKeyEx($HKEY_LOCAL_MACHINE, "Software\Test", $KEY_NOTIFY)
$hEvent = _RegNotifyChangeKeyValue($hKey, False, 15)
_WinAPI_WaitForSingleObject($hEvent, -1)
Msgbox(0, "", "Machine\Software\Test has changed.")
_RegCloseKey($hKey)
Func _RegNotifyChangeKeyValue($hKey, $fWatchSub = False, $iFilter = 15)
Local $hEvent, $iResult
$hEvent = _WinAPI_CreateEvent()
$iResult = DllCall("Advapi32.dll", "long", "RegNotifyChangeKeyValue", _
"hWnd", $hKey, "int", $fWatchSub, "dword", $iFilter, _
"hWnd", $hEvent, "int", 1)
Return SetError($iResult[0], 0, $hEvent)
EndFunc ;==>_RegNotifyChangeKeyValue
LocalSecurityAuthority.au3 - http://www.autoitx.com/forum.php ... &extra=page%3D1 |