home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / pcmag / vol12n01.zip / GROUP.ZIP / GROUPTYP.PAS < prev    next >
Pascal/Delphi Source File  |  1992-09-25  |  7KB  |  161 lines

  1. UNIT GroupType;
  2. (**) INTERFACE (**)
  3. USES WinTypes;
  4. (*NOTE: In the data structures that follow, I've marked important
  5.   fields with the symbol {!}. *)
  6. TYPE
  7.   rgiItemType = ARRAY[0..49] OF Word; {max 50 items per group}
  8.  
  9.   PGroupHeader = ^TGroupHeader;
  10.   TGroupHeader = RECORD
  11. {!} cIdentifier   : ARRAY[0..3] OF Char; {must be 'PMCC'}
  12. {!} wCheckSum     : Word;    {adjusted to make the sum of all the
  13.                               words in the group file be 0}
  14. {!} cbGroup       : Word;    {size of the group file, in bytes, NOT
  15.                               including the tag data.}
  16. {!} nCmdShow      : Word;    {flag that tells how ProgMan displays
  17.                               the group; see SW_xxxx constants for
  18.                               the ShowWindow API function}
  19. {!} rcNormal      : TRect;   {the coordinates used by the group
  20.                               window when neither min nor max}
  21. {!} ptMin         : TPoint;  {the coordinates for the lower-left
  22.                               corner of the group window in ProgMan}
  23. {!} pName         : Word;    {offset from the beginning of the file
  24.                               to the group's name string}
  25.     wLogPixelsX   : Word;    {horizontal resolution of device for
  26.                               which the group icons were created}
  27.     wLogPixelsY   : Word;    {vertical resolution of device for
  28.                               which the group icons were created}
  29.       {NOTE: Next two items erroneously listed as WORD in SDK}
  30.     wBitsPerPixel : Byte;    {bits per pixel of icon bitmaps}
  31.     wPlanes       : Byte;    {count of bitplanes in icon bitmaps}
  32.       {NOTE: Next item omitted from structure in SDK}
  33.     wReserved     : Word;    {reserved - should be 0}
  34. {!} cItems        : Word;    {number of TItemData structures in the
  35.                               rgiItems array}
  36. {!} rgiItems      : rgiItemType;  {an array of offsets to TItemData
  37.                               structures in the group file.  NOTE:
  38.                               SDK says this is an array of ItemData
  39.                               structures - it is incorrect}
  40.   END;
  41.  
  42.   (* Equivalent structure in C
  43.      struct tagGROUPHEADER {
  44.          char  cIdentifier[4|;
  45.          WORD  wCheckSum;
  46.          WORD  cbGroup;
  47.          WORD  nCmdShow;
  48.          RECT  rcNormal;
  49.          POINT ptMin;
  50.          WORD  pName;
  51.          WORD  wLogPixelsX;
  52.          WORD  wLogPixelsY;
  53.          BYTE  bBitsPerPixel;
  54.          BYTE  bPlanes;
  55.          WORD  wReserved;  // Should be 0x0000
  56.          WORD  cItems;
  57.          WORD  rgiItems[cItems|;
  58.      }*)
  59.  
  60.   PItemData = ^TItemData;
  61.   TItemData = RECORD
  62. {!} pt         : TPoint; {the coordinates for the lower-left
  63.                           corner of an icon in the group window.}
  64.     iIcon      : Word;   {the index value for the icon, i.e the
  65.                           the position of the icon in its file
  66.                           (see pIconPath)}
  67.     cbHeader   : Word;   {the count of bytes in the icon resource
  68.                           cbResource}
  69.     cbANDPlane : Word;   {the count of bytes in the icon's AND mask}
  70.     cbXORPlane : Word;   {the count of bytes in the icon's XOR mask}
  71.     pHeader    : Word;   {offset from the beginning of the group
  72.                           file to the icon's resource header (see
  73.                           TIconResourceHeader)}
  74.     pANDPlane  : Word;   {offset from the beginning of the group
  75.                           file to the icon's AND mask}
  76.     pXORPlane  : Word;   {offset from the beginning of the group
  77.                           file to the icon's XOR mask}
  78. {!} pName      : Word;   {offset from the beginning of the group
  79.                           file to the item name string}
  80. {!} pCommand   : Word;   {offset from the beginning of the group
  81.                           file to the command line string}
  82.     pIconPath  : Word;   {offset from the beginning of the group
  83.                           file to the name of the file containing
  84.                           the icon for this item}
  85.   END;
  86.  
  87.   (* Equivalent structure in C:
  88.      struct tagITEMDATA {
  89.          POINT pt;
  90.          WORD  iIcon;
  91.          WORD  cbHeader;
  92.          WORD  cbANDPlane;
  93.          WORD  cbXORPlane;
  94.          WORD  pHeader;
  95.          WORD  pANDPlane;
  96.          WORD  pXORPlane;
  97.          WORD  pName;
  98.          WORD  pCommand;
  99.          WORD  pIconPath;
  100.      }*)
  101.  
  102.   PIconResourceHeader = ^TIconResourceHeader;
  103.   TIconResourceHeader = RECORD
  104.     xHotSpot   : Integer; {Should be 0}
  105.     yHotSpot   : Integer; {Should be 0}
  106.     cx         : Integer; {Icon width}
  107.     cy         : Integer; {Icon height}
  108.     cbWidth    : Integer; {Bytes per row accounting for WORD alignment}
  109.     bPlanes    : Byte;    {Count of planes}
  110.     bBitsPixel : Byte;    {Bits per pixel}
  111.   END;
  112.  
  113.   (* Equivalent structure in C:
  114.      struct tagICONRESOURCEHEADER{
  115.          int xHotSpot;    // Should be 0
  116.          int yHotSpot;    // Should be 0
  117.          int cx;          // Icon width
  118.          int cy;          // Icon height
  119.          int cbWidth;     // Bytes per row accounting
  120.                           // for WORD alignment
  121.          BYTE bPlanes;    // Count of planes
  122.          BYTE bBitsPixel; // Bits per pixel
  123.        }*)
  124.  
  125.   PTagData = ^TTagData;
  126.   TTagData = RECORD
  127.     wID   : Word; {identifies type of tag data.  Possible values:
  128.        Value  Meaning
  129.        8000h  the first TTagData structure
  130.        8101h  rgbString is the item's path as an ASCIIZ string.
  131.               NOTE: Changing "Working Directory" in the Properties
  132.               dialog changes the *command* for the item; the
  133.               TTagData shows the actual location of the app.
  134.        8102h  rgbShortcut identifies the hotkey for the item.
  135.               Its high byte is a combination of any two of:
  136.                 2 = Ctrl
  137.                 1 = Shift
  138.                 4 = Alt
  139.               Its low byte is the ASCII code of the key.
  140.        8103h  If present, means the item will run minimized.
  141.               The structure is just 6 bytes in size.
  142.        FFFFh  the last TagData structure; don't rely on cb
  143.               to reflect size, as it is usually 0
  144.     }
  145.     wItem : Word; {number of item corresponding to this tag}
  146.     cb    : Word; {size in bytes of the TTagData structure}
  147.     CASE Word OF
  148.       $8101 : (rgbString : ARRAY[0..144] OF Char);
  149.       $8102 : (rgbShortcut : Word); 
  150.       $8103 : (rgbNada : RECORD END);
  151.     END;
  152.     
  153.   (* Equivalent structure in C
  154.      struct tagTAGDATA{
  155.          WORD wID;
  156.          WORD wItem:
  157.          WORD cb;
  158.          BYTE rgb[1];
  159.      }*)
  160. (**) IMPLEMENTATION (**)
  161. END.