Panoptes 1.0.0
Endpoint Detection and Response
Loading...
Searching...
No Matches
TrayNotifications::Tray Class Reference

The Tray class that is used to display tray icon balloon notifications. More...

#include <tray_notifications.h>

Static Public Member Functions

static BOOL ShowTrayIconBalloon (LPCSTR pszTitle, LPCSTR pszText)
 Queues a tray icon balloon notification and returns at once. A background thread shows queued balloons one at a time, each for five seconds; in a burst, those beyond a few are summed into one "N more detections" balloon. The icon is assets\panoptes-head.ico next to the executable; without it nothing is shown.

Detailed Description

The Tray class that is used to display tray icon balloon notifications.

Definition at line 7 of file tray_notifications.h.

Member Function Documentation

◆ ShowTrayIconBalloon()

BOOL TrayNotifications::Tray::ShowTrayIconBalloon ( LPCSTR pszTitle,
LPCSTR pszText )
static

Queues a tray icon balloon notification and returns at once. A background thread shows queued balloons one at a time, each for five seconds; in a burst, those beyond a few are summed into one "N more detections" balloon. The icon is assets\panoptes-head.ico next to the executable; without it nothing is shown.

Parameters
pszTitleThe title of the notification
pszTextThe text of the notification
Returns
TRUE (the notification was queued)

Definition at line 78 of file tray_notifications.cpp.

79{
80 std::lock_guard<std::mutex> guard(g_Lock);
81 if (!g_WorkerStarted) {
82 // Detached: it only ever waits or shows a balloon, and ends with the process
83 std::thread(BalloonThread).detach();
84 g_WorkerStarted = true;
85 }
86 if (g_Queue.size() >= PANO_MAX_QUEUED_BALLOONS) {
87 g_Dropped++;
88 }
89 else {
90 g_Queue.push_back({ pszTitle, pszText });
91 }
92 g_Wake.notify_one();
93 return TRUE;
94}
#define PANO_MAX_QUEUED_BALLOONS

References PANO_MAX_QUEUED_BALLOONS.


The documentation for this class was generated from the following files: