UrlGetLocationW function (shlwapi.h)

Retrieves the location from a URL.

Syntax

LPCWSTR UrlGetLocationW(
  [in] PCWSTR pszURL
);

Parameters

[in] pszURL

Type: PCTSTR

A null-terminated string of maximum length INTERNET_MAX_URL_LENGTH that contains the location.

Return value

Type: LPCTSTR

Returns a pointer to a null-terminated string with the location, or NULL otherwise.

Remarks

The location is the segment of the URL starting with a ? or # character. If a file URL has a query string, the returned string includes the query string.

Note

The shlwapi.h header defines UrlGetLocation 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.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional, Windows XP [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header shlwapi.h
Library Shlwapi.lib
DLL Shlwapi.dll (version 5.0 or later)