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>
55 NotifyIcon(HWND hwnd,
const std::wstring& tooltip,
const NotifyIconMenu& contextMenu = { },
bool hidden =
false);
74 const std::wstring& getTooltip()
const;
80 bool setTooltip(
const std::wstring& tooltip);
85 const NotifyIconMenu& getContextMenu()
const;
91 bool setContextMenu(
const NotifyIconMenu& menu);
98 bool notify(
const ShellNotificationSentEventArgs& e);
106 static NotifyIcon* getFromHWND(HWND hwnd);
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;
129 NotifyIconMenu m_contextMenu;
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);
Definition notificationsenteventargs.h:31