Skip to content

Latest commit

 

History

History
66 lines (38 loc) · 1.94 KB

Routines.md

File metadata and controls

66 lines (38 loc) · 1.94 KB

Resource File Helper Routines

Project: Resource File Unit

Unit: PJResFile.

These helper routines are to assist in manipulating resource identifiers. They can be useful when working with Windows API routines as well as the classes provided in this unit. They are:

IsIntResource

Applies to: ~>1.0

function IsIntResource(const ResID: PChar): Boolean;

This is a clone of the IS_INTRESOURCE macro defined on MSDN that checks if a resource identifier is ordinal or a string. Complements the MakeIntResource "macro" defined in Windows.pas.

Parameter:

  • ResID: The resource identifier to be checked. May be either an numeric identifier (like those produced by MakeIntResource, or a name in the form of a null terminated string).

Returns:

  • True if ResID is numeric or False if it is a null terminated string.

IsEqualResID

Applies to: ~>1.0

function IsEqualResID(const R1, R2: PChar): Boolean;

Checks for equality of two resource identifiers. To be equal the identifiers either be ordinal and have the same value or must both point to strings that have the same text when case is ignored.

Parameters:

  • R1: The first resource identifier to check.
  • R2: The second resource identifier to check.

Returns:

  • True if the identifiers are equal and False otherwise.

ResIDToStr

Applies to: ~>1.0

function ResIDToStr(const ResID: PChar): string;

Converts a resource identifier into its string representation as defined on MSDN.

Parameter:

  • ResID: The resource identifier to convert.

Returns:

  • The required string representation. If the identifier is a string pointer then the string itself is returned. If the identifier is ordinal then the returned string is the integer value preceded by a # character.