SECTrayIcon Class

class SECTrayIcon: public CObject

Windows 95-style System Tray icon functionality. The SECTrayIcon class provides your application with an easy to use mechanism to add your own custom icons to the system tray, providing neat UI feedback such as tooltip text, context menu support, and animated icons.

Defined in: TrayIcon.h

Comments

The TRAYICON sample in the \SAMPLES\TOOLKIT\STANDARD\UIEXT\TRAYICON directory demonstrates the SECTrayIcon class.

Class Members

Creation/Destruction

virtual void  Create(CWnd* pwnd, UINT nNotifyID, UINT nMsg=WM_SEC_TRAYICON_NOTIFY, HINSTANCE hinst = ::AfxGetResourceHandle())

Create the tray icon.

virtual void  Create(CWnd* pwnd, UINT nMsg=WM_SEC_TRAYICON_NOTIFY, HINSTANCE hinst = ::AfxGetResourceHandle())

Create the tray icon.

virtual void  Destroy()

Destroy the tray icon.

Attributes

virtual void  SetTip(const CString& sTip)

Set the tooltip text.

virtual void  SetIcon(UINT nIconID)

Set the associated tray icon.

virtual void  SetIcon(LPCTSTR szIconID)

Set the associated tray icon.

virtual void  SetIcon(HICON hIcon)

Set the associated tray icon.

virtual void  SetState(SEC_DWORD nState)

Set the current tray icon state.

virtual SEC_DWORD  GetState()

Get the current tray icon state.

virtual void  AddState(SEC_DWORD nState, UINT nIconID, const CString& sTip, UINT nJiffy = 15)

Add a tray icon state.

virtual void  AddState(SEC_DWORD nState, LPCTSTR szIconID, const CString& sTip, UINT nJiffy = 15)

Add a tray icon state.

virtual void  AddState(SEC_DWORD nState, HICON hIcon, const CString& sTip, UINT nJiffy = 15)

Add a tray icon state.

virtual void  RemoveState(SEC_DWORD nState)

Remove a tray icon state.

Operations

virtual void  Show(BOOL bShow = TRUE)

Show/hide the tray icon.

virtual void  Play(SEC_DWORD nBaseState, UINT nStates)

Play an icon animation.

virtual void  Stop()

Stop an icon animation.

BOOL  IsPlaying()

Queries whether animation is in progress.

static void  ShowContextMenu(CWnd* pwnd, UINT nMenuID, UINT nSubMenu = 0)

Show tray icon context menu.

static void  ShowContextMenu(CWnd* pwnd, LPCTSTR szMenuID, UINT nSubMenu = 0)

Show tray icon context menu.

static UINT  GetNextNotifyID()

Get next available id for tray icon notification.

static UINT  GetLatestNotifyID()

Get the latest allocated nofitication id.

UINT  GetNotifyID()

Get the objects' current notification ID.