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.

187 lines
4.7 KiB

  1. // Dialogs.h
  2. //
  3. // Copyright (c) 1998-1999 Microsoft Corporation
  4. #pragma once // MSINFO_DIALOGS_H
  5. #include <afxdlgs.h>
  6. #include "FileIO.h"
  7. #include "Resource.h"
  8. // Default values for the save dialog (overridden by the report dialog when it
  9. // inherits the save dialog).
  10. extern CString strMSInfoSaveFileTypes;
  11. extern CString strMSInfoSaveType;
  12. /*
  13. * CMSInfoFileDialog - Wrapper for the file dialog with our own default values.
  14. *
  15. * Note: This object should not be used directly.
  16. *
  17. * History: a-jsari 10/24/97 Initial version
  18. */
  19. class CMSInfoFileDialog : public CFileDialog {
  20. // Protected so that no one uses this object directly.
  21. public:
  22. INT_PTR DoModal();
  23. protected:
  24. CMSInfoFileDialog(BOOL bDialogIsOpen = FALSE, HWND hOwner = NULL,
  25. LPCTSTR lpszDefaultExtension = NULL, LPCTSTR lpszExtensionFilters = NULL);
  26. ~CMSInfoFileDialog() { };
  27. private:
  28. static TCHAR m_szCurrentDirectory[MAX_PATH]; // shared between file open and file save
  29. };
  30. /*
  31. * CMSInfoOpenDialog - Construct an open dialog.
  32. *
  33. * History: a-jsari 10/27/97 Initial version
  34. */
  35. class CMSInfoOpenDialog : public CMSInfoFileDialog {
  36. public:
  37. CMSInfoOpenDialog(HWND hOwner = NULL);
  38. ~CMSInfoOpenDialog() { }
  39. };
  40. /*
  41. * CMSInfoSaveDialog - Construct a save dialog.
  42. *
  43. * History: a-jsari 10/27/97 Initial version
  44. */
  45. class CMSInfoSaveDialog : public CMSInfoFileDialog {
  46. public:
  47. CMSInfoSaveDialog(HWND hOwner = NULL,
  48. LPCTSTR lpszDefaultExtension = strMSInfoSaveType,
  49. LPCTSTR lpszExtensionFilters = strMSInfoSaveFileTypes);
  50. ~CMSInfoSaveDialog() { }
  51. };
  52. /*
  53. * CMSInfoReportDialog - Construct a report dialog.
  54. *
  55. * History: a-jsari 10/27/97 Initial version
  56. */
  57. class CMSInfoReportDialog : public CMSInfoSaveDialog {
  58. public:
  59. CMSInfoReportDialog(HWND hOwner = NULL);
  60. ~CMSInfoReportDialog() { }
  61. };
  62. /*
  63. * CMSInfoPrintDialog - Construct a print dialog.
  64. *
  65. * History: a-jsari 10/24/97 Initial version.
  66. */
  67. class CMSInfoPrintDialog : public CPrintDialog {
  68. public:
  69. CMSInfoPrintDialog(HWND hOwner = NULL);
  70. ~CMSInfoPrintDialog() { }
  71. };
  72. class CSystemInfoScope;
  73. /*
  74. * CFindDialog - A dialog to handle finding data in MSInfo. The user
  75. * interface for this class is stored in the Resources IDD_FIND.
  76. *
  77. * History: a-jsari 10/29/97 Initial version.
  78. */
  79. class CFindDialog : public CDialog
  80. {
  81. // Construction
  82. public:
  83. friend class CFindThread;
  84. CFindDialog(CSystemInfoScope *pScope, HWND hPostWindow, HWND hwndMMCWindow);
  85. ~CFindDialog();
  86. BOOL Create();
  87. CWnd *SetFocus();
  88. BOOL OnInitDialog();
  89. void FindComplete();
  90. void ResetSearch();
  91. const CString &FindString() const { return m_strSearch; }
  92. static UINT WM_MSINFO_FIND;
  93. // Dialog Data
  94. //{{AFX_DATA(CFindDialog)
  95. enum { IDD = IDD_FIND };
  96. // NOTE: the ClassWizard will add data members here
  97. //}}AFX_DATA
  98. // Implementation
  99. protected:
  100. HWND m_hPostWindow;
  101. HWND m_hMMCWindow;
  102. CSystemInfoScope *m_pScope;
  103. CString m_strSearch;
  104. BOOL m_fRunning;
  105. UINT_PTR m_iTimer;
  106. LONG OnHelp(WPARAM wParam, LPARAM lParam);
  107. LONG OnContextMenu(WPARAM wParam, LPARAM lParam);
  108. // Generated message map functions
  109. //{{AFX_MSG(CFindDialog)
  110. virtual afx_msg void OnCancel();
  111. virtual afx_msg void OnFindNext();
  112. virtual afx_msg void OnNewSearch();
  113. virtual afx_msg void OnSearchTerm();
  114. virtual afx_msg void OnStopFind();
  115. virtual afx_msg void OnActivate(UINT, CWnd *, BOOL bMinimized);
  116. virtual afx_msg BOOL OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message);
  117. virtual afx_msg BOOL OnHelpInfo(HELPINFO * pHelpInfo);
  118. virtual afx_msg void OnTimer(UINT);
  119. //}}AFX_MSG
  120. DECLARE_MESSAGE_MAP()
  121. };
  122. /*
  123. * CFindThread - A thread in which to run a modal Find dialog, making it
  124. * effectively modeless. This is required because MMC runs its UI
  125. * in a thread which is inaccessible to the snap-in DLL, which runs
  126. * in a separate thread.
  127. *
  128. * History: a-jsari 1/19/98 Initial version.
  129. */
  130. class CFindThread : public CWinThread {
  131. public:
  132. // Nonspecific dynamic class initialization required for UI threads.
  133. DECLARE_DYNCREATE(CFindThread);
  134. CFindThread();
  135. ~CFindThread();
  136. void SetScope(CSystemInfoScope *pScope);
  137. void SetParent(HWND hParent, HWND hMMC);
  138. void Activate();
  139. void SetDataSource(CDataSource * pDataSource) { m_pDataSource = pDataSource; }
  140. CDataSource * GetDataSource() { return (m_pDataSource); }
  141. void FindComplete() { m_pdlgFind->FindComplete(); }
  142. void ResetSearch() { m_pdlgFind->ResetSearch(); }
  143. const CString &FindString() { return m_pdlgFind->FindString(); }
  144. BOOL InitInstance();
  145. int ExitInstance();
  146. void RemoteQuit();
  147. private:
  148. #if 0
  149. static LRESULT (*m_pBaseWindowProc)(HWND, UINT, WPARAM, LPARAM);
  150. static LRESULT CALLBACK FindWindowProc(HWND hMainWindow, UINT uMsg, WPARAM wParam, LPARAM lParam);
  151. #endif
  152. CFindDialog *m_pdlgFind;
  153. CSystemInfoScope *m_pScope;
  154. CDataSource *m_pDataSource;
  155. HWND m_hParentWindow;
  156. HWND m_hMMCWindow;
  157. };