Quote:
>I would like to use the Windows 3.0/3.1 "Calendar" program to remind my
>user of events they entered in MY VB program.
>Does anyone know the format for ".CAL" files? Or, where I could look it
>up?
>It would be much easier for me to add lines to the ".CAL" file than to
>write my own "reminder" program.
Um, it's not quite as easy as adding lines. It's a binary format:
(I got this from ftp.microsoft.com a while back, I forget where.)
(Beware, it's C data types all the way... :( )
=======================================================================
WINDOWS CALENDAR FILE FORMAT
=======================================================================
This section describes the file format for the Windows Calendar
program supplied with Microsoft Windows version 3.0.
THE HEADER
==========
The first 8 bytes are a character array which identify the file as a
calendar file. This array contains:
'C' + 'r' = b5
'A' + 'a' = a2
'L' + 'd' = b0
'E' + 'n' = b3
'N' + 'e' = b3
'D' + 'l' = b0
'A' + 'a' = a2
'R' + 'c' = b5
The next 2 bytes contain the integer count of dates described in the
file (cDateDescriptors).
The next 12 bytes contain 6 two-byte fields of information that is
global to the entire file. These variables are normally set by the
user through the Alarm Controls and Options Day dialog boxes:
WORD MinEarlyRing; /* early ring in minutes */
BOOL fSound; /* whether alarms should be audible */
int interval; /* interval between appointments:
0 = 15 minutes
1 = 30 minutes
2 = 60 minutes */
int mininterval; /* the interval in minutes */
BOOL f24HourFormat; /* TRUE for 24 hour format,
0 otherwise */
int StartTime; /* starting time in Day Mode, i.e.
the time that normally appears
first in the display, in
minutes past midnight */
The rest of the first 64 bytes are reserved.
THE DATE DESCRIPTORS
====================
The date descriptor array appears next. Each entry in the array
describes one day. cDateDescriptors (described above) is the number of
entries in the array. Each element in the array consists of 12 bytes,
in 6 two byte fields as follows:
unsigned Date; /* the date, in days past 1/1/1980 */
int fMarked; /* bitmask indicating which mark(s)
are set for date:
box = 128
parentheses = 256
circle = 512
cross = 1024
underscore = 2048 */
int cAlarms; /* number of alarms set for the day */
unsigned FileBlockOffset; /* file offset, in 64 byte blocks,
of where the day's information is
stored. Only the low 15 bits are
used (the high bit will be 0).
Thus, if this offset were equal
to 6, the day's information would
be stored at byte 6*64 in the
file. */
int reserved; /* this equals 0xfff */
unsigned reserved; /* this equals 0xfff */
DAY-SPECIFIC INFORMATION
========================
All day information is stored after the Date Descriptor array, on even
64 bytes boundaries. Day information is stored as follows:
unsigned reserved; /* this must equal 0 */
unsigned Date; /* in days past 1/1/1980 */
unsigned reserved; /* this must equal 1 */
unsigned cbNotes; /* the number of bytes of note
information, including the null.
This information appears in the
note array below the appointment
list. */
unsigned cbAppointment; /* count of bytes of appointment
information */
char Notes [cbNotes]; /* the text info of the note */
BYTE ApptInfo []; /* the block of appointments */
APPOINTMENT-SPECIFIC INFORMATION
================================
The information in the appointment block is stored as a list of single
appointments. Each appointment consists of the following fields:
char cBytes; /* the count of bytes in the
appointment, e.g. the next
appointment's info will be at
& (ThisAppt.cBytes) +
ThisAppt.cBytes */
char flags; /* the low bit controls the alarm
(1 = alarm), while bit 1, if set,
indicates that it is a special
time */
int Time; /* in minutes past midnight */
char ApptDesc[]; /* a null-terminated string which
contains the text associated with
an appointment */
--
_________________________________________________________
Robert Woodcock | Note: Your standard disclaimers apply. |
................| it can be quite a curse) - Plucky Duck |