MyPropertySheet.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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, CResizableSheetEx)
  13. CMyPropertySheet::CMyPropertySheet(CWnd* pWndParent)
  14. : CResizableSheetEx(_T("CResizableSheetEx"), 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, CResizableSheetEx)
  24. //{{AFX_MSG_MAP(CMyPropertySheet)
  25. //}}AFX_MSG_MAP
  26. END_MESSAGE_MAP()
  27. /////////////////////////////////////////////////////////////////////////////
  28. // CMyPropertySheet message handlers
  29. BOOL CMyPropertySheet::OnInitDialog()
  30. {
  31. // prevent removal of buttons (hack)
  32. BOOL bOldState = m_bModeless;
  33. m_bModeless = FALSE;
  34. // recover first active page (lost with hack)
  35. m_nFlags |= WF_CONTINUEMODAL;
  36. CResizableSheetEx::OnInitDialog();
  37. m_nFlags &= ~WF_CONTINUEMODAL;
  38. m_bModeless = bOldState;
  39. return TRUE;
  40. }