AdvApi32RegNotifyChangeKeyValue(SafeRegistryHandle, Boolean, RegNotifyChangeFilter, IntPtr, Boolean) Method

Notifies the caller about changes to the attributes or contents of a specified registry key.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("AdvApi32.dll", SetLastError = true)]
public static Win32ErrorCode RegNotifyChangeKeyValue(
	SafeRegistryHandle hKey,
	bool watchSubtree,
	RegNotifyChangeFilter notifyFilter,
	IntPtr hEvent,
	bool asynchronous
)

Parameters

hKey  SafeRegistryHandle
A handle to an open registry key.

This handle is returned by the RegCreateKeyEx or RegOpenKeyEx(SafeRegistryHandle, String, UInt32, Int32, IntPtr) function.

watchSubtree  Boolean
If this parameter is , the function reports changes in the specified key and its subkeys.

If the parameter is , the function reports changes only in the specified key.

notifyFilter  RegNotifyChangeFilter
A value that indicates the changes that should be reported.
hEvent  IntPtr
A handle to an event.

If the asynchronous parameter is , the function returns immediately and changes are reported by signaling this event.

If asynchronous is , hEvent is ignored.

asynchronous  Boolean
If this parameter is , the function returns immediately and reports changes by signaling the specified event.

If this parameter is , the function does not return until a change has occurred.

If hEvent does not specify a valid event, the asynchronous parameter cannot be .

Return Value

Win32ErrorCode
If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is other Win32ErrorCode error code.

To get extended error information, call GetLastWin32Error.

Remarks

See Also