Take the 2-minute tour ×

I want to make a program using Delphi, to watch and wait windows vista calendar displays (the two windows that appear bottom right of the screen when you hold or click the mouse on the time in systray), and when they appeared change their contents to make my own calendar (Persian calendar). Is there any way to change the contents of calendar control (SysMonthCal32) with windows messages?

Sample: enter image description here

share|improve this question
Depends on what exactly do you mean with change the contents. You can use macros and messages, however I haven't tested if they works for the system caledar control. –  TLama Aug 20 '12 at 11:20
Depend on how far you want to change, you may need to inject a DLL into the Explorer process or subclass the SysMonthCal32 class entirely. Or use a Windows Hook API. –  Jay Aug 20 '12 at 11:21
Er, don't do this. The clock/calendar app belongs to the system. –  David Heffernan Aug 20 '12 at 11:28
@TLama you'd need to run the code in the same process that owns the calendar window –  David Heffernan Aug 20 '12 at 11:29
I don't want to change all system date or all calendar controls on windows, I just want to add a button to switch calender type just on that window between Persian and Gregorian. For example if there where labels for days in calender control I want to enumerate them and change their text temporarily. –  Vahid Aug 20 '12 at 11:47

2 Answers 2

There is an open source Shamsi calendar for windows-xp which is implemented by hooking the system time. you can find it here.

share|improve this answer
Thanks, but I don't want to change system date format, I just want to make something to show Persian calendar to the user with interface like windows standard calender. There are lots of Persian calendars but all are ugly. –  Vahid Aug 22 '12 at 11:22
how about this one? sourceforge.net/projects/solarcalendar –  VahidN Aug 22 '12 at 11:42
Thanks, It looks pretty, but being exactly like windows standard components is more pretty and acceptable. –  Vahid Aug 24 '12 at 6:52
up vote 0 down vote accepted

Finally I did it. The program must watch for creation of calendar window and then place its own calendar on it using SetParent API function.
You can see the result app in http://www.dihav.com/pghcal/.

share|improve this answer

Your Answer


