Leaked source code of windows server 2003
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.

192 lines
6.4 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997-2002.
  5. //
  6. // File: FindDlg.h
  7. //
  8. // Contents: Base class for cert find dialog
  9. //
  10. //----------------------------------------------------------------------------\
  11. #if !defined(AFX_FINDDLG_H__013A1C28_2930_11D1_B48F_00C04FB94F17__INCLUDED_)
  12. #define AFX_FINDDLG_H__013A1C28_2930_11D1_B48F_00C04FB94F17__INCLUDED_
  13. #if _MSC_VER >= 1000
  14. #pragma once
  15. #endif // _MSC_VER >= 1000
  16. // FindDlg.h : header file
  17. //
  18. #include "certifct.h"
  19. #include "FindDlgListCtrl.h"
  20. /////////////////////////////////////////////////////////////////////////////
  21. // CFindDialog dialog
  22. #define CERT_FIND_SERIAL_NUMBER 0x0000FFFE
  23. class CCertMgrComponentData; //forward declaration
  24. class CFindDialog : public CHelpDialog
  25. {
  26. // Construction
  27. public:
  28. CFindDialog (CWnd* pParent,
  29. const CString &pcszMachineName,
  30. const CString &szFileName,
  31. CCertMgrComponentData* pCompData);
  32. virtual ~CFindDialog ();
  33. // Dialog Data
  34. //{{AFX_DATA(CFindDialog)
  35. enum { IDD = IDD_FIND };
  36. CComboBox m_storeList;
  37. CButton m_stopBtn;
  38. CFindDlgListCtrl m_resultsList;
  39. CButton m_newSearchBtn;
  40. CButton m_findNowBtn;
  41. CComboBox m_fieldList;
  42. CAnimateCtrl m_animate;
  43. CString m_szContains;
  44. CString m_szSearchField;
  45. CString m_szSelectedStore;
  46. //}}AFX_DATA
  47. // Overrides
  48. // ClassWizard generated virtual function overrides
  49. //{{AFX_VIRTUAL(CFindDialog)
  50. public:
  51. protected:
  52. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  53. //}}AFX_VIRTUAL
  54. // Implementation
  55. protected:
  56. static int CALLBACK CompareFunc (LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
  57. void RemoveSpaces (CString & text);
  58. public:
  59. HRESULT SearchForText (CString & szFindText, DWORD dwPropId);
  60. HRESULT SearchForNames (const CString& szFindText, DWORD dwFindType);
  61. protected:
  62. void CloseAllStores ();
  63. void DoContextHelp (HWND hWndControl);
  64. void ChangeToSizableFrame ();
  65. HRESULT LaunchCommonCertDialog (CCertificate* pCert, const int nItem);
  66. void OnOpen();
  67. CCertificate* GetSelectedCertificate (OUT int * nSelectedItem = NULL);
  68. DWORD DisplaySystemError ();
  69. void OnDelete ();
  70. void ChangeViewStyle (DWORD dwStyle);
  71. void DeleteAllResultItems ();
  72. void RefreshItemInList(CCertificate * pCert, int nItem);
  73. void InsertItemInList (CCertificate* pCert);
  74. void SearchForTextOnStore (DWORD dwPropId,
  75. CString &szFindName, CCertStore& rCertStore);
  76. void SearchForNameOnStore (DWORD dwFindFlags, DWORD dwFindType,
  77. void* pvPara, CCertStore& rCertStore);
  78. void DoSearch ();
  79. void ExpandWindow ();
  80. void StopSearch ();
  81. void AddFieldsToList ();
  82. void AddLogicalStoresToList ();
  83. void MoveControls ();
  84. void CloseAndReopenStores ();
  85. // Generated message map functions
  86. //{{AFX_MSG(CFindDialog)
  87. virtual BOOL OnInitDialog();
  88. afx_msg void OnFindNow();
  89. afx_msg void OnSizing( UINT nSide, LPRECT lpRect );
  90. afx_msg void OnDestroy();
  91. afx_msg void OnNewSearch();
  92. afx_msg void OnStop();
  93. afx_msg void OnRclickResultList(NMHDR* pNMHDR, LRESULT* pResult);
  94. afx_msg void OnDblclkResultList(NMHDR* pNMHDR, LRESULT* pResult);
  95. afx_msg void OnColumnclickResultList(NMHDR* pNMHDR, LRESULT* pResult);
  96. afx_msg void OnChangeContainsText();
  97. afx_msg void OnItemchangedResultList(NMHDR* pNMHDR, LRESULT* pResult);
  98. afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  99. afx_msg void OnSize(UINT nType, int cx, int cy);
  100. virtual void OnCancel();
  101. afx_msg void OnSelchangeFieldList();
  102. //}}AFX_MSG
  103. afx_msg void OnProperties();
  104. afx_msg void OnView();
  105. afx_msg void OnFileDelete();
  106. void OnEnroll(bool bNewKey);
  107. afx_msg void OnEnrollNewKey();
  108. afx_msg void OnEnrollSameKey();
  109. afx_msg void OnFileExport();
  110. void OnFileRenew(bool bNewKey);
  111. afx_msg void OnFileRenewNewKey();
  112. afx_msg void OnFileRenewSameKey();
  113. afx_msg void OnEditInvertselection();
  114. afx_msg void OnEditSelectall();
  115. afx_msg void OnFileProperties();
  116. afx_msg void OnHelpHelptopics();
  117. afx_msg void OnViewDetails();
  118. afx_msg void OnViewLargeicons();
  119. afx_msg void OnViewList();
  120. afx_msg void OnViewSmallicons();
  121. DECLARE_MESSAGE_MAP()
  122. enum {
  123. COL_ISSUED_TO = 0,
  124. COL_ISSUED_BY,
  125. COL_EXPIRATION_DATE,
  126. COL_PURPOSES,
  127. COL_FRIENDLY_NAME,
  128. COL_SOURCE_STORE,
  129. NUM_COLS // must be last
  130. };
  131. private:
  132. void EnableMenuItems ();
  133. void HideResultList();
  134. void SetUpResultList();
  135. HANDLE m_hCancelSearchEvent;
  136. bool m_bConsoleRefreshRequired;
  137. CCertMgrComponentData* m_pCompData;
  138. CString m_szLoggedInUser;
  139. const CString m_szManagedService;
  140. const CString m_szFileName;
  141. bool m_bAnimationRunning;
  142. CString m_szMachineName;
  143. int m_cyMin;
  144. int m_cxMin;
  145. bool m_fWindowExpandedOnce;
  146. int m_cyOriginal;
  147. int m_cxBtnMargin;
  148. int m_cxAnimMargin;
  149. int m_cxStoreListMargin;
  150. int m_cxContainMargin;
  151. int m_cxTabMargin;
  152. int m_cxFieldListMargin;
  153. int m_cxResultListMargin;
  154. WTL::CImageList m_imageListSmall;
  155. WTL::CImageList m_imageListNormal;
  156. bool m_bInitComplete;
  157. bool m_bViewArchivedCerts;
  158. bool m_bStoreIsOpenedToViewArchiveCerts;
  159. public:
  160. void ResetMenu();
  161. bool ConsoleRefreshRequired () const;
  162. void RestoreAfterSearchSettings();
  163. CCriticalSection m_critSec;
  164. CSingleLock m_singleLock;
  165. CStatusBarCtrl m_statusBar;
  166. HANDLE m_hSearchThread;
  167. afx_msg void OnLvnKeydownResultList(NMHDR *pNMHDR, LRESULT *pResult);
  168. afx_msg void OnNMSetfocusResultList(NMHDR *pNMHDR, LRESULT *pResult);
  169. afx_msg void OnNMKillfocusResultList(NMHDR *pNMHDR, LRESULT *pResult);
  170. };
  171. //{{AFX_INSERT_LOCATION}}
  172. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  173. #endif // !defined(AFX_FINDDLG_H__013A1C28_2930_11D1_B48F_00C04FB94F17__INCLUDED_)