Window Resources

Window resources are read-only data segments stored in an application's EXE file or in a dynamic link library's DLL file. Predefined PM window resources include keyboard accelerator tables, icons, menus, bit maps, dialog boxes, and so forth; these are not a regular part of the application window's code and data. Because, in most cases, window resources are not loaded into memory when the operating system runs a program, the resources can be shared by multiple instances of the same application.

Most window resources are stored in a format that is unique to each resource type. The application does not need to know these formats because the system translates them, as necessary, for use in PM functions. The following table lists the ten most commonly used PM window resource types.

┌───────────────┬─────────────────────────────────────────────┐
│Resource       │Description                                  │
│Identifier     │                                             │
├───────────────┼─────────────────────────────────────────────┤
│RT_ACCELTABLE  │Keyboard accelerator table                   │
├───────────────┼─────────────────────────────────────────────┤
│RT_BITMAP      │Bit map                                      │
├───────────────┼─────────────────────────────────────────────┤
│RT_DIALOG      │Dialog box template                          │
├───────────────┼─────────────────────────────────────────────┤
│RT_FONT        │Font                                         │
├───────────────┼─────────────────────────────────────────────┤
│RT_FONTDIR     │Font directory                               │
├───────────────┼─────────────────────────────────────────────┤
│RT_MENU        │Menu template                                │
├───────────────┼─────────────────────────────────────────────┤
│RT_MESSAGE     │Message string                               │
├───────────────┼─────────────────────────────────────────────┤
│RT_POINTER     │Icon or mouse                                │
├───────────────┼─────────────────────────────────────────────┤
│RT_RCDATA      │Programmer-defined data                      │
├───────────────┼─────────────────────────────────────────────┤
│RT_STRING      │Text string                                  │
└───────────────┴─────────────────────────────────────────────┘

To access these resources, you must prepare a resource file (ASCII file with the extension .RC). Then the ASCII resource file must be compiled into binary images using the resource compiler. The compiled resource file extension is RES; it can be linked into your program's EXE file or to a dynamic link library's DLL file.


[Back: Window Data]
[Next: Maximized and Minimized Windows]