ParseURL function

1404 단어 functionurlinclude
https://msdn.microsoft.com/en-us/library/windows/desktop/bb773825(v=vs.85).aspx
#include <windows.h>
#include <shlwapi.h>
#include <stdio.h>
#include <tchar.h>void sample(LPCTSTR pcszUrl)
{
    PARSEDURL pu;
    pu.cbSize = sizeof(pu);
    HRESULT hr = ParseURL(pcszUrl, &pu);
    _tprintf(TEXT("ParseURL(%s) returned 0x%08x
"), pcszUrl, hr);    if (SUCCEEDED(hr)) {         _tprintf(TEXT("Protocol = %.*s
"), pu.cchProtocol, pu.pszProtocol);         _tprintf(TEXT("Suffix   = %.*s
"), pu.cchSuffix, pu.pszSuffix);         _tprintf(TEXT("Scheme   = %d
"), pu.nScheme);         _tprintf(TEXT("
"));     } }int __cdecl main() {     sample(TEXT("http://msdn.microsoft.com/vstudio/"));     sample(TEXT("mailto:[email protected]"));     sample(TEXT("file://C:\\AUTOEXEC.BAT"));     sample(TEXT("C:\\AUTOEXEC.BAT"));    return 0; }    OUTPUT: --------- ParseURL(http://msdn.microsoft.com/vstudio/) returned 0x00000000Protocol = http Suffix   = //msdn.microsoft.com/vstudio/Scheme   = 2 ParseURL(mailto:[email protected]) returned 0x00000000 Protocol = mailto Suffix   = [email protected] Scheme   = 4 ParseURL(file://C:\AUTOEXEC.BAT) returned 0x00000000Protocol = file Suffix   = C:\AUTOEXEC.BAT Scheme   = 9 ParseURL(C:\AUTOEXEC.BAT) returned 0x80041001

좋은 웹페이지 즐겨찾기