COM
Expand Minimize

CoRegisterMessageFilter function

Registers with OLE the instance of an IMessageFilter interface, which is to be used for handling concurrency issues on the current thread. Only one message filter can be registered for each thread. Threads in multithreaded apartments cannot have message filters.

Syntax


HRESULT CoRegisterMessageFilter(
  _In_opt_   LPMESSAGEFILTER lpMessageFilter,
  _Out_opt_  LPMESSAGEFILTER *lplpMessageFilter
);

Parameters

lpMessageFilter [in, optional]

A pointer to the IMessageFilter interface on the message filter. This message filter should be registered on the current thread, replacing the previous message filter (if any). This parameter can be NULL, indicating that no message filter should be registered on the current thread.

Note that this function calls AddRef on the interface pointer to the message filter.

lplpMessageFilter [out, optional]

Address of the IMessageFilter* pointer variable that receives the interface pointer to the previously registered message filter. If there was no previously registered message filter for the current thread, the value of *lplpMessageFilter is NULL.

Return value

If the instance was registered or revoked successfully, the return value is S_OK; otherwise, it is S_FALSE.

Remarks

To revoke the registered message filter, pass the previous message filter (possibly NULL) as the lpMessageFilter parameter to CoRegisterMessageFilter.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Objbase.h

Library

Ole32.lib

DLL

Ole32.dll

See also

IMessageFilter

 

 

Community Additions

ADD
Show:
© 2014 Microsoft