Panoptes 1.0.0
Endpoint Detection and Response
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
TrayNotifications::Tray Class Reference

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

#include <TrayNotifications.h>

Static Public Member Functions

static BOOL ShowTrayIconBalloon (LPCSTR pszTitle, LPCSTR pszText)
 Display a tray icon balloon notification.
 

Detailed Description

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

Definition at line 7 of file TrayNotifications.h.

Member Function Documentation

◆ ShowTrayIconBalloon()

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

Display a tray icon balloon notification.

Parameters
pszTitleThe title of the notification
pszTextThe text of the notification
Returns
True if the notification was displayed successfully, false otherwise

Definition at line 10 of file TrayNotifications.cpp.

11{
12 NOTIFYICONDATAA nid = {};
13 nid.cbSize = sizeof(NOTIFYICONDATAA);
14 nid.hWnd = GetActiveWindow(); // Or use your main window handle
15 nid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP | NIF_INFO;
16 nid.uTimeout = 5000;
17 nid.dwInfoFlags = NIIF_INFO | NIIF_USER ;
18 nid.uVersion = NOTIFYICON_VERSION_4;
19 nid.hIcon = (HICON)LoadImageA(
20 NULL,
21 "assets\\panoptes-head.ico",
22 IMAGE_ICON,
23 128,
24 128,
25 LR_LOADFROMFILE | LR_SHARED
26 );
27
28 if (nid.hIcon == NULL)
29 return FALSE;
30
31 if (StringCchCopyA(nid.szInfoTitle, 64, pszTitle) != S_OK)
32 return FALSE;
33
34 if (StringCchCopyA(nid.szTip, 128, "Panoptes EDR") != S_OK)
35 return FALSE;
36
37 if (StringCchCopyA(nid.szInfo, 256, pszText) != S_OK)
38 return FALSE;
39
40 Shell_NotifyIconA(NIM_ADD, &nid);
41 Sleep(5000);
42 return Shell_NotifyIconA(NIM_DELETE, &nid);
43}

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