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.

96 lines
2.6 KiB

  1. //==============================================================;
  2. //
  3. // This source code is only intended as a supplement to
  4. // existing Microsoft documentation.
  5. //
  6. //
  7. //
  8. //
  9. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  10. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  11. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  12. // PURPOSE.
  13. //
  14. // Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  15. //
  16. //
  17. //
  18. //==============================================================;
  19. #ifndef _BACKGROUND_H
  20. #define _BACKGROUND_H
  21. #include "DeleBase.h"
  22. class CBackground : public CDelegationBase {
  23. public:
  24. CBackground(int id) : m_itemId(NULL), m_id(id) { }
  25. virtual ~CBackground() {}
  26. virtual const _TCHAR *GetDisplayName(int nCol = 0);
  27. virtual const GUID & getNodeType() { return thisGuid; }
  28. virtual const int GetBitmapIndex() { return INDEX_BACKGROUND; }
  29. private:
  30. enum { IDM_NEW_BACKGROUND = 6 };
  31. static const GUID thisGuid;
  32. int m_id;
  33. HSCOPEITEM m_itemId;
  34. };
  35. class CBackgroundFolder : public CDelegationBase {
  36. public:
  37. CBackgroundFolder();
  38. virtual ~CBackgroundFolder();
  39. virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Background Objects"); }
  40. virtual const GUID & getNodeType() { return thisGuid; }
  41. virtual const int GetBitmapIndex() { return INDEX_BACKGROUND; }
  42. public:
  43. // virtual functions go here (for MMCN_*)
  44. virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
  45. virtual HRESULT OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect);
  46. virtual HRESULT OnAddImages(IImageList *pImageList, HSCOPEITEM hsi);
  47. virtual HRESULT OnRefresh();
  48. private:
  49. enum { MAX_CHILDREN = 30 };
  50. CBackground *m_children[MAX_CHILDREN];
  51. HWND m_backgroundHwnd;
  52. static const GUID thisGuid;
  53. static LRESULT CALLBACK WindowProc(
  54. HWND hwnd, // handle to window
  55. UINT uMsg, // message identifier
  56. WPARAM wParam, // first message parameter
  57. LPARAM lParam // second message parameter
  58. );
  59. static DWORD WINAPI ThreadProc(
  60. LPVOID lpParameter // thread data
  61. );
  62. DWORD m_threadId;
  63. HANDLE m_thread;
  64. bool m_running;
  65. IConsoleNameSpace *m_pConsoleNameSpace;
  66. HSCOPEITEM m_scopeitem;
  67. void AddItem(int id);
  68. CRITICAL_SECTION m_critSect;
  69. void StopThread();
  70. void StartThread();
  71. bool m_bSelected;
  72. bool m_bViewUpdated;
  73. };
  74. #endif // _BACKGROUND_H