5.3 WFPDeregister

HRESULT WFPDeregister( hService, dwEventClass, hWndReg, hWnd, ReqID )

Discontinues monitoring of the specified message class(es) from the specified service provider, by the specified hWndReg (or all hWnd's).

Parameters HSERVICE hService

Handle to the service provider

DWORD dwEventClass

The class(es) of messages from which the application is deregistering. Specified as a set of bit masks that can be logically ORed together. A NULL value requests that all message classes be deregistered from the specified window for this service provider.

HWND hWndReg

The window to which notification messages are posted. A NULL value requests that all the application's windows be deregistered from the specified message class(es) for this hService.

HWND hWnd

The window handle which is to receive the completion message for this request.

REQUESTID ReqID

Request identification number.

Mode Asynchronous

Comments WFPDeregister does not stop asynchronous command completion messages from being posted; a robust application should be designed to accept these messages even after a deregister is issued.

A WFPDeregister os performed automatically if a WFPClose is issued without a previous WFPDeregister.

To deregister all messages for all hWnds, the call supplies NULL values for both the dwEventClass and hWnd parameters.

See the WFPRegister function for a description of the types of events that may be monitored.

Messages WFS_DEREGISTER_COMPLETE

Error Codes If the function return is not WFS_SUCCESS, it is one of the following error conditions, indicating that the asynchronous operation was not initiated. Any service-specific errors that can be returned are defined in the specifications for each service class.

WFS_ERR_CONNECTION_LOST
The connection to the service is lost.
WFS_ERR_INTERNAL_ERROR
An internal inconsistency or other unexpected error occurred in the WOSA/XFS subsystem.
WFS_ERR_INVALID_EVENT_CLASS
The dwEventClass parameter specifies one or more event classes not supported by the service.
WFS_ERR_INVALID_HSERVICE
The hService parameter is not a valid service handle.
WFS_ERR_INVALID_HWND
The hWnd parameter is not a valid window handle.
WFS_ERR_INVALID_HWNDREG
The hWndReg parameter is not a valid window handle.
WFS_ERR_NOT_REGISTERED
The specified hWndReg window was not registered to receive messages for any event classes.

The following error condition is returned via the asynchronous command completion message, as the hResult from the WFSRESULT structure. Any service-specific errors that can be returned are defined in the specifications for each service class.

WFS_ERR_CANCELED
The request was canceled by WFSCancelAsyncRequest.