1 // PRIVATE STUFF FOLLOWS UNTIL END
3 // Header signatures for various resources
4 #define BFT_ICON 0x4349 /* 'IC' */
5 #define BFT_BITMAP 0x4d42 /* 'BM' */
6 #define BFT_CURSOR 0x5450 /* 'PT' */
8 // This WIDTHBYTES macro determines the number of BYTES per scan line.
9 #define WIDTHBYTES( i) ((i + 31) / 32 * 4)
10 #define IS_WIN30_DIB( lpbi) ((*(LPDWORD)( lpbi)) == sizeof( BITMAPINFOHEADER))
12 WORD
DIBNumColors(LPSTR pv
);
13 WORD
PaletteSize(LPSTR lpbi
);
16 struct tagCURFILEHEADER
{ WORD wReserved
; // Always 0
17 WORD wResourceType
; // 2 = cursor
18 WORD wResourceCount
; // Number of icons in the file
21 typedef struct tagCURFILEHEADER CURFILEHEADER
;
23 struct tagCURFILERES
{
24 BYTE bWidth
; // Width of image
25 BYTE bHeight
; // Height of image
26 BYTE bColorCount
; // Number of colors in image (2, 8, or 16)
27 BYTE bReserved1
; // Reserved
28 WORD wXHotspot
; // x coordinate of hotspot
29 WORD wYHotspot
; // y coordinate of hotspot
30 DWORD dwDIBSize
; // Size of DIB for this image
31 DWORD dwDIBOffset
; // Offset to DIB for this image
34 typedef struct tagCURFILERES CURFILERES
;
36 HANDLE
ReadCur( LPSTR szFileName
, LPPOINT lpptHotSpot
, int *W
= 0, int *H
= 0);
37 HBITMAP
ColorDDBToMonoDDB( HBITMAP hbm
);
38 HCURSOR
MakeCursor( HANDLE hDIB
, LPPOINT lpptHotSpot
, HINSTANCE hInst
);
40 struct tagICONFILEHEADER
{
41 WORD wReserved
; // Always 0
42 WORD wResourceType
; // 1 = icon
43 WORD wResourceCount
; // Number of icons in the file
46 typedef struct tagICONFILEHEADER ICONFILEHEADER
;
48 struct tagICONFILERES
{
49 BYTE bWidth
; // Width of image
50 BYTE bHeight
; // Height of image
51 BYTE bColorCount
; // Number of colors in image (2, 8, or 16)
52 BYTE bReserved1
; // Reserved
55 DWORD dwDIBSize
; // Size of DIB for this image
56 DWORD dwDIBOffset
; // Offset to DIB for this image
59 typedef struct tagICONFILERES ICONFILERES
;
61 HANDLE
ReadIcon( wxChar
*szFileName
, int *W
= 0, int *H
= 0);
62 HICON
MakeIcon( HANDLE hDIB
, HINSTANCE hInst
);