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.

149 lines
4.7 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1999.
  5. //
  6. // File: srchwnd.hxx
  7. //
  8. // Contents:
  9. //
  10. // History: 15 Aug 1996 DLee Created
  11. //
  12. //--------------------------------------------------------------------------
  13. #pragma once
  14. enum { idQueryChild = 10, idListChild, idQueryTitle, idHeader };
  15. enum { idStatusMsg = 0, idStatusRatio, idStatusReliability };
  16. // One of these exists for each search window
  17. class CSearchControl
  18. {
  19. public:
  20. CSearchControl(HWND hwnd,WCHAR *pwcScope);
  21. ~CSearchControl();
  22. LRESULT wmSysColorChange(WPARAM wParam,LPARAM lParam)
  23. {
  24. _view.SysColorChange();
  25. _PassOnMsg( WM_SYSCOLORCHANGE, wParam, lParam );
  26. return 0;
  27. }
  28. LRESULT EditSubclassEvent(HWND hwnd,UINT msg,
  29. WPARAM wParam,LPARAM lParam);
  30. LRESULT wmListNotify (HWND hwnd, WPARAM wParam,LPARAM lParam);
  31. LRESULT wmAccelerator(WPARAM wParam,LPARAM lParam);
  32. LRESULT wmSize(WPARAM wParam,LPARAM lParam);
  33. LRESULT wmCommand(WPARAM wParam,LPARAM lParam);
  34. LRESULT wmNewFont(WPARAM wParam,LPARAM lParam);
  35. LRESULT wmDrawItem(WPARAM wParam,LPARAM lParam);
  36. LRESULT wmAppClosing(WPARAM wParam,LPARAM lParam);
  37. LRESULT wmMenuCommand(WPARAM wParam,LPARAM lParam);
  38. LRESULT wmSetFocus(WPARAM wParam,LPARAM lParam);
  39. LRESULT wmClose(WPARAM wParam,LPARAM lParam);
  40. LRESULT wmNotification(WPARAM wParam,LPARAM lParam);
  41. LRESULT wmInitMenu(WPARAM wParam,LPARAM lParam);
  42. LRESULT wmMeasureItem(WPARAM wParam,LPARAM lParam);
  43. LRESULT wmDisplaySubwindows(WPARAM wParam,LPARAM lParam);
  44. LRESULT wmActivate( HWND hwnd, WPARAM wParam, LPARAM lParam );
  45. LRESULT wmRealDrawItem( HWND hwnd, WPARAM wParam, LPARAM lParam );
  46. LRESULT wmColumnNotify(WPARAM wParam,LPARAM lParam);
  47. LRESULT wmContextMenu( HWND hwnd, WPARAM wParam, LPARAM lParam );
  48. void InitPanes();
  49. BOOL & Depth() { return _fDeep; }
  50. WCHAR * Scope() { return _awcScope; }
  51. WCHAR * Catalog() { return _awcCatalog; }
  52. WCHAR * CatalogOrNull() { return ( 0 == _awcCatalog[0] ) ? 0 : _awcCatalog; }
  53. WCHAR * Machine() { return _awcMachine; }
  54. void SetupDisplayProps( WCHAR *pwcProps );
  55. CColumnList & GetColumnList() { return _columns; }
  56. IColumnMapper & GetColumnMapper() { return _xColumnMapper.GetReference(); }
  57. private:
  58. void _DoBrowse( enumViewFile eViewType );
  59. void _UpdateStatusWindow( WCHAR const * pwcMsg,
  60. WCHAR const * pwcReliability );
  61. void _PassOnMsg( UINT msg, WPARAM wParam, LPARAM lParam )
  62. {
  63. if ( 0 != _hwndQuery )
  64. SendMessage( _hwndQuery, msg, wParam, lParam );
  65. if ( 0 != _hwndList )
  66. SendMessage( _hwndList, msg, wParam, lParam );
  67. if ( 0 != _hwndQueryTitle )
  68. SendMessage( _hwndQueryTitle, msg, wParam, lParam );
  69. if ( 0 != _hwndHeader )
  70. SendMessage( _hwndHeader, msg, wParam, lParam );
  71. }
  72. void ResetTitle();
  73. void _UpdateCount();
  74. void _AddColumnHeadings();
  75. //-------------------
  76. // Windows data
  77. HINSTANCE _hInst;
  78. // various panes
  79. HWND _hwndSearch;
  80. HWND _hwndQuery;
  81. HWND _hwndList;
  82. HWND _hwndQueryTitle;
  83. HWND _hwndHeader;
  84. HWND _hLastToHaveFocus;
  85. // Original windows procedures
  86. WNDPROC _lpOrgEditProc;
  87. WCHAR _awcScope[MAX_PATH];
  88. WCHAR _awcCatalog[MAX_PATH];
  89. WCHAR _awcMachine[SRCH_COMPUTERNAME_LENGTH + 1];
  90. XGrowable<WCHAR> _xCatList;
  91. LCID _lcid; // locale id for query
  92. BOOL _fDeep;
  93. XInterface<IColumnMapper> _xColumnMapper;
  94. CColumnList _columns;
  95. CSortList _sort;
  96. CSearchView _view; // the view
  97. CSearchQuery* _pSearch; // the model
  98. };
  99. struct SStatusDlg
  100. {
  101. void SetCaption();
  102. void Update();
  103. SStatusDlg( CSearchControl & ctrl, HWND hdlg ) : _hdlg( hdlg )
  104. {
  105. wcscpy( _awcScope, ctrl.Scope() );
  106. wcscpy( _awcCatalog, ctrl.Catalog() );
  107. wcscpy( _awcMachine, ctrl.Machine() );
  108. }
  109. WCHAR * _Scope() { return _awcScope; }
  110. WCHAR * _Catalog() { return _awcCatalog; }
  111. WCHAR * _CatalogOrNull() { return ( 0 == _awcCatalog[0] ) ? 0 : _awcCatalog; }
  112. WCHAR * _Machine() { return _awcMachine; }
  113. WCHAR _awcScope[MAX_PATH];
  114. WCHAR _awcCatalog[MAX_PATH];
  115. WCHAR _awcMachine[SRCH_COMPUTERNAME_LENGTH + 1];
  116. HWND _hdlg;
  117. };