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.

102 lines
2.8 KiB

  1. // THPolicyPage.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "snapin.h"
  5. #include "THPolicyPage.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CTHPolicyPage property page
  13. IMPLEMENT_DYNCREATE(CTHPolicyPage, CHMPropertyPage)
  14. CTHPolicyPage::CTHPolicyPage() : CHMPropertyPage(CTHPolicyPage::IDD)
  15. {
  16. EnableAutomation();
  17. //{{AFX_DATA_INIT(CTHPolicyPage)
  18. // NOTE: the ClassWizard will add member initialization here
  19. //}}AFX_DATA_INIT
  20. }
  21. CTHPolicyPage::~CTHPolicyPage()
  22. {
  23. }
  24. void CTHPolicyPage::OnFinalRelease()
  25. {
  26. // When the last reference for an automation object is released
  27. // OnFinalRelease is called. The base class will automatically
  28. // deletes the object. Add additional cleanup required for your
  29. // object before calling the base class.
  30. CHMPropertyPage::OnFinalRelease();
  31. }
  32. void CTHPolicyPage::DoDataExchange(CDataExchange* pDX)
  33. {
  34. CHMPropertyPage::DoDataExchange(pDX);
  35. //{{AFX_DATA_MAP(CTHPolicyPage)
  36. // NOTE: the ClassWizard will add DDX and DDV calls here
  37. //}}AFX_DATA_MAP
  38. }
  39. BEGIN_MESSAGE_MAP(CTHPolicyPage, CHMPropertyPage)
  40. //{{AFX_MSG_MAP(CTHPolicyPage)
  41. ON_WM_DESTROY()
  42. //}}AFX_MSG_MAP
  43. END_MESSAGE_MAP()
  44. BEGIN_DISPATCH_MAP(CTHPolicyPage, CHMPropertyPage)
  45. //{{AFX_DISPATCH_MAP(CTHPolicyPage)
  46. // NOTE - the ClassWizard will add and remove mapping macros here.
  47. //}}AFX_DISPATCH_MAP
  48. END_DISPATCH_MAP()
  49. // Note: we add support for IID_ITHPolicyPage to support typesafe binding
  50. // from VBA. This IID must match the GUID that is attached to the
  51. // dispinterface in the .ODL file.
  52. // {52566162-C9D1-11D2-BD8D-0000F87A3912}
  53. static const IID IID_ITHPolicyPage =
  54. { 0x52566162, 0xc9d1, 0x11d2, { 0xbd, 0x8d, 0x0, 0x0, 0xf8, 0x7a, 0x39, 0x12 } };
  55. BEGIN_INTERFACE_MAP(CTHPolicyPage, CHMPropertyPage)
  56. INTERFACE_PART(CTHPolicyPage, IID_ITHPolicyPage, Dispatch)
  57. END_INTERFACE_MAP()
  58. /////////////////////////////////////////////////////////////////////////////
  59. // CTHPolicyPage message handlers
  60. BOOL CTHPolicyPage::OnInitDialog()
  61. {
  62. CHMPropertyPage::OnInitDialog();
  63. m_NewBitmap.LoadBitmap(IDB_BITMAP_NEW);
  64. m_PropertiesBitmap.LoadBitmap(IDB_BITMAP_PROPERTIES);
  65. m_DeleteBitmap.LoadBitmap(IDB_BITMAP_DELETE);
  66. SendDlgItemMessage(IDC_BUTTON_NEW,BM_SETIMAGE,IMAGE_BITMAP,(LPARAM)(HBITMAP)m_NewBitmap);
  67. SendDlgItemMessage(IDC_BUTTON_PROPERTIES,BM_SETIMAGE,IMAGE_BITMAP,(LPARAM)(HBITMAP)m_PropertiesBitmap);
  68. SendDlgItemMessage(IDC_BUTTON_DELETE,BM_SETIMAGE,IMAGE_BITMAP,(LPARAM)(HBITMAP)m_DeleteBitmap);
  69. return TRUE; // return TRUE unless you set the focus to a control
  70. // EXCEPTION: OCX Property Pages should return FALSE
  71. }
  72. void CTHPolicyPage::OnDestroy()
  73. {
  74. CHMPropertyPage::OnDestroy();
  75. m_NewBitmap.DeleteObject();
  76. m_PropertiesBitmap.DeleteObject();
  77. m_DeleteBitmap.DeleteObject();
  78. }