7.4 Cursor-Directory Resource

A cursor-directory resource is nearly identical in format to a cursor directory in a cursor-resource file. The resource specifies the number of cursor images associated with this resource, as well as the dimensions of the images, but it does not include the hot-spot data. Furthermore, the last member of the ICONDIRENTRY structure (dwImageOffset) is replaced with a 16-bit value that specifies the resource-table index of the corresponding cursor-image resource.

In an executable file, the CURSORDIRENTRY structure has the following form:

typedef struct _CURSORDIRENTRY {
    WORD  wWidth;
    WORD  wHeight;
    WORD  wPlanes;
    WORD  wBitCount;
    DWORD lBytesInRes;
    WORD  wImageIndex;
} CURSORDIRENTRY;

Following are the members in the CURSORDIRENTRY structure:

wWidth

Specifies the width of the cursor, in pixels.

wHeight

Specifies the height of the cursor, in pixels.

wPlanes

Specifies the number of color planes in the bitmap. This member must be set to 1.

wBitCount

Specifies the number of color bits per pixel in the bitmap. This member must be set to 1.

lBytesInRes

Specifies the size of the resource, in bytes.

wImageIndex

Specifies the 1-based index identifying the cursor image associated with this cursor-directory resource. If an executable file contains multiple icon resources, the index must be unique across all directories.

Each cursor-directory resource must have a corresponding entry in the resource table of the executable file. This means the resource table must contain a TYPEINFO structure in which the rscTypeID member is set to the RT_GROUP_CURSOR value.