CBasePropertyPage.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 is called when the dialog box receives a message.

Syntax

virtual INT_PTR OnReceiveMessage(
   HWND   hwnd,
   UINT   uMsg,
   WPARAM wParam,
   LPARAM lParam
);

Parameters

hwnd

Handle to the window.

uMsg

Message.

wParam

First message parameter.

lParam

Second message parameter.

Return value

Returns a Boolean value. The dialog procedure returns this value; for more information, see the Platform SDK documentation.

Remarks

The base-class implementation calls DefWindowProc. Override this method to handle messages that relate to the dialog controls. If the overriding method does not handle a particular message, it should call the base-class method.

If the user changes any properties via the dialog controls, set the CBasePropertyPage::m_bDirty flag to TRUE. Then call the IPropertyPageSite::OnStatusChange method on the CBasePropertyPage::m_pPageSite pointer to inform the frame.

Examples

The following example responds to a button click by updating a member variable, which is assumed to be defined in the derived class. This example also shows a helper function for setting the property page's dirty status.

INT_PTR CMyProp::OnReceiveMessage(HWND hwnd,
  UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg)
    {
    case WM_COMMAND:
        if (LOWORD(wParam) == IDC_BUTTON1)
        {
            m_lNewVal = GetDlgItemInt(m_Dlg, IDC_EDIT1, 0, TRUE);
            SetDirty();
            return (INT_PTR)TRUE;
        }
        break;
    } // switch

    // Did not handle the message.
    return CBasePropertyPage::OnReceiveMessage(hwnd, uMsg, wParam, lParam);
}

// Helper function to update the dirty status.
void CMyProp::SetDirty()
{
    m_bDirty = TRUE;
    if (m_pPageSite)
    {
        m_pPageSite->OnStatusChange(PROPPAGESTATUS_DIRTY);
    }
}

Requirements

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

See also

CBasePropertyPage Class