source: trunk/include/winres.h@ 796

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

Menu resource changes

File size: 2.8 KB
RevLine 
[761]1/* $Id: winres.h,v 1.8 1999-08-31 17:15:53 sandervl Exp $ */
[337]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
15class Win32Image;
16
[575]17//Use to distinguish between converted OS/2 resources in an image (pe2lx'ed) or
18//resources that are loaded from the original win32 image (pe loader)
[754]19#define RSRC_PELOADER 0
20#define RSRC_PE2LX 1
21#define RSRC_CUSTOMNODATA 2 //resources created in runtime without data (i.e. CreateMenu)
22#define RSRC_CUSTOMINDIRECT 3 //resources indirectly created in runtime (i.e. CreateMenuIndirect)
[575]23
[337]24class Win32Resource
25{
26public:
27 // Constructors and destructors
[754]28 Win32Resource(); //custum resource (i.e. created by app in runtime)
[337]29 Win32Resource(Win32Image *module, HRSRC hRes, ULONG id, ULONG type);
30 Win32Resource(Win32Image *module, ULONG id, ULONG type,
31 ULONG size, char *resdata);
[341]32 virtual ~Win32Resource();
[337]33
34 virtual PVOID lockResource(); //get original win32 resource
35 virtual PVOID lockOS2Resource(); //get converted OS/2 resource
36
[589]37 ULONG getSize() { return ressize; };
[337]38
[344]39 ULONG getOS2Handle() { return OS2ResHandle; };
40 void setOS2Handle(ULONG handle) { OS2ResHandle = handle; };
41
[337]42 static void destroyAll(Win32Image *module);
43
44protected:
45
[581]46 PVOID convertOS2Bitmap(void *bmpdata);
[344]47
[581]48 PVOID convertResource(void *win32res);
49
[337]50 Win32Image *module;
51
52 HRSRC hres;
53 ULONG type;
54 ULONG orgos2type;
55 ULONG id;
56
57 PVOID os2resdata;
58 PVOID winresdata;
59
[344]60 ULONG OS2ResHandle;
[337]61
62 ULONG ressize;
[575]63 int resType;
[337]64
[761]65 BOOL isUnicode;
66
[337]67 // Linked list management
[344]68 Win32Resource* next; // Next Resource in module
[337]69
[754]70private:
[337]71 friend class Win32Image;
72};
73
74
75 #define NTRT_NEWRESOURCE 0x2000
76 #define NTRT_ERROR 0x7fff
77 #define NTRT_CURSOR 1
78 #define NTRT_BITMAP 2
79 #define NTRT_ICON 3
80 #define NTRT_MENU 4
81 #define NTRT_DIALOG 5
82 #define NTRT_STRING 6
83 #define NTRT_FONTDIR 7
84 #define NTRT_FONT 8
85 #define NTRT_ACCELERATORS 9
86 #define NTRT_RCDATA 10
87 #define NTRT_MESSAGETABLE 11
88 #define NTRT_GROUP_CURSOR 12
89 #define NTRT_GROUP_ICON 14
90 #define NTRT_VERSION 16
91 #define NTRT_NEWBITMAP (NTRT_BITMAP|NTRT_NEWRESOURCE)
92 #define NTRT_NEWMENU (NTRT_MENU|NTRT_NEWRESOURCE)
93 #define NTRT_NEWDIALOG (NTRT_DIALOG|NTRT_NEWRESOURCE)
94
95
96#endif
Note: See TracBrowser for help on using the repository browser.