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.

90 lines
1.6 KiB

  1. //____________________________________________________________________________
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1995 - 1996.
  5. //
  6. // File: tasks.hxx
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 3/22/1996 RaviR Created
  15. //
  16. //____________________________________________________________________________
  17. #ifndef _TRAYICON_HXX_
  18. #define _TRAYICON_HXX_
  19. #include "tasksrc.h"
  20. #define SCHEDM_TRAY_NOTIFY (WM_APP+100)
  21. class CTrayIcon
  22. {
  23. public:
  24. CTrayIcon(void) : m_hTrayIcon(NULL), m_fTrayStarted(FALSE) {}
  25. ~CTrayIcon() {}
  26. void Start(void)
  27. {
  28. Idle();
  29. }
  30. void Idle(void) {
  31. _EnsureTrayHasStarted();
  32. _TrayMessage(NIM_MODIFY, IDI_STATE_IDLE, IDS_STATE_IDLE);
  33. }
  34. void Awake(void) {
  35. _EnsureTrayHasStarted();
  36. _TrayMessage(NIM_MODIFY, IDI_STATE_RUNNING, IDS_STATE_RUNNING);
  37. }
  38. void Suspend(void) {
  39. _EnsureTrayHasStarted();
  40. _TrayMessage(NIM_MODIFY, IDI_STATE_SUSPENDED, IDS_STATE_SUSPENDED);
  41. }
  42. void Stop(void) {
  43. _TrayMessage(NIM_DELETE, NULL, NULL);
  44. m_fTrayStarted = FALSE;
  45. }
  46. private:
  47. void _EnsureTrayHasStarted(void)
  48. {
  49. if (m_fTrayStarted == FALSE)
  50. {
  51. m_fTrayStarted = _TrayMessage(NIM_ADD, NULL, NULL);
  52. }
  53. }
  54. BOOL _TrayMessage(DWORD dwMessage, UINT uiIcon, int ids);
  55. HICON m_hTrayIcon;
  56. BOOL m_fTrayStarted;
  57. }; // class CTrayIcon
  58. void
  59. Schedule_TrayNotify(
  60. WPARAM wParam,
  61. LPARAM lParam);
  62. void
  63. OpenJobFolder(void);
  64. #endif // _TRAYICON_HXX_