ISimpleFrameSite::PreMessageFilter method (ocidl.h)

Provides a site with the opportunity to process a message that is received by a control's own window before the control itself does any processing.


HRESULT PreMessageFilter(
  [in]  HWND    hWnd,
  [in]  UINT    msg,
  [in]  WPARAM  wp,
  [in]  LPARAM  lp,
  [out] LRESULT *plResult,
  [out] DWORD   *pdwCookie


[in] hWnd

A handle of the control window receiving the message.

[in] msg

The message received by the simple frame site.

[in] wp

The WPARAM of the message.

[in] lp

The LPARAM of the message.

[out] plResult

A pointer to the variable that receives the result of the message processing.

[out] pdwCookie

A pointer to the variable that will be passed to ISimpleFrameSite::PostMessageFilter if it is called later. This parameter should only contain allocated data if this method returns S_OK so it will also receive a call to PostMessageFilter which can free the allocation. The caller is not in any way responsible for anything returned in this parameter.

Return value

This method can return the following values.

Return code Description
The simple frame site will not use the message in this filter so more processing can take place.
The site has processed the message and no further processing should occur.
The site does not do any message filtering, indicating that PostMessageFilter need not be called later.
The address in plResult or pdwCookie is not valid.


Successful return values indicate whether the site wishes to allow further processing. S_OK indicates further processing, whereas S_FALSE means do not process further. S_OK also indicates that the control must later call PostMessageFilter.


Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ocidl.h

See also