TrayIcon Struct Reference

#include <window.h>

Collaboration diagram for TrayIcon:

Collaboration graph
[legend]

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 971 of file window.h.


Constructor & Destructor Documentation

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

Definition at line 973 of file window.h.

00974      :  _hparent(hparent), _id(id) {}

TrayIcon::~TrayIcon (  )  [inline]

Definition at line 976 of file window.h.

00977         {Remove();}


Member Function Documentation

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

Definition at line 979 of file window.h.

00980         {Set(NIM_ADD, _id, hIcon, tooltip);}

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

Definition at line 982 of file window.h.

00983         {Set(NIM_MODIFY, _id, hIcon, tooltip);}

void TrayIcon::Remove (  )  [inline]

Definition at line 985 of file window.h.

00986     {
00987         NOTIFYICONDATA nid = {
00988             sizeof(NOTIFYICONDATA), // cbSize
00989             _hparent,               // hWnd
00990             _id,                    // uID
00991         };
00992 
00993         Shell_NotifyIcon(NIM_DELETE, &nid);
00994     }

void TrayIcon::Set ( DWORD  dwMessage,
UINT  id,
HICON  hIcon,
LPCTSTR  tooltip = NULL 
) [inline, protected]

Definition at line 1000 of file window.h.

References COUNTOF, and PM_TRAYICON.

01001     {
01002         NOTIFYICONDATA nid = {
01003             sizeof(NOTIFYICONDATA), // cbSize
01004             _hparent,               // hWnd
01005             id,                     // uID
01006             NIF_MESSAGE|NIF_ICON,   // uFlags
01007             PM_TRAYICON,            // uCallbackMessage
01008             hIcon                   // hIcon
01009         };
01010 
01011         if (tooltip)
01012             lstrcpyn(nid.szTip, tooltip, COUNTOF(nid.szTip));
01013 
01014         if (nid.szTip[0])
01015             nid.uFlags |= NIF_TIP;
01016 
01017         Shell_NotifyIcon(dwMessage, &nid);
01018     }


Field Documentation

HWND TrayIcon::_hparent [protected]

Definition at line 997 of file window.h.

UINT TrayIcon::_id [protected]

Definition at line 998 of file window.h.


The documentation for this struct was generated from the following file:
IBrowser Source Code Documentation
generated on 18.09.2008 by doxygen

Homepage