LoadString

  int LoadString(hinst, wID, lpBuffer, cchBuffer)    
  HANDLE hinst; /* handle of module containing string resource */
  UINT wID; /* resource identifier */
  LPTSTR lpBuffer; /* address of buffer for resource */
  int cchBuffer; /* size of buffer in characters */

The LoadString function loads a string resource identified by the wID parameter from the executable file associated with the module specified by the hinst parameter. The function copies the string into the buffer pointed to by the lpBuffer parameter, and appends a terminating null character.

Parameters

hinst

Identifies an instance of the module whose executable file contains the string resource.

wID

Specifies the integer identifier of the string to be loaded.

lpBuffer

Points to the buffer that receives the string.

cchBuffer

Specifies the size of the buffer in characters. The string is truncated if it is longer than the number of characters specified.

Return Value

The return value specifies the actual number of characters copied into the buffer, not including the null-terminating character. It is zero if the string resource does not exist.

Comments

The LoadString function may be used as either a wide-character function (where text arguments must use Unicode) or an ANSI function (where text arguments must use characters from the Windows 3.x character set installed).

See Also

LoadIcon, LoadBitmap, LoadCursor, LoadAccelerators, LoadMenu, LoadMenuIndirect, FormatMessage