source: trunk/include/winres.h@ 575

Last change on this file since 575 was 575, checked in by sandervl, 26 years ago

PE Resource changes + icon cleanup

File size: 3.6 KB
Line 
1/* $Id: winres.h,v 1.4 1999-08-19 12:52:49 sandervl Exp $ */
2
3/*
4 * Win32 resource class
5 *
6 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
7 *
8 *
9 * Project Odin Software License can be found in LICENSE.TXT
10 *
11 */
12#ifndef __WINRES_H__
13#define __WINRES_H__
14
15#ifdef INCL_WINRES
16
17 typedef struct tagWINBITMAPINFOHEADER{
18 DWORD biSize;
19 LONG biWidth;
20 LONG biHeight;
21 WORD biPlanes;
22 WORD biBitCount;
23 DWORD biCompression;
24 DWORD biSizeImage;
25 LONG biXPelsPerMeter;
26 LONG biYPelsPerMeter;
27 DWORD biClrUsed;
28 DWORD biClrImportant;
29 } WINBITMAPINFOHEADER;
30
31 typedef struct
32 {
33 BYTE blue;
34 BYTE green;
35 BYTE red;
36 BYTE res;
37 } RGBQUAD;
38
39 /*
40 * Defines for the fVirt field of the Accelerator table structure.
41 */
42 #define FVIRTKEY TRUE /* Assumed to be == TRUE */
43 #define FNOINVERT 0x02
44 #define FSHIFT 0x04
45 #define FCONTROL 0x08
46 #define FALT 0x10
47
48 //TODO: Aligned at 8 byte boundary or not??
49 #pragma pack(1)
50 typedef struct tagWINACCEL {
51 BYTE fVirt; /* Also called the flags field */
52 WORD key;
53 WORD cmd;
54 BYTE align[3];
55 } WINACCEL, *LPWINACCEL;
56 #pragma pack()
57
58#endif
59
60#ifdef __cplusplus
61class Win32Image;
62
63//Use to distinguish between converted OS/2 resources in an image (pe2lx'ed) or
64//resources that are loaded from the original win32 image (pe loader)
65#define RSRC_PELOADER 0
66#define RSRC_PE2LX 1
67
68class Win32Resource
69{
70public:
71 // Constructors and destructors
72 Win32Resource(Win32Image *module, HRSRC hRes, ULONG id, ULONG type);
73 Win32Resource(Win32Image *module, ULONG id, ULONG type,
74 ULONG size, char *resdata);
75 virtual ~Win32Resource();
76
77 virtual PVOID lockResource(); //get original win32 resource
78 virtual PVOID lockOS2Resource(); //get converted OS/2 resource
79
80 ULONG sizeofResource() { return ressize; };
81
82 ULONG getOS2Handle() { return OS2ResHandle; };
83 void setOS2Handle(ULONG handle) { OS2ResHandle = handle; };
84
85 static void destroyAll(Win32Image *module);
86
87protected:
88
89private:
90 PVOID ConvertBitmap(void *bmpdata);
91
92 Win32Image *module;
93
94 HRSRC hres;
95 ULONG type;
96 ULONG orgos2type;
97 ULONG id;
98
99 PVOID os2resdata;
100 PVOID winresdata;
101
102 ULONG OS2ResHandle;
103
104 ULONG ressize;
105 int resType;
106
107 // Linked list management
108 Win32Resource* next; // Next Resource in module
109
110 friend class Win32Image;
111};
112
113#endif // __cplusplus
114
115 #define NTRT_NEWRESOURCE 0x2000
116 #define NTRT_ERROR 0x7fff
117 #define NTRT_CURSOR 1
118 #define NTRT_BITMAP 2
119 #define NTRT_ICON 3
120 #define NTRT_MENU 4
121 #define NTRT_DIALOG 5
122 #define NTRT_STRING 6
123 #define NTRT_FONTDIR 7
124 #define NTRT_FONT 8
125 #define NTRT_ACCELERATORS 9
126 #define NTRT_RCDATA 10
127 #define NTRT_MESSAGETABLE 11
128 #define NTRT_GROUP_CURSOR 12
129 #define NTRT_GROUP_ICON 14
130 #define NTRT_VERSION 16
131 #define NTRT_NEWBITMAP (NTRT_BITMAP|NTRT_NEWRESOURCE)
132 #define NTRT_NEWMENU (NTRT_MENU|NTRT_NEWRESOURCE)
133 #define NTRT_NEWDIALOG (NTRT_DIALOG|NTRT_NEWRESOURCE)
134
135
136#endif
Note: See TracBrowser for help on using the repository browser.