Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
3.5 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1994 - 1998.
  5. //
  6. // File: ToolAdv.cpp
  7. //
  8. // Contents: tool-wide default settings property page
  9. //
  10. // Classes: CToolAdvDefs
  11. //
  12. // History: 09-12-2000 stevebl Split from General property page
  13. //
  14. //---------------------------------------------------------------------------
  15. #include "precomp.hxx"
  16. #ifdef _DEBUG
  17. #define new DEBUG_NEW
  18. #undef THIS_FILE
  19. static char THIS_FILE[] = __FILE__;
  20. #endif
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CToolAdvDefs dialog
  23. CToolAdvDefs::CToolAdvDefs(CWnd* pParent /*=NULL*/)
  24. : CPropertyPage(CToolAdvDefs::IDD)
  25. {
  26. //{{AFX_DATA_INIT(CToolAdvDefs)
  27. m_fUninstallOnPolicyRemoval = FALSE;
  28. m_fShowPackageDetails = FALSE;
  29. m_fZapOn64 = FALSE;
  30. m_f32On64=FALSE;
  31. m_fIncludeOLEInfo = FALSE;
  32. //}}AFX_DATA_INIT
  33. }
  34. CToolAdvDefs::~CToolAdvDefs()
  35. {
  36. *m_ppThis = NULL;
  37. }
  38. void CToolAdvDefs::DoDataExchange(CDataExchange* pDX)
  39. {
  40. CDialog::DoDataExchange(pDX);
  41. //{{AFX_DATA_MAP(CToolAdvDefs)
  42. DDX_Check(pDX, IDC_CHECK4, m_fUninstallOnPolicyRemoval);
  43. DDX_Check(pDX, IDC_CHECK2, m_fShowPackageDetails);
  44. DDX_Check(pDX, IDC_CHECK5, m_f32On64);
  45. DDX_Check(pDX, IDC_CHECK6, m_fZapOn64);
  46. DDX_Check(pDX, IDC_CHECK7, m_fIncludeOLEInfo);
  47. //}}AFX_DATA_MAP
  48. }
  49. BEGIN_MESSAGE_MAP(CToolAdvDefs, CDialog)
  50. //{{AFX_MSG_MAP(CToolAdvDefs)
  51. ON_BN_CLICKED(IDC_CHECK2, OnChanged)
  52. ON_BN_CLICKED(IDC_CHECK4, OnChanged)
  53. ON_BN_CLICKED(IDC_CHECK5, OnChanged)
  54. ON_BN_CLICKED(IDC_CHECK6, OnChanged)
  55. ON_BN_CLICKED(IDC_CHECK7, OnChanged)
  56. ON_WM_CONTEXTMENU()
  57. //}}AFX_MSG_MAP
  58. END_MESSAGE_MAP()
  59. /////////////////////////////////////////////////////////////////////////////
  60. // CToolAdvDefs message handlers
  61. BOOL CToolAdvDefs::OnInitDialog()
  62. {
  63. #if DBG
  64. GetDlgItem(IDC_CHECK2)->ShowWindow(SW_SHOW);
  65. GetDlgItem(IDC_CHECK2)->EnableWindow(TRUE);
  66. #endif
  67. m_fUninstallOnPolicyRemoval = m_pToolDefaults->fUninstallOnPolicyRemoval;
  68. m_fShowPackageDetails = m_pToolDefaults->fShowPkgDetails;
  69. m_fZapOn64 = m_pToolDefaults->fZapOn64;
  70. m_f32On64 = m_pToolDefaults->f32On64;
  71. m_fIncludeOLEInfo = !m_pToolDefaults->fExtensionsOnly;
  72. CPropertyPage::OnInitDialog();
  73. return TRUE; // return TRUE unless you set the focus to a control
  74. // EXCEPTION: OCX Property Pages should return FALSE
  75. }
  76. #include <shlobj.h>
  77. BOOL CToolAdvDefs::OnApply()
  78. {
  79. m_pToolDefaults->fShowPkgDetails = m_fShowPackageDetails;
  80. m_pToolDefaults->fUninstallOnPolicyRemoval = m_fUninstallOnPolicyRemoval;
  81. m_pToolDefaults->f32On64 = m_f32On64;
  82. m_pToolDefaults->fZapOn64 = m_fZapOn64;
  83. m_pToolDefaults->fExtensionsOnly = !m_fIncludeOLEInfo;
  84. MMCPropertyChangeNotify(m_hConsoleHandle, m_cookie);
  85. return CPropertyPage::OnApply();
  86. }
  87. void CToolAdvDefs::OnChanged()
  88. {
  89. SetModified();
  90. }
  91. LRESULT CToolAdvDefs::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
  92. {
  93. switch (message)
  94. {
  95. case WM_HELP:
  96. StandardHelp((HWND)((LPHELPINFO) lParam)->hItemHandle, IDD);
  97. return 0;
  98. case WM_USER_REFRESH:
  99. // UNDONE
  100. return 0;
  101. case WM_USER_CLOSE:
  102. return GetOwner()->SendMessage(WM_CLOSE);
  103. default:
  104. return CPropertyPage::WindowProc(message, wParam, lParam);
  105. }
  106. }
  107. void CToolAdvDefs::OnContextMenu(CWnd* pWnd, CPoint point)
  108. {
  109. StandardContextMenu(pWnd->m_hWnd, IDD_TOOL_ADVANCEDDEFAULTS);
  110. }