IconDefs.h (2505B)
1 // Copyright (c) Microsoft Corporation. 2 // Licensed under the MIT License. 3 4 #pragma once 5 6 // Icon file structure and definitions: 7 // https://msdn.microsoft.com/en-us/library/ms997538.aspx 8 9 // .ico icon structures 10 11 // Icon entry struct 12 typedef struct 13 { 14 BYTE bWidth; // Width, in pixels, of the image 15 BYTE bHeight; // Height, in pixels, of the image 16 BYTE bColorCount; // Number of colors in image (0 if >=8bpp) 17 BYTE bReserved; // Reserved ( must be 0) 18 WORD wPlanes; // Color Planes 19 WORD wBitCount; // Bits per pixel 20 DWORD dwBytesInRes; // How many bytes in this resource? 21 DWORD dwImageOffset; // Where in the file is this image? 22 } ICONDIRENTRY, *LPICONDIRENTRY; 23 24 25 // Icon directory struct 26 typedef struct 27 { 28 WORD idReserved; // Reserved (must be 0) 29 WORD idType; // Resource Type (1 for icons) 30 WORD idCount; // How many images? 31 ICONDIRENTRY idEntries[1]; // An entry for each image (idCount of 'em) 32 } ICONDIR, *LPICONDIR; 33 34 35 // Image struct 36 typedef struct 37 { 38 BITMAPINFOHEADER icHeader; // DIB header 39 RGBQUAD icColors[1]; // Color table 40 BYTE icXOR[1]; // DIB bits for XOR mask 41 BYTE icAND[1]; // DIB bits for AND mask 42 } ICONIMAGE, * LPICONIMAGE; 43 44 45 // .exe and .dll icon structures 46 47 // #pragmas are used here to insure that the structure's 48 // packing in memory matches the packing of the EXE or DLL. 49 #pragma pack( push ) 50 #pragma pack( 2 ) 51 52 typedef struct 53 { 54 BYTE bWidth; // Width, in pixels, of the image 55 BYTE bHeight; // Height, in pixels, of the image 56 BYTE bColorCount; // Number of colors in image (0 if >=8bpp) 57 BYTE bReserved; // Reserved 58 WORD wPlanes; // Color Planes 59 WORD wBitCount; // Bits per pixel 60 DWORD dwBytesInRes; // how many bytes in this resource? 61 WORD nID; // the ID 62 } GRPICONDIRENTRY, *LPGRPICONDIRENTRY; 63 64 65 typedef struct 66 { 67 WORD idReserved; // Reserved (must be 0) 68 WORD idType; // Resource type (1 for icons) 69 WORD idCount; // How many images? 70 GRPICONDIRENTRY idEntries[1]; // The entries for each image 71 } GRPICONDIR, *LPGRPICONDIR; 72 73 #pragma pack( pop )