TTrayIcon
Back Home Up Next

 

Header File
    <owl/trayicon.h>

This is a conglomeration of ideas from the MSG "Webster" application, sniffing round the online docs, and from other implementations such as PJ Daughter's "CTrayIconifyIcon" (http://indigo.i.e./~pjn/tray.html) especially the "CTrayIcon::OnTrayNotification" member function. This class is a light wrapper around the windows system tray stuff. It adds an icon to the system tray with the specified ToolTip text and callback notification value, which is sent back to the Parent window.

get example trayicon.zip

Description
   

Constructors

TTrayIcon::TTrayIcon
   Form 1
        TTrayIcon(TModule* module=gModule);
    Form 2
        TTrayIcon(TWindow* parent, uint msg, owl_string& tip, TIcon& icon, uint id, TModule* module=gModule);
   Form 3
        TTrayIcon(TWindow* parent, uint msg, owl_string& tip, TResId icon, uint id, TModule* module=gModule);

Description
    Creates a TTrayIcon object.

Public Member Functions


Init
    Syntax
        virtual void Init(TWindow* parent, uint msg, owl_string& tip, TIcon* icon=0, uint id=0);
    Description
        Initialized tray icon object.

bool Enabled() const;
bool Visible() const;
bool Create();
//Change or retrieve the Tooltip text
bool                 SetText(const owl_string& text);
bool                 SetText(TResId resId);
owl_string GetText() const;
//Change or retrieve the window to send notification messages to
bool         SetParent(TWindow* wnd);
TWindow*     GetParent() const;
//Change or retrieve the icon displayed
bool     SetIcon(TIcon& icon, TAutoDelete = NoAutoDelete);
bool     SetIcon(TResId resId);
TIcon* GetIcon() const;
void HideIcon();
void ShowIcon();
void RemoveIcon();
void MoveToRight();
//Default handler for tray notification message
TResult EvTrayNotification(TParam1 param1, TParam2 param2);


Copyright © 1998-2001 Yura Bidus. All rights reserved.