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

Adding Icons to the System Tray

, 2 Aug 2003
A class for adding icons to the system tray
hatrsystemtray.zip
systemtraysdk_demo.zip
SystemTraySDK_demo
Release
TaskbarDemo.exe
res
icon1.ico
icon2.ico
icon3.ico
icon4.ico
TaskbarDemo.ICO
TaskbarDemo.dsp
TaskbarDemo.dsw
systemtray_demo.zip
systemtray_demo
Release
SystemTrayDemo.exe
RES
Cmdbar.bmp
icon1.ico
icon2.ico
icon3.ico
icon4.ico
SystemTrayDemo.ico
SystemTrayDemoDoc.ico
Toolbar.bmp
SystemTrayDemo.dsp
SystemTrayDemo.dsw
SystemTrayDemoCE.dsp
SystemTrayDemoCE.dsw
systemtray_src.zip
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS
#include "resource.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_TASKBARDEMO         ICON    DISCARDABLE     "res\\TaskbarDemo.ICO"
IDI_ICON4               ICON    DISCARDABLE     "res\\icon4.ico"
IDI_ICON3               ICON    DISCARDABLE     "res\\icon3.ico"
IDI_ICON2               ICON    DISCARDABLE     "res\\icon2.ico"
IDI_ICON1               ICON    DISCARDABLE     "res\\icon1.ico"

/////////////////////////////////////////////////////////////////////////////
//
// Menu
//

IDC_TASKBARDEMO MENU DISCARDABLE 
BEGIN
    POPUP "&File"
    BEGIN
        MENUITEM "E&xit",                       IDM_EXIT
    END
    POPUP "&Help"
    BEGIN
        MENUITEM "&About ...",                  IDM_ABOUT
    END
END

IDR_POPUP_MENU MENU DISCARDABLE 
BEGIN
    POPUP "POPUP"
    BEGIN
        MENUITEM "About System Tray...",        IDM_ABOUT
        MENUITEM "Animate icon",                IDM_ANIMATE
        MENUITEM "Exit",                        IDM_EXIT
    END
END


/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//

IDC_TASKBARDEMO ACCELERATORS MOVEABLE PURE 
BEGIN
    "?",            IDM_ABOUT,              ASCII,  ALT
    "/",            IDM_ABOUT,              ASCII,  ALT
END


/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_ABOUTBOX DIALOG DISCARDABLE  22, 17, 230, 75
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "About"
FONT 8, "MS Sans Serif"
BEGIN
    ICON            IDI_TASKBARDEMO,IDC_MYICON,14,9,20,20
    LTEXT           "TaskbarDemo Version 1.0",IDC_STATIC,49,10,119,8,
                    SS_NOPREFIX
    LTEXT           "Copyright (C) 1999",IDC_STATIC,49,20,119,8
    DEFPUSHBUTTON   "OK",IDOK,195,6,30,11,WS_GROUP
END


#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

2 TEXTINCLUDE DISCARDABLE 
BEGIN
    "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
    "#include ""windows.h""\r\n"
    "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
    "#include ""resource.h""\r\n"
    "\0"
END

3 TEXTINCLUDE DISCARDABLE 
BEGIN
    "\r\n"
    "\0"
END

#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// String Table
//

STRINGTABLE DISCARDABLE 
BEGIN
    IDS_APP_TITLE           "TaskbarDemo"
    IDM_ABOUT               "Display program information, version number and copyright\nAbout"
    IDS_HELLO               "System Tray demonstration"
    IDC_TASKBARDEMO         "TASKBARDEMO"
END

STRINGTABLE DISCARDABLE 
BEGIN
    ID_APP_ABOUT            "Display program information, version number and copyright\nAbout"
END

#endif    // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////
// English (Australia) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENA)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_AUS
#pragma code_page(1252)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE DISCARDABLE 
BEGIN
    "resource.h\0"
END

#endif    // APSTUDIO_INVOKED

#endif    // English (Australia) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Chris Maunder
Founder CodeProject
Canada Canada
Chris is the Co-founder, Administrator, Architect, Chief Editor and Shameless Hack who wrote and runs The Code Project. He's been programming since 1988 while pretending to be, in various guises, an astrophysicist, mathematician, physicist, hydrologist, geomorphologist, defence intelligence researcher and then, when all that got a bit rough on the nerves, a web developer. He is a Microsoft Visual C++ MVP both globally and for Canada locally.
 
His programming experience includes C/C++, C#, SQL, MFC, ASP, ASP.NET, and far, far too much FORTRAN. He has worked on PocketPCs, AIX mainframes, Sun workstations, and a CRAY YMP C90 behemoth but finds notebooks take up less desk space.
 
He dodges, he weaves, and he never gets enough sleep. He is kind to small animals.
 
Chris was born and bred in Australia but splits his time between Toronto and Melbourne, depending on the weather. For relaxation he is into road cycling, snowboarding, rock climbing, and storm chasing.
Follow on   Twitter   Google+   LinkedIn

| Advertise | Privacy | Mobile
Web02 | 2.8.140821.2 | Last Updated 3 Aug 2003
Article Copyright 1999 by Chris Maunder
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid