taskbar.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /////////////////////////////////////////////////////////////////////////
  2. // File: wx/msw/taskbar.h
  3. // Purpose: Defines wxTaskBarIcon class for manipulating icons on the
  4. // Windows task bar.
  5. // Author: Julian Smart
  6. // Modified by: Vaclav Slavik
  7. // Created: 24/3/98
  8. // Copyright: (c) Julian Smart
  9. // Licence: wxWindows licence
  10. /////////////////////////////////////////////////////////////////////////
  11. #ifndef _WX_TASKBAR_H_
  12. #define _WX_TASKBAR_H_
  13. #include "wx/icon.h"
  14. // private helper class:
  15. class WXDLLIMPEXP_FWD_ADV wxTaskBarIconWindow;
  16. class WXDLLIMPEXP_ADV wxTaskBarIcon : public wxTaskBarIconBase
  17. {
  18. public:
  19. wxTaskBarIcon(wxTaskBarIconType iconType = wxTBI_DEFAULT_TYPE);
  20. virtual ~wxTaskBarIcon();
  21. // Accessors
  22. bool IsOk() const { return true; }
  23. bool IsIconInstalled() const { return m_iconAdded; }
  24. // Operations
  25. bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxEmptyString);
  26. bool RemoveIcon(void);
  27. bool PopupMenu(wxMenu *menu);
  28. // MSW-specific class methods
  29. #if wxUSE_TASKBARICON_BALLOONS
  30. // show a balloon notification (the icon must have been already initialized
  31. // using SetIcon)
  32. //
  33. // title and text are limited to 63 and 255 characters respectively, msec
  34. // is the timeout, in milliseconds, before the balloon disappears (will be
  35. // clamped down to the allowed 10-30s range by Windows if it's outside it)
  36. // and flags can include wxICON_ERROR/INFO/WARNING to show a corresponding
  37. // icon
  38. //
  39. // return true if balloon was shown, false on error (incorrect parameters
  40. // or function unsupported by OS)
  41. bool ShowBalloon(const wxString& title,
  42. const wxString& text,
  43. unsigned msec = 0,
  44. int flags = 0);
  45. #endif // wxUSE_TASKBARICON_BALLOONS
  46. protected:
  47. friend class wxTaskBarIconWindow;
  48. long WindowProc(unsigned int msg, unsigned int wParam, long lParam);
  49. void RegisterWindowMessages();
  50. wxTaskBarIconWindow *m_win;
  51. bool m_iconAdded;
  52. wxIcon m_icon;
  53. wxString m_strTooltip;
  54. DECLARE_DYNAMIC_CLASS_NO_COPY(wxTaskBarIcon)
  55. };
  56. #endif // _WX_TASKBAR_H_