// ChildFrm.cpp : CChildFrame 类的实现 // #include "stdafx.h" #include "MDI.h" #include "ChildFrm.h" #include ".\childfrm.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // CChildFrame IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd) BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd) ON_WM_CREATE() END_MESSAGE_MAP() // CChildFrame 构造/析构 CChildFrame::CChildFrame() { // TODO: 在此添加成员初始化代码 } CChildFrame::~CChildFrame() { } BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs) { // TODO: 在此处通过修改 CREATESTRUCT cs 来修改窗口类或样式 cs.style = cs.style | WS_HSCROLL; if( !CMDIChildWnd::PreCreateWindow(cs) ) return FALSE; return TRUE; } // CChildFrame 诊断 #ifdef _DEBUG void CChildFrame::AssertValid() const { CMDIChildWnd::AssertValid(); } void CChildFrame::Dump(CDumpContext& dc) const { CMDIChildWnd::Dump(dc); } #endif //_DEBUG // CChildFrame 消息处理程序 int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1) return -1; // TODO: Add your specialized creation code here SCROLLINFO info; info.cbSize = sizeof(info); info.fMask = SIF_ALL; info.nMin = 0; info.nMax = 10; info.nPage = 2; info.nPos = 5; info.nTrackPos = 2; SetScrollInfo(SB_HORZ,&info,FALSE); return 0; }