MyPropertySheet.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // MyPropertySheet.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "resource.h"
  5. #include "MyPropertySheet.h"
  6. #ifdef _DEBUG
  7. #undef THIS_FILE
  8. static char BASED_CODE THIS_FILE[] = __FILE__;
  9. #endif
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CMyPropertySheet
  12. IMPLEMENT_DYNAMIC(CMyPropertySheet, CResizableSheet)
  13. CMyPropertySheet::CMyPropertySheet(CWnd* pWndParent)
  14. : CResizableSheet(_T("CResizableSheet"), pWndParent)
  15. {
  16. AddPage(&m_Page1);
  17. AddPage(&m_Page2);
  18. AddPage(&m_Page3);
  19. }
  20. CMyPropertySheet::~CMyPropertySheet()
  21. {
  22. }
  23. BEGIN_MESSAGE_MAP(CMyPropertySheet, CResizableSheet)
  24. //{{AFX_MSG_MAP(CMyPropertySheet)
  25. //}}AFX_MSG_MAP
  26. END_MESSAGE_MAP()
  27. /////////////////////////////////////////////////////////////////////////////
  28. // CMyPropertySheet message handlers
  29. BOOL CMyPropertySheet::OnInitDialog()
  30. {
  31. CResizableSheet::OnInitDialog();
  32. // ModifyStyleEx(WS_EX_DLGMODALFRAME, 0); // enable sys menu and icon
  33. // set minimal size
  34. CRect rc;
  35. GetWindowRect(&rc);
  36. SetMinTrackSize(CSize(GetMinWidth(), rc.Height()));
  37. //ResetMinTrackSize();
  38. // enable save/restore, with active page
  39. EnableSaveRestore(_T("MyPropertySheet"), TRUE, TRUE);
  40. return TRUE;
  41. }