CBaseControlWindow.PossiblyEatMessage method

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The PossiblyEatMessage method forwards keyboard and mouse messages to the message-drain window.

Syntax

BOOL PossiblyEatMessage(
   UINT   uMsg,
   WPARAM wParam,
   LPARAM lParam
);

Parameters

uMsg

Window message.

wParam

First message parameter.

lParam

Second message parameter.

Return value

Returns TRUE if the message was forwarded to the window, or FALSE otherwise.

Remarks

The message-drain window is a window designated to receive certain mouse and keyboard messages. Initially the window is NULL; it can be set by calling CBaseControlWindow::put_MessageDrain.

If the message-drain window is non-NULL, PossiblyEatMessage posts the following messages to that window:

  • WM_CHAR
  • WM_DEADCHAR
  • WM_KEYDOWN
  • WM_KEYUP
  • WM_LBUTTONDBLCLK
  • WM_LBUTTONDOWN
  • WM_LBUTTONUP
  • WM_MBUTTONDBLCLK
  • WM_MBUTTONDOWN
  • WM_MBUTTONUP
  • WM_MOUSEACTIVATE
  • WM_MOUSEMOVE
  • WM_NCLBUTTONDBLCLK
  • WM_NCLBUTTONDOWN
  • WM_NCLBUTTONUP
  • WM_NCMBUTTONDBLCLK
  • WM_NCMBUTTONDOWN
  • WM_NCMBUTTONUP
  • WM_NCMOUSEMOVE
  • WM_NCRBUTTONDBLCLK
  • WM_NCRBUTTONDOWN
  • WM_NCRBUTTONUP
  • WM_RBUTTONDBLCLK
  • WM_RBUTTONDOWN
  • WM_RBUTTONUP
  • WM_SYSCHAR
  • WM_SYSDEADCHAR
  • WM_SYSKEYDOWN
  • WM_SYSKEYUP

It ignores other messages. If the message-drain window is NULL, the method ignores all window messages. The method returns TRUE if it posts the message, or FALSE otherwise. The CBaseWindow class calls this method when it receives a window message.

Requirements

Requirement Value
Header
Ctlutil.h (include Streams.h)
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CBaseControlWindow Class