#include <Windows.h> #include <Shlwapi.h> #include <stdio.h> #pragma comment(lib, "Shlwapi.lib") int wmain() { // ベースURL LPCWSTR baseUrl = L"https://example.com/base/"; // 相対URL LPCWSTR relativeUrl = L"page.html"; // 絶対URLを格納するバッファ WCHAR absoluteUrl[MAX_PATH]; // 絶対URLを取得 DWORD dwSize = MAX_PATH; if (UrlCombine(baseUrl, relativeUrl, absoluteUrl, &dwSize, 0) == S_OK) { wprintf(L"Absolute URL: %s\n", absoluteUrl); } else { wprintf(L"Failed to combine URLs.\n"); } return 0; }