News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Icon Structures (missing?)

Started by diablo2oo2, July 16, 2005, 08:55:22 PM

Previous topic - Next topic

diablo2oo2

i just wonder why the structures of the icon format are missing in the masm package...

see here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/msdn_icons.asp

;---for icons in resources of exe/dll---
GRPICONDIRENTRY struct
bWidth BYTE  ? ; Width, in pixels, of the image
bHeight BYTE  ? ; Height, in pixels, of the image
bColorCount BYTE  ? ; Number of colors in image (0 if >=8bpp)
bReserved BYTE  ? ; Reserved
wPlanes WORD  ? ; Color Planes
wBitCount WORD  ? ; Bits per pixel
dwBytesInRes DWORD ? ; how many bytes in this resource?
nID WORD  ? ; the ID
GRPICONDIRENTRY ends

GRPICONDIR struct
idReserved WORD  ? ; Reserved (must be 0)
idType WORD  ? ; Resource type (1 for icons)
idCount WORD  ? ; How many images?
GRPICONDIR ends

;---for icon files---
ICONDIRENTRY struct
bWidth BYTE  ? ; Width, in pixels, of the image
bHeight BYTE  ? ; Height, in pixels, of the image
bColorCount BYTE  ? ; Number of colors in image (0 if >=8bpp)
bReserved BYTE  ? ; Reserved ( must be 0)
wPlanes WORD  ? ; Color Planes
wBitCount WORD  ? ; Bits per pixel
dwBytesInRes DWORD ? ; How many bytes in this resource?
dwImageOffset DWORD ? ; Where in the file is this image?
ICONDIRENTRY ends

ICONDIR struct
idReserved WORD  ? ; Reserved (must be 0)
idType WORD  ? ; Resource Type (1 for icons)
idCount WORD  ? ; How many images?
ICONDIR ends

;---icon DIB header---
ICONIMAGE struct
icHeader BITMAPINFOHEADER <> ; DIB header
icColors RGBQUAD <> ; Color table
icXOR BYTE  ? ; DIB bits for XOR mask
icAND BYTE  ? ; DIB bits for AND mask
ICONIMAGE ends

hutch--

diablo2oo2,

Thanks for the structure info, what version of Windows were they introduced in and which include file are they out of ?
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

diablo2oo2

i found this info here: http://www.old.masmforum.com/viewtopic.php?t=787&highlight=icondirentry

so i am not the first one who miss this structures. the document from the microsoft page is created in September 29, 1995, i guess its for all windows versions.

btw, i am not sure if i translated the last structure info "ICONIMAGE" correctly.

hutch--

I have read the article and searched the MSDN lists ands the win2k include files and it appears they are specific to the code written by the author of the article. They do not appear to be standard win32 structures.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

diablo2oo2

i have writtem some code to update the icon(s) of an exe/dll. this code also works with multiple icons (different formats) which can are included in an *.ico file. if somebody is interested, pm me.

my next aim is to code a resourceupdater which works with *.res files. i know this it offtopice here, but if somebody has some info about this, i would be thankfull.

PBrennick

The GeneSys Project is available from:
The Repository or My crappy website

Ghirai

Quote from: diablo2oo2 on July 17, 2005, 12:16:09 PM
i know this it offtopice here

Speaking of which, i like dUP a lot, good job  :U
MASM32 Project/RadASM mirror - http://ghirai.com/hutch/mmi.html