TranslateURLW function (intshcut.h)
Applies common translations to a given URL string, creating a new URL string.
INTSHCUTAPI HRESULT TranslateURLW(
PCWSTR pcszURL,
DWORD dwInFlags,
[out] PWSTR *ppszTranslatedURL
);
pcszURL
Type: PCTSTR
The address of the URL string to be translated.
dwInFlags
Type: DWORD
The bit flags that specify how the URL string is to be translated. This value can be a combination of the following:
If the protocol scheme is not specified in the pcszURL parameter to TranslateURL, the system automatically chooses a scheme and adds it to the URL.
If the protocol scheme is not specified in the pcszURL parameter to TranslateURL, the system adds the default protocol to the URL.
[out] ppszTranslatedURL
Type: PTSTR*
A pointer variable that receives the pointer to the newly created, translated URL string, if any. The ppszTranslatedURL parameter is valid only if the function returns S_OK.
Type: HRESULT
Returns S_OK upon success, or S_FALSE if the URL did not require translation. If an error occurs, the function returns one of the following values.
Return code | Description |
---|---|
|
The flag combination passed in dwInFlags is invalid. |
|
There was insufficient memory to complete the operation. |
|
One of the input pointers is invalid. |
This function does not validate the input URL string. A successful return value does not indicate that the URL strings are valid URLs.
Note
The intshcut.h header defines TranslateURL as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | intshcut.h |
DLL | Url.dll |