My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
ResFileRoutines  
Resource File Helper Routines.
Updated May 8, 2011 by delphidabbler

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

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

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

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.

Sign in to add a comment
Powered by Google Project Hosting