CMessageMap 클래스

이 클래스를 사용하면 다른 개체에서 개체의 메시지 맵에 액세스할 수 있습니다.

Important

이 클래스와 해당 멤버는 Windows 런타임에서 실행되는 애플리케이션에서 사용할 수 없습니다.

구문

class ATL_NO_VTABLE CMessageMap

멤버

공용 메서드

이름 설명
CMessageMap::P rocessWindowMessage 파생 클래스의 메시지 맵에 CMessageMap액세스합니다.

설명

CMessageMap 는 다른 개체에서 개체의 메시지 맵에 액세스할 수 있도록 하는 추상 기본 클래스입니다. 개체가 메시지 맵을 노출하려면 해당 클래스가 .에서 CMessageMap파생되어야 합니다.

ATL은 포함된 창 및 동적 메시지 맵 체인을 지원하는 데 사용합니다 CMessageMap . 예를 들어 CContainedWindow 개체를 포함하는 클래스는 .에서 CMessageMap파생되어야 합니다. 다음 코드는 SUBEDIT 샘플에서 가져옵니다. CComControl을 통해 클래스는 CAtlEdit 자동으로 .에서 CMessageMap파생됩니다.

class ATL_NO_VTABLE CAtlEdit :
   OtherInheritedClasses
   public CComControl<CAtlEdit>
   // CComControl derives from CWindowImpl, which derives from CMessageMap
{
public:
   // Declare a contained window data member
   CContainedWindow m_ctlEdit;

   // Initialize the contained window:
   // 1. Pass "Edit" to specify that the contained 
   //    window should be based on the standard 
   //    Windows Edit box
   // 2. Pass 'this' pointer to specify that CAtlEdit 
   //    contains the message map to be used for the 
   //    contained window's message processing
   // 3. Pass the identifier of the message map. '1'
   //    identifies the alternate message map declared
   //    with ALT_MSG_MAP(1)
   CAtlEdit()
      : m_ctlEdit(_T("Edit"), this, 1)
   {
      m_bWindowOnly = TRUE;
   }

// Declare the default message map, identified by '0'
BEGIN_MSG_MAP(CAtlEdit)
   MESSAGE_HANDLER(WM_CREATE, OnCreate)
   MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
   CHAIN_MSG_MAP(CComControl<CAtlEdit>)
// Declare an alternate message map, identified by '1'
ALT_MSG_MAP(1)
   MESSAGE_HANDLER(WM_CHAR, OnChar)
END_MSG_MAP()

포함된 창 m_EditCtrl은 포함하는 클래스 CAtlEditCMessageMap에서 파생되는 메시지 맵을 사용하므로 .

메시지 맵에 대한 자세한 내용은 "ATL 창 클래스" 문서의 메시지 지도 참조하세요.

요구 사항

헤더: atlwin.h

CMessageMap::P rocessWindowMessage

파생 클래스에서 dwMsgMapID식별된 메시지 맵에 CMessageMap액세스합니다.

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

매개 변수

hWnd
[in] 메시지를 수신하는 창에 대한 핸들입니다.

uMsg
[in] 창에 보낸 메시지입니다.

wParam
[in] 추가 메시지 관련 정보입니다.

lParam
[in] 추가 메시지 관련 정보입니다.

lResult
[out] 메시지 처리의 결과입니다.

dwMsgMapID
[in] 메시지를 처리할 메시지 맵의 식별자입니다. BEGIN_MSG_MAP 사용하여 선언된 기본 메시지 맵은 0으로 식별됩니다. ALT_MSG_MAP(msgMapID)선언된 대체 메시지 맵은 msgMapID.

Return Value

메시지가 완전히 처리되면 TRUE입니다. 그렇지 않으면 FALSE입니다.

설명

CContainedWindow 개체 또는 메시지 맵에 동적으로 연결된 개체의 창 프로시저에 의해 호출됩니다.

참고 항목

CDynamicChain 클래스
BEGIN_MSG_MAP
ALT_MSG_MAP(msgMapID)
클래스 개요