다음을 통해 공유


CContainedWindowT 클래스

이 클래스는 다른 개체에 포함 된 창을 구현 합니다.

중요중요

런타임에서 Windows를 실행 하는 응용 프로그램에서이 클래스와 해당 멤버를 사용할 수 없습니다.

template <
class TBase= CWindow,
class TWinTraits= CControlWinTraits 
>
class CContainedWindowT :
public TBase

매개 변수

  • TBase
    새 클래스의 기본 클래스입니다.기본 기본 클래스인 CWindow.

  • TWinTraits
    창 스타일을 정의 하는 특성 클래스입니다.기본값은 CControlWinTraits입니다.

[!참고]

CContainedWindow 의 특수화 된 CContainedWindowT.사용할 기본 클래스 또는 특성을 변경 하려는 경우 CContainedWindowT 직접.

Members

9e286yks.collapse_all(ko-kr,VS.110).gifPublic 생성자

Name

설명

CContainedWindowT::CContainedWindowT

생성자입니다.지정 메시지 맵에 포함 된 창의 메시지를 처리 하는 데이터 멤버를 초기화 합니다.

9e286yks.collapse_all(ko-kr,VS.110).gifPublic 메서드

Name

설명

CContainedWindowT::Create

창을 만듭니다.

CContainedWindowT::DefWindowProc

기본 메시지 처리를 제공합니다.

CContainedWindowT::GetCurrentMessage

현재 메시지를 반환합니다.

CContainedWindowT::RegisterWndSuperclass

포함 된 창의 창 클래스를 등록 합니다.

CContainedWindowT::SubclassWindow

창을 서브 클래스입니다.

CContainedWindowT::SwitchMessageMap

변경 내용이 포함 된 창의 메시지를 처리 하는 메시지 맵을 사용 합니다.

CContainedWindowT::UnsubclassWindow

이전에 서브클래싱된 창을 복원 합니다.

CContainedWindowT::WindowProc

(정적) 포함 된 창에 보내는 메시지를 처리 합니다.

9e286yks.collapse_all(ko-kr,VS.110).gif공용 데이터 멤버

Name

설명

CContainedWindowT::m_dwMsgMapID

식별 어떤 메시지 맵에 포함 된 창의 메시지를 처리 합니다.

CContainedWindowT::m_lpszClassName

새 창 클래스 기반이 될 기존 창 클래스의 이름을 지정 합니다.

CContainedWindowT::m_pfnSuperWindowProc

창 클래스의 원본 창 프로시저를 가리킵니다.

CContainedWindowT::m_pObject

포함 된 개체를 가리킵니다.

설명

CContainedWindowT다른 개체에 포함 된 창을 구현 합니다.CContainedWindowT창 프로시저 사용 메시지 매핑 직접 메시지를 적절 한 처리기에 포함 된 개체에서의 수입니다.구성 하는 경우는 CContainedWindowT 개체를 지정 하는 메시지 맵을 사용 해야 합니다.

CContainedWindowT새 창 슈퍼 클 래 싱으로 기존 창 클래스를 만들 수 있습니다.만들기 메서드는 먼저 기존 클래스를 기반으로 하지만 사용 하는 창 클래스 등록 CContainedWindowT::WindowProc.만들기 다음이 새 창 클래스를 기반으로 하는 창을 만듭니다.각 인스턴스의 CContainedWindowT 다른 창 클래스를 슈퍼 클래스에 있습니다.

CContainedWindowT창 서브클래싱도 지원합니다.SubclassWindow 메서드는 기존 창에 연결 된 CContainedWindowT 개체 및 창 프로시저에 변경 CContainedWindowT::WindowProc.각 인스턴스의 CContainedWindowT 는 다른 창을 서브 클래스 수 있습니다.

[!참고]

제공에 대 한 CContainedWindowT 개체, 프로시저 호출 만들기 또는 SubclassWindow.모두 같은 개체의 메서드를 호출 해야 합니다.

사용 하는 경우는 추가 컨트롤을 기반으로 옵션 ATL 프로젝트 마법사에서 마법사가 자동으로 추가 합니다는 CContainedWindowT 컨트롤을 구현 하는 클래스의 데이터 멤버로.다음 예제에서는 포함 된 창의 선언 방법을 보여 줍니다.

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()
// Define OnCreate handler
// When the containing window receives a WM_CREATE
// message, create the contained window by calling
// CContainedWindow::Create
LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, 
   BOOL& /*bHandled*/)
{
   RECT rc;
   GetWindowRect(&rc);
   rc.right -= rc.left;
   rc.bottom -= rc.top;
   rc.top = rc.left = 0;
   m_ctlEdit.Create(m_hWnd, rc, _T("hello"), WS_CHILD | WS_VISIBLE | 
      ES_MULTILINE | ES_AUTOVSCROLL);
   return 0;
}

추가 정보

참조

컨트롤 만들기

ATL 자습서

ATL에서 창을 사용 하 여

ATL 창 클래스

ATL 프로젝트 마법사

ATL 프로젝트 만들기

Windows

Windows 및 다음 항목에는Windows SDK

상속 계층 구조

TBase

CContainedWindowT

요구 사항

헤더: atlwin.h

참고 항목

참조

CWindow 클래스

CWindowImpl 클래스

CMessageMap 클래스

BEGIN_MSG_MAP

ALT_MSG_MAP

기타 리소스

ATL 클래스 개요