home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd1.bin / sharewar / FFE / MISC.SWG / 0010_CALENDAR.pas < prev    next >
Pascal/Delphi Source File  |  1997-02-15  |  5KB  |  130 lines

  1. .CAL Calendar File Format
  2.  
  3. This  topic  describes the binary file  format used by Microsoft Windows
  4. Calendar  (CALENDAR.EXE).  A Calendar  binary  file contains information
  5. about file content, dates, days, and appointments.
  6.  
  7. Calendar-File Header
  8.  
  9. The  first 8 bytes of a Calendar  file are a character array identifying
  10. the file as a Calendar file. Following are the contents of the array:
  11.  
  12.  
  13.  
  14. 'C' + 'r' = b5
  15. 'A' + 'a' = a2
  16. 'L' + 'd' = b0
  17. 'E' + 'n' = b3
  18. 'N' + 'e' = b3
  19. 'D' + 'l' = b0
  20. 'A' + 'a' = a2
  21. 'R' + 'c' = b5
  22.  
  23. The  next 2 bytes (cDateDescriptors) contain  the integer count of dates
  24. described  in  the file. The next 12  bytes contain six 2-byte fields of
  25. information  that  is  global to the  entire  file.  These variables are
  26. normally  set  by  the user through  the  Alarm Controls and Options Day
  27. dialog boxes. The header information has the following form:
  28.  
  29.  
  30.  
  31. WORD    MinEarlyRing
  32. BOOL    fSound
  33. int     interval
  34. int     mininterval
  35. BOOL    f24HourFormat
  36. int     StartTime
  37.  
  38. Following are the members in the header structure:
  39.  
  40. MinEarlyRing    Specifies an early ring, in minutes.
  41. fSound  Specifies whether alarms should be audible.
  42. interval        Specifies the interval between appointments: 0 = 15 minutes, 1 = 30 minutes, 2 = 60 minutes.
  43. mininterval     Specifies the interval, in minutes.
  44. f24HourFormat   Specifies the time format: nonzero=24-hour format.
  45. StartTime       Specifies the starting time in day mode--that is, the time that normally appears first in the display, in minutes
  46. past midnight.
  47.  
  48. The rest of the first 64 bytes are reserved.
  49.  
  50. Date Descriptors
  51.  
  52. A  date-descriptor array appears next. Each entry in the array describes
  53. one  day.  The  number  of  entries  in  the  array  is cDateDescriptors
  54. (described in the preceding section). Each element in the array consists
  55. of  12  bytes, in six 2-byte  fields.  The date-descriptor array has the
  56. following form:
  57.  
  58. unsigned    Date
  59. int         fMarked
  60. int         cAlarms
  61. unsigned    FileBlockOffset
  62. int         reserved
  63. unsigned    reserved
  64.  
  65. Following are the members in the date-descriptor array:
  66.  
  67. Date  Specifies the date, in days past 1/1/1980. fMarked Specifies which
  68. mark(s)  are  set for the date: box  =  128, parentheses = 256, circle =
  69. 512,  cross  = 1024, underscore =  2048. cAlarms Specifies the number of
  70. alarms  set  for the day. FileBlockOffset  Specifies the file offset, in
  71. 64-byte  blocks, to the day's information. Only the low 15 bits are used
  72. (the  high  bit  will  be zero). Thus,  if  this  offset is 6, the day's
  73. information is stored at byte 6*64 in the file.
  74. reserved        Reserved; must be 0xFFF.
  75. reserved        Reserved; must be 0xFFF.
  76.  
  77. Day-Specific Information
  78.  
  79. All  day information is stored after  the date-descriptor array, on even
  80. 64-byte  boundaries.  The  day-information  structure  has the following
  81. form:
  82.  
  83. unsigned    reserved
  84. unsigned    Date
  85. unsigned    reserved
  86. unsigned    cbNotes
  87. unsigned    cbAppointment
  88. char        Notes[cbNotes]
  89. BYTE        ApptInfo[]
  90.  
  91. Following are the members in the day-information structure:
  92.  
  93. reserved        Reserved; must be zero.
  94. Date    Specifies the date, in days past 1/1/1980.
  95. reserved        Reserved; must be 1.
  96. cbNotes Specifies the number of bytes of note information, including null bytes. This information appears in the note
  97. array below the appointment list.
  98. cbAppointment   Specifies the count of bytes of appointment information.
  99. Notes   Contains the text of the note.
  100. ApptInfo        Contains the block of appointments.
  101.  
  102. Appointment-Specific Information
  103.  
  104. The  information in the appointment block is  stored as a list of single
  105. appointments.  Each  appointment consists of  a structure similar to the
  106. following:
  107.  
  108. struct {
  109.     char cb;
  110.     char flags;
  111.     int  time;
  112.     char szApptDesc[];
  113. };
  114.  
  115. Following are the members in each appointment structure:
  116.  
  117. cb      Specifies the size, in bytes, of the structure containing the appointment. The structure address of the next
  118. appointment is the current appointment plus the value of the cb member.
  119. flags   Contains various flags. This member can have one or more of the following values:
  120.  
  121. Value   Meaning
  122.  
  123. 1       Alarm will go off at the specified time of the appointment.
  124. 2       Appointment is a special time.
  125.  
  126. time    Specifies the number of minutes past midnight.
  127. szApptDesc      Contains a null-terminated string consisting of text associated with an appointment.
  128.  
  129.  
  130.