SHLoadIndirectString function
Applies to: desktop apps only
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( __in PCWSTR pszSource, __out PWSTR pszOutBuf, __in UINT cchOutBuf, __reserved void **ppvReserved );
Parameters
- pszSource [in]
-
Type: PCWSTR
A pointer to a buffer that contains the Unicode input string.
- pszOutBuf [out]
-
Type: PWSTR
A pointer to a buffer that, when this function returns successfully, receives the Unicode output string. You can give pszOutBuf the same value as pszSource.
- cchOutBuf [in]
-
Type: UINT
The size of the buffer to hold the output string, in characters.
- ppvReserved
-
Type: void**
Return value
Type: HRESULT
If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
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.
Requirements
|
Minimum supported client | Windows XP |
|---|---|
|
Minimum supported server | Windows Server 2003 |
|
Header |
|
|
Library |
|
|
DLL |
|
Send comments about this topic to Microsoft
Build date: 3/7/2012