서식 파일 lt; 클래스TBaseCWindow, 클래스 =TWinTraits(&L) = CControlWinTraits gt;
CContainedWindowT 클래스: 공용 TBase(&G)
매개 변수
TBase
새 클래스의 기본 클래스입니다. 기본 기본 클래스는 CWindow。
TWinTraits
창에 대 한 스타일을 정의 하는 특성 클래스입니다. 기본값은 CControlWinTraits 입니다.
메모 nbsp; CContainedWindow CContainedWindowT의 전문화 이다. 직접 CContainedWindowT 사용 하는 기본 클래스 또는 특성을 변경(&N).
CContainedWindow 다른 개체 내에 포함 된 창을 구현 합니다. CContainedWindow창 프로시저에서는 포함 하는 개체의 메시지 지도 사용 하 여 적절 한 처리기에 메시지를 직접. 메시지 맵을 사용 해야 지정 CContainedWindow 개체를 생성 하는 경우。
CContainedWindow 를 사용 하면 기존 창 클래스 superclassing 하 여 새 창을 만들 수 있습니다. Create 메서드는 먼저 기존 클래스에 기반 하지만 CContainedWindow::WindowProc를 사용 하는 창 클래스를 등록 합니다. 만들기 에 다음이 새 창 클래스를 기반으로 하는 창을 만듭니다. CContainedWindow 의 각 인스턴스 수 슈퍼 다른 창 클래스。
CContainedWindow 창 서브클래싱을 지원합니다. SubclassWindow 메서드는 기존 창 CContainedWindow 개체에 연결 하 고 CContainedWindow::WindowProc창 프로시저 변경. 각 인스턴스의 CContainedWindow 하위 다른 창 수。
메모nbsp;??어떤 주어진된 CContainedWindow 개체에 대 한 만들기 또는 SubclassWindow를 호출 합니다. 두 방법 모두 동일한 개체를 호출 하지 않아야(&N)。
ATL 개체 마법사에서 컨트롤에 따라 추가 옵션을 사용 하는 경우 마법사는 컨트롤을 구현 하는 클래스에 CContainedWindow 데이터 멤버를 추가 하는 자동으로 됩니다. 다음 예제에서 가져온 것입니다 있는 SUBEDIT 샘플 및 포함 된 창이 선언 방법을 보여줍니다
class CAtlEdit : ...
{
public:
// Declare a contained window data member
CContainedWindow m_EditCtrl;
// 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_EditCtrl(_T("EDIT"), this, 1)
{
m_bWindowOnly = TRUE;
}
// Declare the default message map,
// identified by '0'
BEGIN_MSG_MAP(CAtlEdit)
...
MESSAGE_HANDLER(WM_CREATE, OnCreate)
...
// 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)
{
...
m_EditCtrl.Create(m_hWnd, rc, _T("hello"),
WS_CHILD | WS_VISIBLE |
ES_MULTILINE | ES_AUTOVSCROLL);
return 0;
}
...
};
| 에 대 한 자세한 내용은 | 참조 |
| 컨트롤 만들기 | ATL 자습서 |
| ATL에서 창을 사용 하 여 | ATL 창 클래스 |
| ATL 개체 마법사 | ATL 프로젝트 만들기 |
| 윈도우 | Windows 및 플랫폼 SDK 의 후속 항목 |
| 서브클래싱 | Platform SDK에 있는 창 프로시저 서브클래싱 |
| Superclassing | Platform SDK에 있는 창 프로시저 Superclassing |
# include lt;atlwin.h>
참고 항목
CWindow, CWindowImpl, CMessageMap, BEGIN_MSG_MAP, ALT_MSG_MAP