group file format

.grp group file format overview (3.1)

this topic describes the format of group files used by the microsoft windows operating system. a group file contains data that microsoft windows program manager (progman.exe) uses to display the icons of the applications in a group, start the applications in a group, and open related documents.

organization of a group file

the first element in a group file is the group-file header. the data in the group-file header includes an identifier, a count of bytes, a count of items in the file, and information that the system uses to display group icons. the group-file header is followed by one or more entries that contain item data describing the icon of an application. these entries include the coordinates that the system uses to display the icon; the count of bytes in the header, and mask, and xor mask for the icon; and the offset to the header, and mask, and xor mask for the icon.
the item data entries are followed by entries that contain the color data for the application icons. for more information about these entries, see graphics device interface overview. for windows version 3.1, the icon data is followed by tag data. the tag data contains information that program manager uses when it displays the program item properties dialog box. this data identifies the directory in which the application is stored and the shortcut key (if one exists). it also specifies the state of the run minimized box.

group-file structures

this topic uses c structures to depict the organization of data within a group file. these structures were created solely to show the organization of data in a resource; they do not appear in any of the include files shipped with the microsoft windows 3.1 software development kit (sdk).

group-file header

the group-file header contains general information about the group file. the groupheader structure has the following form:



struct taggroupheader {
char cidentifier[4];
word wchecksum;
word cbgroup;
word ncmdshow;
rect rcnormal;
point ptmin;
word pname;
word wlogpixelsx;
word wlogpixelsy;
word wbitsperpixel;
word wplanes;
word citems;
word rgiitems[citems];
};

following are the members in the groupheader structure:

cidentifier    identifies an array of 4 characters. if the file is a valid group file, this array must contain the string "pmcc".

wchecksum     specifies the negative sum of all words in the file (including the value specified by the wchecksum member).

cbgroup    specifies the size of the group file, in bytes.

ncmdshow    specifies whether program manager should display the group in minimized, normal, or maximized form.

this member can be one of the following values:

value    flag

0x00    sw_hide
0x01    sw_shownormal
0x02    sw_showminimized
0x03    sw_showmaximized
0x04    sw_shownoactivate
0x05    sw_show
0x06    sw_minimize
0x07    sw_showminnoactivate
0x08    sw_showna
0x09    sw_restore

rcnormal    specifies the coordinates of the group window (the window in which the group icons appear). it is a rectangular structure.

ptmin    specifies the coordinate of the lower-left corner of the group window with respect to the parent window. it is a point structure.

pname    specifies an offset from the beginning of the file to a null-terminated string that specifies the group name.

wlogpixelsx    specifies the horizontal resolution of the display for which the group icons were created.

wlogpixelsy    specifies the vertical resolution of the display for which the group icons were created.

wbitsperpixel    specifies the format of the icon bitmaps, in bits per pixel.

wplanes    specifies the count of planes in the icon bitmaps.

citems    specifies the number of itemdata structures in the rgiitems array. this is not necessarily the number of items in the group, because there may be null entries in the rgiitems array.

rgiitems[citems]    specifies an array of itemdata structures.

item data

the item data contains information about a particular application and its icon. the itemdata structure has the following form:



struct tagitemdata {
point pt;
word iicon;
word cbresource;
word cbandplane;
word cbxorplane;
word pheader;
word pandplane;
word pxorplane;
word pname;
word pcommand;
word piconpath;
};

following are the members in the itemdata structure:

pt    specifies the coordinates for the lower-left corner of an icon in the group window. it is a point structure.

iicon    specifies the index value for an icon. this value indicates the position of the icon in an executable file.

cbresource    specifies the count of bytes in the icon resource, which appears in the executable file for the application.

cbandplane    specifies the count of bytes in the and mask for the icon.

cbxorplane    specifies the count of bytes in the xor mask for the icon.

pheader    specifies an offset from the beginning of the group file to the resource header for the icon.

pandplane    specifies an offset from the beginning of the group file to the and mask for the icon.

pxorplane    specifies an offset from the beginning of the group file to the xor mask for the icon.

pname    specifies an offset from the beginning of the group file to a string that specifies the item name.

pcommand    specifies an offset from the beginning of the group file to a string that specifies the name of the executable file containing the application and the icon resource(s).

piconpath    specifies an offset from the beginning of the group file to a string that specifies the path where the executable file is located. this path can be used to extract icon data from an executable file.

tag data

the tag data contains general information used to display the program item properties dialog box. the tagdata structure has the following form:



struct tagtagdata{
word wid;
word witem;
word cb;
byte rgb[1];
};

following are the members in the tagdata structure:

wid    specifies the type of tag data. this member can have one of the following values:

value    meaning

0x8101    array at which the rgb member points is a null-terminated string that identifies the path for the application.

0x8102    array at which the rgb member points is a 16-bit word value that identifies the shortcut key specified by the user.

0x8103    minimized version of the item is displayed. if this value is specified, the array to which the rgb member points is not present in the structure and the value of the cb member is 0x06.

witem    specifies the index to the item the tag data refers to. if the data is not specific to a particular item, this value is 0xffff.

cb    specifies the size of the tagdata structure, in bytes.

rgb    specifies an array of byte values. the length of this array can be found by subtracting 6 from the value of the cb member.