SHLoadIndirectString Function

Extracts the string from the specified resource when given an indirect string (a string beginning with the @ symbol). All other strings copy to the output buffer unaltered.

Syntax

HRESULT SHLoadIndirectString(      
    LPCWSTR pszSource,     LPWSTR pszOutBuf,     UINT cchOutBuf,     void **ppvReserved );

Parameters

pszSource
[in] A pointer to a buffer holding the Unicode input string.
pszOutBuf
[out] The address of the buffer to hold the Unicode output string. You can give pszOutBuf the same value as pszSource.
cchOutBuf
[in] The size of the buffer to hold the output string, in characters.
ppvReserved
Reserved. Must be set to NULL.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

If the string is an indirect string, it is in the following form.
@filename,resource

The string is extracted from the file named, using the resource value as a locator. If the resource value is zero or greater, the number becomes the index of the string in the binary file. If the number is negative, it becomes a resource ID. The retrieved string is copied to the output buffer and the function returns S_OK.

An indirect string can be appended with a version modifier, as shown here:

@filename,resource;v2

This form can be used when a string is changed but still uses the same index or resource ID as the old string. Without a version modifier, the Multilingual User Interface (MUI) cache would not recognize that the string had changed and would continue to use the old value. By appending the version modifier, the value is seen as a new resource and is added to the cache. Note that it is recommended that you use a new resource ID or index for a new string, and use a version modifier only when that is not possible.

If the string is not an indirect string, then the string itself is copied to pszOutBuf and the function returns S_OK.

Function Information

Minimum DLL VersionShlwapi.dll version 5.5 or later
Custom ImplementationNo
HeaderShlwapi.h
Import libraryShlwapi.lib
Minimum operating systems Windows XP
Tags :


Page view tracker