Click here to Skip to main content
Click here to Skip to main content

Tray Calendar

, 2 Aug 2003
Rate this:
Please Sign up or sign in to vote.
A simple application that places a date in the system tray

Sample Image - traycalendar.gif

Introduction

Tray Calendar is a freeware utility that I wrote after being amazed that

  1. Microsoft did not bother to offer us a calender in the tray, and
  2. People were charging good money for tiny little tray apps.

The idea is simple: Put the day of the month next to the clock in the system tray. It tells you todays date, and will update the number displayed when the date changes. 20 seconds after it starts it will reshuffle itself so that it is the right-most icon in the tray. This is useful if you put it in the "Startup" folder (so it starts automatically) becuase during startup other icons such as virus checkers and such may get between the calender and the clock.

The only options are that you can disable date checking, disable auto-shuffle, and you can change the auto-shuffle time. Right click on the date icon for the options dialog.

The class is based on my CSystemTray class, and serves as a fairly quick and dirty example of how to use it.

Tray Calendar now works in CE 2.0-2.11 and VC++ .NET

History

  • 6 Apr 2002 - app now checks the date when the computer comes out of hibernation or suspension (Thanks to Derek Waters)
  • 3 Aug 2003 - Updated SystemTray class now recreates thetray icon after Explorer crashes and restarts.

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

Comments and Discussions

 
GeneralExcuse~ Why can't I download the source code ? Thanks~ Pinmemberanmytry5-Jan-08 15:32 
GeneralMake it use 'long date' format as defined in Regional and Language Options [modified] Pinmemberahtiger22-Nov-07 23:58 
GeneralHelp Required PinmemberSreekanth Muralidharan20-Dec-05 1:49 
GeneralRe: Help Required Pinmembermike.sun11-Oct-06 23:12 
Generalthankx for bug fix Pinmembervikas amin24-Aug-05 4:41 
GeneralLocal days and months names... PinmemberTomas Jakl8-Jul-05 4:50 
Your articles are always great Blush | :O )
 
I've got small feature for your application. I found it in MSDN and applied to your code.
 
So this is in method CMain::OnCreate.
 
Instead of:
 
#ifndef _WIN32_WCE // No tooltips in CE
CTime theTime = CTime::GetCurrentTime();
CString strTime = theTime.Format(_T("%#x"));
#else
CString strTime = _T("");
#endif
 
I filled:
 
#ifndef _WIN32_WCE // No tooltips in CE
CTime theTime = CTime::GetCurrentTime();
// Print out the day of the week using localized day name
UINT DayOfWeek[] =
{
LOCALE_SDAYNAME7, // Sunday
LOCALE_SDAYNAME1,
LOCALE_SDAYNAME2,
LOCALE_SDAYNAME3,
LOCALE_SDAYNAME4,
LOCALE_SDAYNAME5,
LOCALE_SDAYNAME6 // Saturday
};
 
TCHAR strWeekday[256];
::GetLocaleInfo(LOCALE_USER_DEFAULT, // Get string for day of the week from system
DayOfWeek[theTime.GetDayOfWeek()-1], // Get day of week from CTime
strWeekday, sizeof(strWeekday));
 
UINT Month[] =
{
LOCALE_SMONTHNAME1,
LOCALE_SMONTHNAME2,
LOCALE_SMONTHNAME3,
LOCALE_SMONTHNAME4,
LOCALE_SMONTHNAME5,
LOCALE_SMONTHNAME6,
LOCALE_SMONTHNAME7,
LOCALE_SMONTHNAME8,
LOCALE_SMONTHNAME9,
LOCALE_SMONTHNAME10,
LOCALE_SMONTHNAME11,
LOCALE_SMONTHNAME12
};
 
TCHAR strMonth[256];
::GetLocaleInfo(LOCALE_USER_DEFAULT,
Month[theTime.GetMonth()-1],
strMonth,
sizeof(strMonth));
 
CString strTime;
strTime.Format("%s %d.%s %d",
strWeekday,
theTime.GetDay(),
strMonth,
theTime.GetYear());

#else
CString strTime = _T("");
#endif
 
And now it's applicable to any country Blush | :O )
Generalchange version number Pinmembercebusong16-Jul-04 8:49 
QuestionHo to activate the application from the Explirer? PinsussPlamen Petrov27-May-04 3:45 
Answercheck out YahooPOPs source code Pinmembercebusong16-Jul-04 8:06 
GeneralTray Calendar doesn't update PinmemberKimN26-Apr-04 4:38 
GeneralRe: Tray Calendar doesn't update Pinmembercebusong16-Jul-04 8:11 
GeneralShuffle works in reverse PinmemberKimN23-Apr-04 5:35 
GeneralCompilation Fails with Visual C++ v6.0 PinmemberStevenYoungs4-Aug-03 2:17 
GeneralThanks!! PinmemberWREY4-Aug-03 19:30 
QuestionWindows CE 2.11 also? Pinmemberwrenhal13-Jul-03 3:50 
GeneralNO problem with Tray Calendar download... PinmemberJohn H. Doyle2-Mar-03 5:09 
GeneralTray Calendar Download Problem PinmemberJohn H. Doyle2-Mar-03 5:06 
QuestionHow to acees the PRINTER via my eVC++ application PinmemberAKSIVAKUMAR26-Feb-03 21:58 
QuestionHow to send FAX via my eVC++ application PinmemberAKSIVAKUMAR26-Feb-03 21:42 
GeneralAdding to startup PinmemberJack_pt22-Feb-03 3:43 
GeneralRe: Adding to startup PinmemberAKSIVAKUMAR26-Feb-03 21:37 
GeneralMetric Time in tray Pinmemberrehgf23-Jul-02 16:53 
GeneralRe: Metric Time in tray Pinmemberirekz@yahoo.com29-Jan-03 23:13 
GeneralXp Pinmemberswinefeaster14-Apr-02 20:10 
GeneralRe: Xp PinadminChris Maunder14-Apr-02 20:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

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