Platform SDK: Group Policy

RegisterGPNotification

The RegisterGPNotification function enables an application to receive notification when there is a change in policy. When a policy change occurs, the specified event object is set to the signaled state.

BOOL RegisterGPNotification(
  HANDLE hEvent,
  BOOL bMachine
);

Parameters

hEvent
[in] Handle to a manual-reset event object used as a policy-notification handle. Use the CreateEvent function to create the event object.
bMachine
[in] Specifies the policy change type. If TRUE, computer policy changes are reported. If FALSE, user policy changes are reported.

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

Policy-notification handles returned by RegisterGPNotification must be closed by calling the UnregisterGPNotification function when they are no longer needed.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Userenv.h.
  Library: Use Userenv.lib.

See Also

Group Policy Overview, Group Policy Functions, UnregisterGPNotification