源码:/Files/lusheng/OAsystem.zip
1、创建一个单文档的工程
2、添加两个类:Cleftpaneview,Clistpaneview 父类分别是 CTreeView,CListView
3、添加窗口分割类:CSplitterWndEx 默认父类为CFramewnd 创建后修改为CSplitterWnd
4、为CMainFrame添加变量 CSplitterWndEx m_wndSplitter
5、为CMainFrame添加消息函数OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
6、添加函数代码
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
if(!m_wndSplitter.CreateStatic(this,1,2))
return FALSE;
if(!m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CLeftPaneView),CSize(200,100),pContext))
return FALSE;
if(!m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CListPaneview),CSize(100,100),pContext))
return FALSE;
return TRUE;
}
窗口分割完毕,如图