ReactOS 0.4.15-dev-7924-g5949c20
TrayIcon Struct Reference

#include <window.h>

Collaboration diagram for TrayIcon:

Public Member Functions

 TrayIcon (HWND hparent, UINT id)
 
 ~TrayIcon ()
 
void Add (HICON hIcon, LPCTSTR tooltip=NULL)
 
void Modify (HICON hIcon, LPCTSTR tooltip=NULL)
 
void Remove ()
 

Protected Member Functions

void Set (DWORD dwMessage, UINT id, HICON hIcon, LPCTSTR tooltip=NULL)
 

Protected Attributes

HWND _hparent
 
UINT _id
 

Detailed Description

Definition at line 991 of file window.h.

Constructor & Destructor Documentation

◆ TrayIcon()

TrayIcon::TrayIcon ( HWND  hparent,
UINT  id 
)
inline

Definition at line 993 of file window.h.

994 : _hparent(hparent), _id(id) {}
UINT _id
Definition: window.h:1018
HWND _hparent
Definition: window.h:1017

◆ ~TrayIcon()

TrayIcon::~TrayIcon ( )
inline

Definition at line 996 of file window.h.

997 {Remove();}
void Remove()
Definition: window.h:1005

Member Function Documentation

◆ Add()

void TrayIcon::Add ( HICON  hIcon,
LPCTSTR  tooltip = NULL 
)
inline

Definition at line 999 of file window.h.

1000 {Set(NIM_ADD, _id, hIcon, tooltip);}
HICON hIcon
Definition: msconfig.c:44
static BOOL Set
Definition: pageheap.c:10
#define NIM_ADD
Definition: shellapi.h:94

◆ Modify()

void TrayIcon::Modify ( HICON  hIcon,
LPCTSTR  tooltip = NULL 
)
inline

Definition at line 1002 of file window.h.

1003 {Set(NIM_MODIFY, _id, hIcon, tooltip);}
#define NIM_MODIFY
Definition: shellapi.h:95

◆ Remove()

void TrayIcon::Remove ( )
inline

Definition at line 1005 of file window.h.

1006 {
1008 sizeof(NOTIFYICONDATA), // cbSize
1009 _hparent, // hWnd
1010 _id, // uID
1011 };
1012
1014 }
NOTIFYICONDATA nid
Definition: magnifier.c:44
#define NIM_DELETE
Definition: shellapi.h:96
NOTIFYICONDATAA NOTIFYICONDATA
Definition: shellapi.h:679
#define Shell_NotifyIcon
Definition: shellapi.h:691

Referenced by ~TrayIcon().

◆ Set()

void TrayIcon::Set ( DWORD  dwMessage,
UINT  id,
HICON  hIcon,
LPCTSTR  tooltip = NULL 
)
inlineprotected

Definition at line 1020 of file window.h.

1021 {
1023 sizeof(NOTIFYICONDATA), // cbSize
1024 _hparent, // hWnd
1025 id, // uID
1026 NIF_MESSAGE|NIF_ICON, // uFlags
1027 PM_TRAYICON, // uCallbackMessage
1028 hIcon // hIcon
1029 };
1030
1031 if (tooltip)
1032 lstrcpyn(nid.szTip, tooltip, COUNTOF(nid.szTip));
1033
1034 if (nid.szTip[0])
1035 nid.uFlags |= NIF_TIP;
1036
1037 Shell_NotifyIcon(dwMessage, &nid);
1038 }
#define COUNTOF(x)
Definition: utility.h:93
#define PM_TRAYICON
Definition: window.h:984
#define NIF_ICON
Definition: shellapi.h:106
#define NIF_MESSAGE
Definition: shellapi.h:105
#define NIF_TIP
Definition: shellapi.h:107
CHAR szTip[128]
Definition: shellapi.h:237
#define lstrcpyn
Definition: winbase.h:3875

Member Data Documentation

◆ _hparent

HWND TrayIcon::_hparent
protected

Definition at line 1017 of file window.h.

Referenced by Remove(), and Set().

◆ _id

UINT TrayIcon::_id
protected

Definition at line 1018 of file window.h.

Referenced by Add(), Modify(), and Remove().


The documentation for this struct was generated from the following file: