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.

263 lines
9.0 KiB

  1. /*++
  2. Copyright (c) 1994-95 Microsoft Corporation
  3. Module Name:
  4. llsview.h
  5. Abstract:
  6. View window implementation.
  7. Author:
  8. Don Ryan (donryan) 12-Feb-1995
  9. Environment:
  10. User Mode - Win32
  11. Revision History:
  12. --*/
  13. #ifndef _LLSVIEW_H_
  14. #define _LLSVIEW_H_
  15. class CLlsmgrView : public CView
  16. {
  17. DECLARE_DYNCREATE(CLlsmgrView)
  18. private:
  19. CListCtrl m_licenseList;
  20. CListCtrl m_userList;
  21. CTreeCtrl m_serverTree;
  22. CListCtrl m_productList;
  23. CTabCtrl m_tabCtrl;
  24. PTC_TAB_ENTRY m_pTabEntry;
  25. BOOL m_bSaveSettings;
  26. BOOL m_bOrder;
  27. CStringList m_mruDomainList;
  28. LOGFONT m_lFont;
  29. public:
  30. CLlsmgrView();
  31. virtual ~CLlsmgrView();
  32. CLlsmgrDoc* GetDocument();
  33. void InitTabCtrl();
  34. void InitProductList();
  35. void InitLicenseList();
  36. void InitUserList();
  37. void InitServerTree();
  38. BOOL RefreshProductList();
  39. BOOL RefreshLicenseList();
  40. BOOL RefreshUserList();
  41. BOOL RefreshServerTree();
  42. BOOL RefreshServerTreeServers(HTREEITEM hParent);
  43. BOOL RefreshServerTreeServices(HTREEITEM hParent);
  44. void ResetLicenseList();
  45. void ResetProductList();
  46. void ResetUserList();
  47. void ResetServerTree();
  48. void ViewProductProperties();
  49. void ViewUserProperties();
  50. void ViewServerProperties();
  51. void ViewServiceProperties();
  52. void RecalcListColumns();
  53. void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
  54. void EnableCurSelTab(BOOL bEnable = TRUE);
  55. void OnSortColumn(int iColumn);
  56. void LoadSettings();
  57. void SaveSettings();
  58. void AddToMRU(LPCTSTR lpszDomainName);
  59. #ifdef _DEBUG
  60. virtual void AssertValid() const;
  61. virtual void Dump(CDumpContext& dc) const;
  62. #endif
  63. //{{AFX_VIRTUAL(CLlsmgrView)
  64. public:
  65. virtual void OnInitialUpdate();
  66. protected:
  67. virtual void OnDraw(CDC* pDC);
  68. virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
  69. virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
  70. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  71. //}}AFX_VIRTUAL
  72. public:
  73. //{{AFX_MSG(CLlsmgrView)
  74. afx_msg void OnSize(UINT nType, int cx, int cy);
  75. afx_msg void OnSelectFont();
  76. afx_msg void OnViewLicenses();
  77. afx_msg void OnViewMappings();
  78. afx_msg void OnViewProducts();
  79. afx_msg void OnViewServers();
  80. afx_msg void OnViewUsers();
  81. afx_msg void OnDelete();
  82. afx_msg void OnFormatIcons();
  83. afx_msg void OnFormatList();
  84. afx_msg void OnViewProperties();
  85. afx_msg void OnViewRefresh();
  86. afx_msg void OnFormatReport();
  87. afx_msg void OnFormatSmallIcons();
  88. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  89. afx_msg void OnSortColumn0();
  90. afx_msg void OnSortColumn1();
  91. afx_msg void OnSortColumn2();
  92. afx_msg void OnSortColumn3();
  93. afx_msg void OnSortColumn4();
  94. afx_msg void OnSortColumn5();
  95. afx_msg void OnNewLicense();
  96. afx_msg void OnNewMapping();
  97. afx_msg void OnSelectDomain();
  98. afx_msg void OnSaveSettings();
  99. afx_msg void OnUpdateSaveSettings(CCmdUI* pCmdUI);
  100. afx_msg void OnUpdateViewDelete(CCmdUI* pCmdUI);
  101. afx_msg void OnUpdateViewProperties(CCmdUI* pCmdUI);
  102. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  103. afx_msg void OnDestroy();
  104. //}}AFX_MSG
  105. afx_msg void OnSelChangingTabCtrl(NMHDR* pNMHDR, LRESULT* pResult);
  106. afx_msg void OnSelChangeTabCtrl(NMHDR* pNMHDR, LRESULT* pResult);
  107. afx_msg void OnKeyDownTabCtrl(NMHDR* pNMHDR, LRESULT* pResult);
  108. afx_msg void OnSetFocusTabCtrl(NMHDR* pNMHDR, LRESULT* pResult);
  109. afx_msg void OnKeyDownLicenseList(NMHDR* pNMHDR, LRESULT* pResult);
  110. afx_msg void OnColumnClickLicenseList(NMHDR* pNMHDR, LRESULT* pResult);
  111. afx_msg void OnGetDispInfoLicenseList(NMHDR* pNMHDR, LRESULT* pResult);
  112. afx_msg void OnSetFocusLicenseList(NMHDR* pNMHDR, LRESULT* pResult);
  113. afx_msg void OnKeyDownProductList(NMHDR* pNMHDR, LRESULT* pResult);
  114. afx_msg void OnDblClkProductList(NMHDR* pNMHDR, LRESULT* pResult);
  115. afx_msg void OnReturnProductList(NMHDR* pNMHDR, LRESULT* pResult);
  116. afx_msg void OnGetDispInfoProductList(NMHDR* pNMHDR, LRESULT* pResult);
  117. afx_msg void OnColumnClickProductList(NMHDR* pNMHDR, LRESULT* pResult);
  118. afx_msg void OnSetFocusProductList(NMHDR* pNMHDR, LRESULT* pResult);
  119. afx_msg void OnKeyDownUserList(NMHDR* pNMHDR, LRESULT* pResult);
  120. afx_msg void OnDblClkUserList(NMHDR* pNMHDR, LRESULT* pResult);
  121. afx_msg void OnReturnUserList(NMHDR* pNMHDR, LRESULT* pResult);
  122. afx_msg void OnGetDispInfoUserList(NMHDR* pNMHDR, LRESULT* pResult);
  123. afx_msg void OnColumnClickUserList(NMHDR* pNMHDR, LRESULT* pResult);
  124. afx_msg void OnSetFocusUserList(NMHDR* pNMHDR, LRESULT* pResult);
  125. afx_msg void OnKeyDownServerTree(NMHDR* pNMHDR, LRESULT* pResult);
  126. afx_msg void OnDblClkServerTree(NMHDR* pNMHDR, LRESULT* pResult);
  127. afx_msg void OnReturnServerTree(NMHDR* pNMHDR, LRESULT* pResult);
  128. afx_msg void OnItemExpandingServerTree(NMHDR* pNMHDR, LRESULT* pResult);
  129. afx_msg void OnGetDispInfoServerTree(NMHDR* pNMHDR, LRESULT* pResult);
  130. afx_msg void OnSetFocusServerTree(NMHDR* pNMHDR, LRESULT* pResult);
  131. afx_msg LRESULT OnContextMenu(WPARAM wParam, LPARAM lParam);
  132. afx_msg BOOL OnSelMruDomain(UINT nID);
  133. DECLARE_MESSAGE_MAP()
  134. };
  135. inline void CLlsmgrView::ResetLicenseList()
  136. { ::LvReleaseObArray(&m_licenseList); }
  137. inline void CLlsmgrView::ResetProductList()
  138. { ::LvReleaseObArray(&m_productList); }
  139. inline void CLlsmgrView::ResetUserList()
  140. { ::LvReleaseObArray(&m_userList); }
  141. inline void CLlsmgrView::ResetServerTree()
  142. { ::TvReleaseObArray(&m_serverTree, m_serverTree.GetRootItem()); }
  143. #ifndef _DEBUG
  144. inline CLlsmgrDoc* CLlsmgrView::GetDocument()
  145. { return (CLlsmgrDoc*)m_pDocument; }
  146. #endif
  147. int CALLBACK CompareProducts(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
  148. int CALLBACK CompareLicenses(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
  149. int CALLBACK CompareUsers(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
  150. int CALLBACK CompareDomains(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
  151. int CALLBACK CompareServers(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
  152. int CALLBACK CompareServices(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
  153. #define TCID_ALL -1
  154. #define TCID_PURCHASE_HISTORY 0
  155. #define TCID_PRODUCTS_VIEW 1
  156. #define TCID_PER_SEAT_CLIENTS 2
  157. #define TCID_SERVER_BROWSER 3
  158. #define TCID_TOTAL_TABS 4
  159. #define LVID_PURCHASE_HISTORY_DATE 1
  160. #define LVID_PURCHASE_HISTORY_PRODUCT 2
  161. #define LVID_PURCHASE_HISTORY_QUANTITY 3
  162. #define LVID_PURCHASE_HISTORY_ADMINISTRATOR 4
  163. #define LVID_PURCHASE_HISTORY_COMMENT 5
  164. #define LVID_PURCHASE_HISTORY_TOTAL_COLUMNS 6
  165. #define LVCX_PURCHASE_HISTORY_DATE 12
  166. #define LVCX_PURCHASE_HISTORY_PRODUCT 25
  167. #define LVCX_PURCHASE_HISTORY_QUANTITY 13
  168. #define LVCX_PURCHASE_HISTORY_ADMINISTRATOR 25
  169. #define LVCX_PURCHASE_HISTORY_COMMENT -1
  170. #define LVID_PRODUCTS_VIEW_NAME 0
  171. #define LVID_PRODUCTS_VIEW_PER_SEAT_PURCHASED 1
  172. #define LVID_PRODUCTS_VIEW_PER_SEAT_CONSUMED 2
  173. #define LVID_PRODUCTS_VIEW_PER_SERVER_PURCHASED 3
  174. #define LVID_PRODUCTS_VIEW_PER_SERVER_REACHED 4
  175. #define LVID_PRODUCTS_VIEW_TOTAL_COLUMNS 5
  176. #define LVCX_PRODUCTS_VIEW_NAME 20
  177. #define LVCX_PRODUCTS_VIEW_PER_SEAT_PURCHASED 20
  178. #define LVCX_PRODUCTS_VIEW_PER_SEAT_CONSUMED 20
  179. #define LVCX_PRODUCTS_VIEW_PER_SERVER_PURCHASED 20
  180. #define LVCX_PRODUCTS_VIEW_PER_SERVER_REACHED -1
  181. #define LVID_PER_SEAT_CLIENTS_NAME 0
  182. #define LVID_PER_SEAT_CLIENTS_LICENSED_USAGE 1
  183. #define LVID_PER_SEAT_CLIENTS_UNLICENSED_USAGE 2
  184. #define LVID_PER_SEAT_CLIENTS_SERVER_PRODUCTS 3
  185. #define LVID_PER_SEAT_CLIENTS_TOTAL_COLUMNS 4
  186. #define LVCX_PER_SEAT_CLIENTS_NAME 25
  187. #define LVCX_PER_SEAT_CLIENTS_LICENSED_USAGE 20
  188. #define LVCX_PER_SEAT_CLIENTS_UNLICENSED_USAGE 20
  189. #define LVCX_PER_SEAT_CLIENTS_SERVER_PRODUCTS -1
  190. #ifndef WM_CONTEXTMENU
  191. #define WM_CONTEXTMENU 0x007B
  192. #endif // WM_CONTEXTMENU
  193. #define MAX_MRU_ENTRIES 4
  194. #define REG_KEY_LLSMGR _T("Software\\Microsoft\\Llsmgr")
  195. #define REG_KEY_LLSMGR_MRU_LIST _T("RecentDomainList")
  196. #define REG_KEY_LLSMGR_FONT_FACENAME _T("FontFaceName")
  197. #define REG_KEY_LLSMGR_FONT_HEIGHT _T("FontHeight")
  198. #define REG_KEY_LLSMGR_FONT_WEIGHT _T("FontWeight")
  199. #define REG_KEY_LLSMGR_FONT_ITALIC _T("FontItalic")
  200. #define REG_KEY_LLSMGR_FONT_CHARSET _T("FontCharSet")
  201. #define REG_KEY_LLSMGR_SAVE_SETTINGS _T("SaveSettings")
  202. #define FONT_HEIGHT_DEFAULT -12
  203. #define FONT_WEIGHT_DEFAULT FW_NORMAL
  204. #endif // _LLSVIEW_H_