RegisterGPNotification function
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.
Syntax
BOOL RegisterGPNotification( _In_ HANDLE hEvent, _In_ BOOL bMachine );
Parameters
- hEvent [in]
-
Handle to an event object. 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 value
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
Call the UnregisterGPNotification function to unregister the handle from receiving policy change notifications. Call the CloseHandle function to close the handle when it is no longer required.
An application can also receive notifications about policy changes when a WM_SETTINGCHANGE message is broadcast. In this instance, the wParam parameter value is 1 if computer policy was applied; it is zero if user policy was applied. The lParam parameter points to the string "Policy".
Requirements
|
Minimum supported client |
Windows Vista |
|---|---|
|
Minimum supported server |
Windows Server 2008 |
|
Header |
|
|
Library |
|
|
DLL |
|
See also