ReactOS  0.4.15-dev-321-g2d9b385
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) {}
HWND _hparent
Definition: window.h:1017
UINT _id
Definition: window.h:1018

◆ ~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
#define NIM_ADD
Definition: shellapi.h:91
UINT _id
Definition: window.h:1018
void Set(DWORD dwMessage, UINT id, HICON hIcon, LPCTSTR tooltip=NULL)
Definition: window.h:1020

◆ 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);}
HICON hIcon
Definition: msconfig.c:44
UINT _id
Definition: window.h:1018
void Set(DWORD dwMessage, UINT id, HICON hIcon, LPCTSTR tooltip=NULL)
Definition: window.h:1020
#define NIM_MODIFY
Definition: shellapi.h:92

◆ Remove()

void TrayIcon::Remove ( )
inline

Definition at line 1005 of file window.h.

1006  {
1007  NOTIFYICONDATA nid = {
1008  sizeof(NOTIFYICONDATA), // cbSize
1009  _hparent, // hWnd
1010  _id, // uID
1011  };
1012 
1014  }
NOTIFYICONDATA nid
Definition: magnifier.c:44
NOTIFYICONDATAA NOTIFYICONDATA
Definition: shellapi.h:675
#define NIM_DELETE
Definition: shellapi.h:93
HWND _hparent
Definition: window.h:1017
#define Shell_NotifyIcon
Definition: shellapi.h:687
UINT _id
Definition: window.h:1018

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  {
1022  NOTIFYICONDATA nid = {
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 NIF_MESSAGE
Definition: shellapi.h:102
NOTIFYICONDATA nid
Definition: magnifier.c:44
CHAR szTip[128]
Definition: shellapi.h:235
#define NIF_TIP
Definition: shellapi.h:104
NOTIFYICONDATAA NOTIFYICONDATA
Definition: shellapi.h:675
#define NIF_ICON
Definition: shellapi.h:103
#define PM_TRAYICON
Definition: window.h:984
HWND _hparent
Definition: window.h:1017
HICON hIcon
Definition: msconfig.c:44
#define Shell_NotifyIcon
Definition: shellapi.h:687
#define COUNTOF(x)
Definition: utility.h:93
#define lstrcpyn
Definition: winbase.h:3715

Referenced by Add(), and Modify().

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: