1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
static int ListURLs(IUrlHistoryStgPtr stg)
{
IEnumSTATURL *en = NULL;
if (stg->EnumUrls(&en) != S_OK)
return GetLastError();
STATURL url;
long i = 0;
ULONG ures;
while (en->Next(1, &url, &ures) == S_OK)
{
//wprintf(L"%3d: title = \"%s\"\n", i++, url.pwcsTitle);
wprintf(L" URL = \"%s\"\n", url.pwcsUrl); //I want to add all of these into an array and return the array
/*
WCHAR lastVisited[DATE_LENGTH];
TimeToStringW(&url.ftLastVisited, lastVisited, DATE_LENGTH);
wprintf(L" Last visited at %s\n", lastVisited);
WCHAR lastUpdated[DATE_LENGTH];
TimeToStringW(&url.ftLastUpdated, lastUpdated, DATE_LENGTH);
wprintf(L" Last updated at %s\n", lastUpdated);
WCHAR expires[DATE_LENGTH];
TimeToStringW(&url.ftExpires, expires, DATE_LENGTH);
wprintf(L" Expires at %s\n", expires);
*/
if (!(url.dwFlags & STATURL_QUERYFLAG_NOURL))
CoTaskMemFree(url.pwcsUrl);
if (!(url.dwFlags & STATURL_QUERYFLAG_NOTITLE))
CoTaskMemFree(url.pwcsTitle);
}
en->Release();
//wprintf(L"\n");
//wprintf(L"Found %d URLs\n", i);
return 0;
}
|