Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Easy Animated Tray Icon

, 4 Feb 2002
This is a class (SS_TrayIcon) that allows for the easy addition of a tray icon into any project (whether you use MFC or not).
ss_trayicon_demo.zip
SS_TrayIcon.dsp
SS_TrayIcon.dsw
SS_TrayIcon.gif
SS_TrayIcon.opt
SS_TrayIcon2.gif
Demo
Debug
res
icon1.ico
icon2.ico
icon3.ico
icon4.ico
icon5.ico
icon6.ico
testMFC.ico
TestSSTrayIcon.dsp
ss_trayicon_src.zip
SS_TrayIcon.gif
SS_TrayIcon.lib
SS_TrayIcon2.gif
SS_TrayIconD.lib
// ----------------------------------------------------------------------- //
//
//  FILENAME:	SS_Wnd.h
//  AUTHOR:		Steve Schaneville
//  CREATED:	22 Jan 2002, 11:26
//
//  PURPOSE:	
//
//  Copyright (c) 2002
//
// ----------------------------------------------------------------------- //
#ifndef __SS_Wnd_h__
#define __SS_Wnd_h__

// ------------------[       Pre-Include Defines       ]------------------ //
// ------------------[          Include Files          ]------------------ //
#include <windows.h>
#include <TCHAR.h>

// ------------------[          Macros/Defines         ]------------------ //
#define SSWND_REGISTERED_NAME (_T("SS_Wnd"))

// ------------------[      Constants/Enumerations     ]------------------ //
// ------------------[       Forward Declarations      ]------------------ //
// ------------------[         Global Variables        ]------------------ //
// ------------------[         Global Functions        ]------------------ //
// ------------------[             Classes             ]------------------ //

// ----------------------------------------------------------------------- //
//  Class:			SS_Wnd
//  Author:			Steve Schaneville
//  Notes:			
// ----------------------------------------------------------------------- //
class SS_Wnd
{
public:

    DECLARE_DYNAMIC(SS_Wnd);
        
    // construction, destruction, assignment, copy, initialization
	SS_Wnd                                          (HINSTANCE hInstance);
	virtual ~SS_Wnd                                 ();

	SS_Wnd					    		            (SS_Wnd& rhs);
	SS_Wnd&			        operator =		        (SS_Wnd& rhs);

protected:

    virtual VOID	        InitObject		        ();

public:

	// accessor functions
    VOID                    Instance                (HINSTANCE hInstance);
    const HINSTANCE         Instance                () const;
    VOID                    WindowHandle            (HWND hWnd);
    const HWND              WindowHandle            () const;

    // utilities
    VOID                    Create                  ();
    virtual LRESULT         WindowProc              (UINT message, 
                                                     WPARAM wParam, 
                                                     LPARAM lParam);
    virtual VOID            OnTimer                 (UINT uMsg,
                                                     UINT_PTR idEvent,
                                                     DWORD dwTime);
    virtual UINT_PTR        SetTimer                (UINT nIDEvent, 
                                                     UINT uElapse,
                                                     TIMERPROC lpTimerProc=NULL);
    virtual BOOL            KillTimer               (UINT nIDEvent);
    
protected:


    
private:

    VOID                    RegisterClass           ();

    static BOOL     m_bClassIsRegistered;
    HINSTANCE       m_hInstance;
    HWND            m_hWnd;

};


// ----------------------------------------------------------------------- //
//  SS_Wnd Inline Functions
// ----------------------------------------------------------------------- //

inline VOID SS_Wnd::Instance(HINSTANCE hInstance)
{ m_hInstance = hInstance; }

inline const HINSTANCE SS_Wnd::Instance() const
{ return m_hInstance; }

inline VOID SS_Wnd::WindowHandle(HWND hWnd)
{ m_hWnd = hWnd; }

inline const HWND SS_Wnd::WindowHandle() const
{ return m_hWnd; }


#endif // __SS_Wnd_h__

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Steve Schaneville
Architect Amedisys
United States United States
No Biography provided

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141223.1 | Last Updated 5 Feb 2002
Article Copyright 2002 by Steve Schaneville
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid