Public Member Functions | Protected Member Functions | Protected Attributes

TrayIcon Struct Reference

#include <window.h>

Collaboration diagram for TrayIcon:
Collaboration graph
[legend]

List of all members.

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


Constructor & Destructor Documentation

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

Definition at line 992 of file window.h.

     :  _hparent(hparent), _id(id) {}
TrayIcon::~TrayIcon (  ) [inline]

Definition at line 995 of file window.h.

        {Remove();}

Member Function Documentation

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

Definition at line 998 of file window.h.

        {Set(NIM_ADD, _id, hIcon, tooltip);}
void TrayIcon::Modify ( HICON  hIcon,
LPCTSTR  tooltip = NULL 
) [inline]

Definition at line 1001 of file window.h.

        {Set(NIM_MODIFY, _id, hIcon, tooltip);}
void TrayIcon::Remove (  ) [inline]

Definition at line 1004 of file window.h.

    {
        NOTIFYICONDATA nid = {
            sizeof(NOTIFYICONDATA), // cbSize
            _hparent,               // hWnd
            _id,                    // uID
        };

        Shell_NotifyIcon(NIM_DELETE, &nid);
    }
void TrayIcon::Set ( DWORD  dwMessage,
UINT  id,
HICON  hIcon,
LPCTSTR  tooltip = NULL 
) [inline, protected]

Definition at line 1019 of file window.h.

References COUNTOF, and PM_TRAYICON.

    {
        NOTIFYICONDATA nid = {
            sizeof(NOTIFYICONDATA), // cbSize
            _hparent,               // hWnd
            id,                     // uID
            NIF_MESSAGE|NIF_ICON,   // uFlags
            PM_TRAYICON,            // uCallbackMessage
            hIcon                   // hIcon
        };

        if (tooltip)
            lstrcpyn(nid.szTip, tooltip, COUNTOF(nid.szTip));

        if (nid.szTip[0])
            nid.uFlags |= NIF_TIP;

        Shell_NotifyIcon(dwMessage, &nid);
    }

Member Data Documentation

HWND TrayIcon::_hparent [protected]

Definition at line 1016 of file window.h.

UINT TrayIcon::_id [protected]

Definition at line 1017 of file window.h.


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

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage