Resource (software)

from Wikipedia, the free encyclopedia

The resources (Engl. Resource ) of a software are the files that are not the sequence ( algorithm save set) of the program, but the "background knowledge" for the course. Resources are, for example, dictionary files in translation programs or lists of names and properties of individual characters in computer games . The best known example of a resource is z. B. the program icon displayed in the start menu or on the desktop .

While the actual computer program is written in a programming language, resources are mostly simple graphics, text files or tables . The advantage is that they can be expanded or changed even by people without programming knowledge. For example, linguists, as specialists, can work on a dictionary as a resource for a translation program without having to know much about the actual program.

Microsoft Windows

Identification of a resource

Within a program, resources are uniquely identified using a combination of type, identifier and language (see Locale ). These are 16-bit numbers, where the type and identifier can also be a string. For the type, the numbers 1 to 24 stand for standard types:

  1. Cursor entry (in a very specific resolution and color depth)
  2. bitmap
  3. Icon entry (in a very specific resolution and color depth)
  4. Menu (entries in a menu bar or a context menu)
  5. Dialog (draft of a window )
  6. Strings (localizable texts, 16 pieces per resource)
  7. Fonts folder
  8. Font ( font style )
  9. Hotkeys
  10. RC data (any data)
  11. Message table
  12. Cursor group (list with references to cursor entries)
  13. not used
  14. Icon group (list with links to icon entries)
  15. not used
  16. Version info (metadata with program name, manufacturer, copyright, version, etc., is displayed e.g. in the properties of the program file)
  17. Dialog integration (e.g. toolbars )
  18. not used
  19. Plug & Play
  20. VxD
  21. Animated cursor
  22. Animated icon
  23. HTML
  24. Manifest (metadata for theming and user account control )

Programs make use of the possibilities to varying degrees, since the data can also be stored in external files or in the source code. If a program file is to have an icon, however, it must contain the icon in resources (the lexicographically first icon group resource is used). The program or company name contained in the version info resource is often displayed in security software. These two types are therefore included in almost every PE file .

Resource code

Resource code is used as a scripting language in the development of programs under OS / 2 and Windows to define elements of the graphical user interface and text constants. This enables a separation between the program code and the user interface to be achieved.

Rc file

A resource script file contains one or more resource statements , each specifying the type, identifier and data value. It is a normal text file with the extension .rc, whereby additional files can be included.

example
MENU 1
BEGIN
  MENUITEM "Menüpunkt 1", 101
  MENUITEM "Menüpunkt 2", 102
END

In this case a menu (type 4) with the identifier 1 is saved with two menu entries.

Resource compiler

The resource compiler translates resource files (.rc) into binary resource files (.res). Depending on whether you want to add PE (32 or 64 bit) or NE files (16 bit) in the next step , .res files have a slightly different file format.

Web links and sources

Mac OS

See ResEdit .