CoRegisterMessageFilter

Registers with OLE the instance of an EXE application's IMessageFilter interface, which is to be used for handling concurrency issues. DLL object applications cannot register a message filter.

HRESULT CoRegisterMessageFilter(
  LPMESSAGEFILTER lpMessageFilter,  //Pointer to interface
  LPMESSAGEFILTER * lplpMessageFilter  //Address of output variable 
                                       // that receives the 
                                       // IMessageFilter interface 
                                       // pointer of a previously 
                                       // registered message filter
);
 

Parameters

lpMessageFilter
[in] Pointer to theIMessageFilter interface on the message filter supplied by the application. Can be NULL, indicating that the current IMessageFilter registration should be revoked.
lplpMessageFilter
[out] Address of IMessageFilter* pointer variable that receives the interface pointer to the previously registered message filter. If there was no previously registered message filter, the value of *lplpMessageFilter is NULL. The value contained in the output variable is rarely NULL, however, containing instead a pointer to the default message filter.

Return Values

S_OK
The IMessageFilter instance registered or revoked successfully.
S_FALSE
Error registering or revoking IMessageFilter instance.

QuickInfo

  Windows NT: Use version 3.1 or later.
  Windows: Use Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in objbase.h.
  Import Library: Included as a resource in ole32.dll.