HRESULT WFSRegister( hService, dwEventClass, hWndReg )
Enables event monitoring for the specified service by the specified window; all messages of the specified class(es) are sent to the window specified in the hWndReg parameter. The synchronous version of WFSAsyncRegister.
Parameters HSERVICE hService
Handle to the service provider as returned by WFSOpen or WFSAsyncOpen. If this value is NULL, and dwEventClass is SYSTEM_EVENTS, the XFS manager registers the application for those system events generated by the Manager itself.
DWORD dwEventClass
The class(es) of events for which the application is registering. Specified as a set of bit masks that are logically ORed together into this parameter.
HWND hWndReg
The window handle which is to be registered to receive the specified messages.
Mode Synchronous
Comments Issuing a WFSRegister for a service enables event monitoring on that service. WFSRegister calls can be cumulative for the same window. For example, to receive notification for both system and user events, the application can call WFSRegister with both SYSTEM_EVENTS and USER_EVENTS, as follows:
hr = WFSRegister(hPassbook1, SYSTEM_EVENTS | USER_EVENTS, hWndReg1);
or call them in two phases:
hr = WFSRegister( hPassbook1, SYSTEM_EVENTS, hWndReg1); . . . . . . . . . . . . . . . .
hr = WFSRegister( hPassbook1, USER_EVENTS, hWndReg1);
To cancel notifications use WFSDeregister.
Note that the service provider always monitors the service, regardless of whether an application has registered for event monitoring. Issuing WFSRegister simply causes the service provider to post messages to the application in addition to handling the messages itself. See the discussion in Section 3.11.
Error Codes If the function return is not WFS_SUCCESS, it is one of the following error conditions.
See also WFSAsyncRegister, WFSDeregister, WFSAsyncDeregister