CBaseWindow.OnReceiveMessage 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 OnReceiveMessage method handles window messages.

Syntax

virtual LRESULT OnReceiveMessage(
   HWND   hwnd,
   INT    uMsg,
   WPARAM wParam,
   LPARAM lParam
);

Parameters

hwnd

Handle to the window.

uMsg

Message identifier.

wParam

First message parameter.

lParam

Second message parameter.

Return value

Returns 0 if the message was processed, or 1 if the message was not processed.

Remarks

The base class handles the following messages:

  • WM_CLOSE
  • WM_MOVE
  • WM_PALETTECHANGED
  • WM_QUERYNEWPALETTE
  • WM_SIZE
  • WM_SYSCOLORCHANGE

A derived class can override this method to handle other messages. The derived class should call the base class method to handle any messages that the derived class ignores.

Requirements

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

See also

CBaseWindow Class