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.

106 lines
2.7 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: C O N T R A Y . H
  7. //
  8. // Contents: CConnectionTray object definition.
  9. //
  10. // Notes:
  11. //
  12. // Author: jeffspr 30 Sep 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #ifndef _CONTRAY_H_
  17. #define _CONTRAY_H_
  18. #include <netshell.h>
  19. #include "nsbase.h"
  20. #include "nsres.h"
  21. #include "smutil.h"
  22. //---[ Connection Tray Classes ]----------------------------------------------
  23. class ATL_NO_VTABLE CConnectionTray :
  24. public CComObjectRootEx <CComObjectThreadModel>,
  25. public CComCoClass <CConnectionTray, &CLSID_ConnectionTray>,
  26. public IOleCommandTarget
  27. {
  28. private:
  29. LPITEMIDLIST m_pidl;
  30. public:
  31. CConnectionTray() throw()
  32. {
  33. m_pidl = NULL;
  34. }
  35. DECLARE_REGISTRY_RESOURCEID(IDR_CONTRAY)
  36. BEGIN_COM_MAP(CConnectionTray)
  37. COM_INTERFACE_ENTRY(IOleCommandTarget)
  38. END_COM_MAP()
  39. // IOleCommandTarget members
  40. STDMETHODIMP QueryStatus(
  41. IN const GUID * pguidCmdGroup,
  42. IN ULONG cCmds,
  43. IN OUT OLECMD prgCmds[],
  44. IN OUT OLECMDTEXT * pCmdText);
  45. STDMETHODIMP Exec(
  46. IN const GUID * pguidCmdGroup,
  47. IN DWORD nCmdID,
  48. IN DWORD nCmdexecopt,
  49. IN VARIANTARG * pvaIn,
  50. IN OUT VARIANTARG * pvaOut);
  51. // Handlers for various Exec Command IDs
  52. //
  53. HRESULT HrHandleTrayOpen();
  54. HRESULT HrHandleTrayClose();
  55. };
  56. class ATL_NO_VTABLE CConnectionTrayStats :
  57. public CComObjectRootEx <CComObjectThreadModel>,
  58. public INetConnectionStatisticsNotifySink
  59. {
  60. private:
  61. DWORD m_dwConPointCookie;
  62. CONFOLDENTRY m_ccfe;
  63. UINT m_uiIcon;
  64. BOOL m_fStaticIcon;
  65. public:
  66. CConnectionTrayStats() throw();
  67. ~CConnectionTrayStats() throw();
  68. DECLARE_REGISTRY_RESOURCEID(IDR_CONTRAY)
  69. BEGIN_COM_MAP(CConnectionTrayStats)
  70. COM_INTERFACE_ENTRY(INetConnectionStatisticsNotifySink)
  71. END_COM_MAP()
  72. // INetConnectionStatisticsNotifySink members
  73. //
  74. STDMETHOD(OnStatisticsChanged)(
  75. IN DWORD dwChangeFlags);
  76. public:
  77. static HRESULT CreateInstance (
  78. IN const CONFOLDENTRY &pcfe,
  79. IN UINT uiIcon,
  80. IN BOOL fStaticIcon,
  81. IN REFIID riid,
  82. OUT VOID** ppv);
  83. LPDWORD GetConPointCookie() throw() {return &m_dwConPointCookie;}
  84. };
  85. #endif // _CONTRAY_H_