linux 分割窗口,MFC对话框的窗口实现 窗口分割

int CSplitTestDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)

{

if (CDialogEx::OnCreate(lpCreateStruct) == -1)

return -1;

// Initialize a context for the view. CMyTreeView is my view and

// is defined as :  class CMyListView : public CListView.

CCreateContext ctxList, ctxEdit;

ctxList.m_pNewViewClass = RUNTIME_CLASS(CMyListView);

ctxList.m_pCurrentDoc = NULL;

ctxList.m_pNewDocTemplate = NULL;

ctxList.m_pLastView = NULL;

ctxList.m_pCurrentFrame = NULL;

ctxEdit.m_pNewViewClass = RUNTIME_CLASS(CMyEditView);

ctxEdit.m_pCurrentDoc = NULL;

ctxEdit.m_pNewDocTemplate = NULL;

ctxEdit.m_pLastView = NULL;

ctxEdit.m_pCurrentFrame = NULL;

// Because the CFrameWnd needs a window class, we will create

// a new one. I just copied the sample from MSDN Help.

// When using it in your project, you may keep CS_VREDRAW and

// CS_HREDRAW and then throw the other three parameters.

CString strMyClass = AfxRegisterWndClass(CS_VREDRAW|CS_HREDRAW, ::LoadCursor(NULL, IDC_ARROW), (HBRUSH)::GetStockObject(WHITE_BRUSH), ::LoadIcon(NULL, IDI_APPLICATION));

// Create the frame window with "this" as the parent

m_pFrameWnd = new CFrameWnd();

m_pFrameWnd->Create(strMyClass, _T(""), WS_CHILD, CRect(0,0,1,1), this);

m_pFrameWnd->ShowWindow(SW_SHOW);

m_pFrameWnd->MoveWindow(0, 0, 500, 400);

// and finally, create the splitter with the frame as

// the parent

m_wndSplitter.CreateStatic(m_pFrameWnd, 2, 1);

m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CMyListView), CSize(500,300), &ctxList);

m_wndSplitter.CreateView(1, 0, RUNTIME_CLASS(CMyEditView), CSize(500,100), &ctxEdit);

return 0;

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值