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.

99 lines
2.7 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. void SetHandle(HSCOPEITEM itemId) { m_itemId = itemId; }
  30. HSCOPEITEM GetHandle() { return m_itemId; }
  31. private:
  32. enum { IDM_NEW_BACKGROUND = 6 };
  33. static const GUID thisGuid;
  34. int m_id;
  35. HSCOPEITEM m_itemId;
  36. };
  37. class CBackgroundFolder : public CDelegationBase {
  38. public:
  39. CBackgroundFolder();
  40. virtual ~CBackgroundFolder();
  41. virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Background Objects"); }
  42. virtual const GUID & getNodeType() { return thisGuid; }
  43. virtual const int GetBitmapIndex() { return INDEX_BACKGROUND; }
  44. public:
  45. // virtual functions go here (for MMCN_*)
  46. virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
  47. virtual HRESULT OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect);
  48. virtual HRESULT OnAddImages(IImageList *pImageList, HSCOPEITEM hsi);
  49. virtual HRESULT OnRefresh();
  50. private:
  51. enum { MAX_CHILDREN = 30 };
  52. CBackground *m_children[MAX_CHILDREN];
  53. HWND m_backgroundHwnd;
  54. static const GUID thisGuid;
  55. static LRESULT CALLBACK WindowProc(
  56. HWND hwnd, // handle to window
  57. UINT uMsg, // message identifier
  58. WPARAM wParam, // first message parameter
  59. LPARAM lParam // second message parameter
  60. );
  61. static DWORD WINAPI ThreadProc(
  62. LPVOID lpParameter // thread data
  63. );
  64. DWORD m_threadId;
  65. HANDLE m_thread;
  66. bool m_running;
  67. IConsoleNameSpace *m_pConsoleNameSpace;
  68. HSCOPEITEM m_scopeitem;
  69. void AddItem(int id);
  70. CRITICAL_SECTION m_critSect;
  71. void StopThread();
  72. void StartThread();
  73. bool m_bSelected;
  74. bool m_bViewUpdated;
  75. };
  76. #endif // _BACKGROUND_H