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.

163 lines
3.9 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. DfsShPrp.h
  5. Abstract:
  6. This module contains the declaration for CDfsShellExtProp
  7. This is used to implement the property page for Shell Extension.
  8. Author:
  9. Constancio Fernandes (ferns@qspl.stpp.soft.net) 12-Jan-1998
  10. Environment:
  11. NT Only.
  12. Revision History:
  13. --*/
  14. #ifndef _DFS_EXT_PROP_SHEET_H_
  15. #define _DFS_EXT_PROP_SHEET_H_
  16. #include "dfsenums.h"
  17. #include "qwizpage.h" // The base class that implements the common functionality
  18. // of property and wizard pages
  19. // ----------------------------------------------------------------------------
  20. // CDfsShellExtProp: Property Sheet Page for Shell Extension
  21. class CDfsShellExtProp : public CQWizardPageImpl<CDfsShellExtProp>
  22. {
  23. public:
  24. enum { IDD = IDD_DFS_SHELL_PROP };
  25. BEGIN_MSG_MAP(CDfsShellExtProp)
  26. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  27. MESSAGE_HANDLER(WM_PARENT_NODE_CLOSING, OnParentClosing)
  28. MESSAGE_HANDLER(WM_HELP, OnCtxHelp)
  29. MESSAGE_HANDLER(WM_CONTEXTMENU, OnCtxMenuHelp)
  30. MESSAGE_HANDLER(WM_NOTIFY, OnNotify)
  31. COMMAND_ID_HANDLER(IDC_FLUSH_PKT, OnFlushPKT)
  32. COMMAND_ID_HANDLER(IDC_CHECK_STATUS, OnCheckStatus)
  33. COMMAND_ID_HANDLER(IDC_SET_ACTIVE, OnSetActiveReferral)
  34. CHAIN_MSG_MAP(CQWizardPageImpl<CDfsShellExtProp>)
  35. END_MSG_MAP()
  36. CDfsShellExtProp();
  37. ~CDfsShellExtProp();
  38. LRESULT OnInitDialog(
  39. IN UINT i_uMsg,
  40. IN WPARAM i_wParam,
  41. IN LPARAM i_lParam,
  42. IN OUT BOOL& io_bHandled
  43. );
  44. // Used by the node to tell the propery page to close.
  45. LRESULT OnParentClosing(
  46. IN UINT i_uMsg,
  47. IN WPARAM i_wParam,
  48. IN LPARAM i_lParam,
  49. IN OUT BOOL& io_bHandled
  50. );
  51. LRESULT OnCtxHelp(
  52. IN UINT i_uMsg,
  53. IN WPARAM i_wParam,
  54. IN LPARAM i_lParam,
  55. IN OUT BOOL& io_bHandled
  56. );
  57. LRESULT OnCtxMenuHelp(
  58. IN UINT i_uMsg,
  59. IN WPARAM i_wParam,
  60. IN LPARAM i_lParam,
  61. IN OUT BOOL& io_bHandled
  62. );
  63. // Called to pass notifications.
  64. LRESULT OnNotify(
  65. IN UINT i_uMsg,
  66. IN WPARAM i_wParam,
  67. IN LPARAM i_lParam,
  68. IN OUT BOOL& io_bHandled
  69. );
  70. LRESULT OnFlushPKT(
  71. IN WORD i_wNotifyCode,
  72. IN WORD i_wID,
  73. IN HWND i_hWndCtl,
  74. IN OUT BOOL& io_bHandled
  75. );
  76. LRESULT OnCheckStatus(
  77. IN WORD i_wNotifyCode,
  78. IN WORD i_wID,
  79. IN HWND i_hWndCtl,
  80. IN OUT BOOL& io_bHandled
  81. );
  82. LRESULT OnSetActiveReferral(
  83. IN WORD i_wNotifyCode,
  84. IN WORD i_wID,
  85. IN HWND i_hWndCtl,
  86. IN OUT BOOL& io_bHandled
  87. );
  88. // Getters and Setters
  89. HRESULT put_DfsShellPtr(
  90. IN IShellPropSheetExt* i_pDfsShell
  91. );
  92. HRESULT put_DirPaths(
  93. IN BSTR i_bstrDirPath,
  94. IN BSTR i_bstrEntryPath
  95. );
  96. LRESULT OnApply();
  97. // Called when the property page gets deleted.
  98. void Delete();
  99. // Called when user double clicks an entry to make that alternate active.
  100. BOOL SetActive();
  101. // helper functions
  102. private:
  103. HRESULT _SetImageList();
  104. void _SetAlternateList();
  105. void _UpdateTextForReplicaState(
  106. IN HWND hwndControl,
  107. IN int nIndex,
  108. IN enum SHL_DFS_REPLICA_STATE ReplicaState
  109. );
  110. private:
  111. CComBSTR m_bstrDirPath;
  112. CComBSTR m_bstrEntryPath;
  113. IShellPropSheetExt* m_pIShProp;
  114. CComBSTR m_bstrAlternateListPath,
  115. m_bstrAlternateListActive,
  116. m_bstrAlternateListStatus,
  117. m_bstrAlternateListYes,
  118. m_bstrAlternateListNo,
  119. m_bstrAlternateListOK,
  120. m_bstrAlternateListUnreachable;
  121. };
  122. HRESULT LoadStringFromResource(
  123. IN const UINT i_uResourceID,
  124. OUT BSTR* o_pbstrReadValue
  125. );
  126. HRESULT DisplayMessageBoxForHR(HRESULT i_hr);
  127. #endif // _DFS_EXT_PROP_SHEET_H_