UrlGetPart Function
Accepts a URL string and returns a specified part of that URL.
Syntax
HRESULT UrlGetPart(
__in PCTSTR pszIn,
__out PTSTR pszOut,
__inout DWORD *pcchOut,
DWORD dwPart,
DWORD dwFlags
);
Parameters
pszIn [in]
Type: PCTSTR
A null-terminated string of maximum length INTERNET_MAX_URL_LENGTH that contains the URL.
pszOut [out]
Type: PTSTR
A pointer to a buffer that, when this function returns successfully, receives a null-terminated string with the specified part of the URL.
pcchOut [in, out]
Type: DWORD*
A pointer to a value that, on entry, is set to the number of characters in the pszOut buffer. When this function returns successfully, the value depends on whether the function is successful or returns E_POINTER. For other return values, the value of this parameter is meaningless.
dwPart
Type: DWORD
The flags that specify which part of the URL to retrieve. It can have one of the following values.
URL_PART_HOSTNAME
The host name.
URL_PART_PASSWORD
The password.
URL_PART_PORT
The port number.
URL_PART_QUERY
The query portion of the URL.
URL_PART_SCHEME
The URL scheme.
URL_PART_USERNAME
The username.
dwFlags
Type: DWORD
A flag that can be set to keep the URL scheme, in addition to the part that is specified by dwPart.
URL_PARTFLAG_KEEPSCHEME
Keep the URL scheme.
Return Value
Type: HRESULT
Returns S_OK if successful. The value pointed to by pcchOut will be set to the number of characters written to the output buffer, excluding the terminating NULL. If the buffer was too small, E_POINTER is returned, and the value pointed to by pcchOut will be set to the minimum number of characters that the buffer must be able to contain, including the terminating NULL character. Otherwise, a COM error value is returned.
Requirements
Minimum supported client |
Windows 2000 Professional, Windows XP |
Minimum supported server |
Windows 2000 Server |
Header |
Shlwapi.h |
Library |
Shlwapi.lib |
DLL |
Shlwapi.dll (version 5.0 or later) |
Unicode and ANSI names |
UrlGetPartW (Unicode) and UrlGetPartA (ANSI) |
'Windows Programming' 카테고리의 다른 글
Shell_NotifyIcon, NOTIFYICONDATA struct Size (1) | 2010.03.03 |
---|---|
레지스트리 감시 (0) | 2010.02.26 |
Visual Studio 소스편집창 분할하기 (0) | 2009.08.05 |
API Hooking - 2. PE File Format (0) | 2009.07.31 |
API Hooking - 1. Dll Injection (0) | 2009.07.22 |