Skip to content

Latest commit

 

History

History
93 lines (62 loc) · 3.34 KB

cmessagemap-class.md

File metadata and controls

93 lines (62 loc) · 3.34 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: CMessageMap Class
CMessageMap Class
11/04/2016
CMessageMap
ATLWIN/ATL::CMessageMap
ATLWIN/ATL::CMessageMap::ProcessWindowMessage
CMessageMap class
message maps, ATL
ATL, message handlers
1f97bc16-a8a0-4cf0-b90f-1778813a5c8e

CMessageMap Class

This class allows an object's message maps to be access by another object.

Important

This class and its members cannot be used in applications that execute in the Windows Runtime.

Syntax

class ATL_NO_VTABLE CMessageMap

Members

Public Methods

Name Description
CMessageMap::ProcessWindowMessage Accesses a message map in the CMessageMap-derived class.

Remarks

CMessageMap is an abstract base class that allows an object's message maps to be accessed by another object. In order for an object to expose its message maps, its class must derive from CMessageMap.

ATL uses CMessageMap to support contained windows and dynamic message map chaining. For example, any class containing a CContainedWindow object must derive from CMessageMap. The following code is taken from the SUBEDIT sample. Through CComControl, the CAtlEdit class automatically derives from CMessageMap.

[!code-cppNVC_ATL_Windowing#90]

Because the contained window, m_EditCtrl, will use a message map in the containing class, CAtlEdit derives from CMessageMap.

For more information about message maps, see Message Maps in the article "ATL Window Classes."

Requirements

Header: atlwin.h

CMessageMap::ProcessWindowMessage

Accesses the message map identified by dwMsgMapID in a CMessageMap-derived class.

virtual BOOL ProcessWindowMessage(
    HWND hWnd,
    UINT uMsg,
    WPARAM wParam,
    LPARAM lParam,
    LRESULT& lResult,
    DWORD dwMsgMapID) = 0;

Parameters

hWnd
[in] The handle to the window receiving the message.

uMsg
[in] The message sent to the window.

wParam
[in] Additional message-specific information.

lParam
[in] Additional message-specific information.

lResult
[out] The result of the message processing.

dwMsgMapID
[in] The identifier of the message map that will process the message. The default message map, declared with BEGIN_MSG_MAP, is identified by 0. An alternate message map, declared with ALT_MSG_MAP(msgMapID), is identified by msgMapID.

Return Value

TRUE if the message is fully handled; otherwise, FALSE.

Remarks

Called by the window procedure of a CContainedWindow object or of an object that is dynamically chaining to the message map.

See also

CDynamicChain Class
BEGIN_MSG_MAP
ALT_MSG_MAP(msgMapID)
Class Overview