27#define _CRT_SECURE_NO_WARNINGS
28#define WM_NOTIFYICON_EVENT (WM_APP + 100)
29#define IDM_CONTEXT_MENU (WM_APP + 200)
32#include <unordered_map>
113 NOTIFYICONDATAW getBaseNotifyIconData();
118 bool createContextMenu();
125 LRESULT handleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
126 std::wstring m_className;
128 std::wstring m_tooltip;
133 std::filesystem::path m_openPath;
136 static std::unordered_map<HWND, NotifyIcon*> m_icons;
144 static LRESULT CALLBACK notifyIconWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
An icon for the Windows system tray.
Definition notifyicon.h:45
static NotifyIcon * getFromHWND(HWND hwnd)
Gets a NotifyIcon from an HWND.
const NotifyIconMenu & getContextMenu() const
Gets the context menu of the icon.
bool setTooltip(const std::wstring &tooltip)
Sets the tooltip text of the icon.
bool notify(const ShellNotificationSentEventArgs &e)
Shows a notification from the icon.
bool hide()
Hides the icon.
~NotifyIcon()
Destructs a NotifyIcon.
bool show()
Shows the icon.
const std::wstring & getTooltip() const
Gets the tooltip text of the icon.
NotifyIcon(HWND hwnd, const std::wstring &tooltip, const NotifyIconMenu &contextMenu={ }, bool hidden=false)
Constructs a NotifyIcon.
bool setContextMenu(const NotifyIconMenu &menu)
Sets the context menu of the icon.
An event argument for when a shell notification is sent.
Definition shellnotificationsenteventargs.h:34
Definition notificationsenteventargs.h:31