---
name: "CoRegisterMessageFilter"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/CoRegisterMessageFilter"
---

# CoRegisterMessageFilter(3w)

## NAME

**CoRegisterMessageFilter** (OLE32.@)

## SYNOPSIS

HRESULT CoRegisterMessageFilter\
  (\
   LPMESSAGEFILTER  *lpMessageFilter*,\
   LPMESSAGEFILTER\* *lplpMessageFilter*\
  )

## DESCRIPTION

Registers a message filter.

## PARAMS

*lpMessageFilter* **\[In\]**  Pointer to interface.

*lplpMessageFilter* **\[Out\]**  Indirect pointer to prior instance if non-NULL.

## RETURNS

**Success:** **S\_OK**.

**Failure:** **HRESULT** code.

## NOTES

Both *lpMessageFilter* and *lplpMessageFilter* are optional. Passing in a **NULL** *lpMessageFilter* removes the message filter.

If *lplpMessageFilter* is not **NULL** the previous message filter will be returned in the memory pointer to this parameter and the caller is responsible for releasing the object.

The current thread be in an apartment otherwise the function will crash.

## IMPLEMENTATION

Declared in **"objbase.h"**.

Implemented in **"dlls/ole32/compobj.c"**.

Debug channel **"ole"**.
