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.

106 lines
2.9 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997
  5. //
  6. // File: trayagnt.h
  7. //
  8. // Contents: tray notification agent
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 01-14-1997 rayen (Raymond Endres) Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #ifndef TRAYAGNT_H_
  18. #define TRAYAGNT_H_
  19. //----------------------------------------------------------------------------
  20. // Tray Agent object
  21. //----------------------------------------------------------------------------
  22. class CTrayAgent : public INotificationSink
  23. {
  24. protected:
  25. ULONG m_cRef; // OLE ref count
  26. #ifdef DEBUG
  27. DWORD m_AptThreadId; //
  28. #endif
  29. private:
  30. ~CTrayAgent(void);
  31. public:
  32. CTrayAgent(void);
  33. // IUnknown members
  34. STDMETHODIMP QueryInterface(REFIID riid, void **punk);
  35. STDMETHODIMP_(ULONG) AddRef(void);
  36. STDMETHODIMP_(ULONG) Release(void);
  37. //
  38. // INotificationSink member(s)
  39. //
  40. STDMETHODIMP OnNotification(
  41. LPNOTIFICATION pNotification,
  42. LPNOTIFICATIONREPORT pNotificationReport,
  43. DWORD dwReserved
  44. );
  45. };
  46. //----------------------------------------------------------------------------
  47. // TrayUI object (not COM object)
  48. //----------------------------------------------------------------------------
  49. #define TRAYUI_CLOGS 128
  50. typedef struct LogEntryType {
  51. FILETIME ftLog;
  52. CLSID clsidAgent;
  53. CLSID startCookie;
  54. BSTR bstrStatus;
  55. } * PLogEntry;
  56. class CTrayUI
  57. {
  58. private:
  59. HWND m_hwnd; // hidden window
  60. DWORD m_fUpdatingTrayIcon;// Is updating?
  61. #if WANT_REGISTRY_LOG
  62. int m_cLogs; // count of valid logs;
  63. int m_cLogPtr; // pointer to the replacing candidate.
  64. // Round Robin Algorithm;
  65. LogEntryType m_aLogEntry[TRAYUI_CLOGS];
  66. #endif
  67. LONG m_cUpdates; // count of ongoing updates
  68. #ifdef DEBUG
  69. DWORD m_AptThreadId; //
  70. #endif
  71. private:
  72. STDMETHODIMP SetTrayIcon(DWORD fUpdating);
  73. STDMETHODIMP SyncLogWithReg(int, BOOL);
  74. public:
  75. CTrayUI(void);
  76. ~CTrayUI(void);
  77. STDMETHODIMP InitTrayUI(void);
  78. STDMETHODIMP DestroyTrayUI(void);
  79. STDMETHODIMP OpenSubscriptionFolder(void);
  80. STDMETHODIMP OpenContextMenu(POINT *);
  81. STDMETHODIMP UpdateNow(INotification *);
  82. STDMETHODIMP ConfigChanged(void);
  83. STDMETHODIMP OnBeginReport(INotification *);
  84. STDMETHODIMP OnEndReport(INotification *);
  85. #if WANT_REGISTRY_LOG
  86. STDMETHODIMP AddToLog(BSTR bstrLog, CLSID clsidAgent, CLSID startCookie);
  87. STDMETHODIMP LoadLogFromReg(void);
  88. STDMETHODIMP SaveLogToReg(void);
  89. #endif
  90. };
  91. #endif TRAYAGNT_H_