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.

183 lines
5.2 KiB

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