ChildFrm.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // ChildFrm.cpp : CChildFrame 类的实现
  2. //
  3. #include "stdafx.h"
  4. #include "MDI.h"
  5. #include "ChildFrm.h"
  6. #include ".\childfrm.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #endif
  10. // CChildFrame
  11. IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
  12. BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
  13. ON_WM_CREATE()
  14. END_MESSAGE_MAP()
  15. // CChildFrame 构造/析构
  16. CChildFrame::CChildFrame()
  17. {
  18. // TODO: 在此添加成员初始化代码
  19. }
  20. CChildFrame::~CChildFrame()
  21. {
  22. }
  23. BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
  24. {
  25. // TODO: 在此处通过修改 CREATESTRUCT cs 来修改窗口类或样式
  26. cs.style = cs.style | WS_HSCROLL;
  27. if( !CMDIChildWnd::PreCreateWindow(cs) )
  28. return FALSE;
  29. return TRUE;
  30. }
  31. // CChildFrame 诊断
  32. #ifdef _DEBUG
  33. void CChildFrame::AssertValid() const
  34. {
  35. CMDIChildWnd::AssertValid();
  36. }
  37. void CChildFrame::Dump(CDumpContext& dc) const
  38. {
  39. CMDIChildWnd::Dump(dc);
  40. }
  41. #endif //_DEBUG
  42. // CChildFrame 消息处理程序
  43. int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  44. {
  45. if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
  46. return -1;
  47. // TODO: Add your specialized creation code here
  48. SCROLLINFO info;
  49. info.cbSize = sizeof(info);
  50. info.fMask = SIF_ALL;
  51. info.nMin = 0;
  52. info.nMax = 10;
  53. info.nPage = 2;
  54. info.nPos = 5;
  55. info.nTrackPos = 2;
  56. SetScrollInfo(SB_HORZ,&info,FALSE);
  57. return 0;
  58. }