winniet
asked on
How to use FindFirstUrlCacheEntry() function?
Hi, I want to use FindFirstUrlCacheEntry() to search cache for some specific URL files, I don't know how to initialize the parameters of this function. From the document, I don't know how to set them. Please give me a example.
HANDLE FindFirstUrlCacheEntry (
[IN] LPCSTR lpszUrlSearchPattern,
[OUT] LPINTERNET_CACHE_ENTRY_INF O lpFirstCacheEntryInfo,
[IN OUT] LPDWORD lpdwFirstCacheEntryInfoBuf ferSize);
HANDLE FindFirstUrlCacheEntry (
[IN] LPCSTR lpszUrlSearchPattern,
[OUT] LPINTERNET_CACHE_ENTRY_INF
[IN OUT] LPDWORD lpdwFirstCacheEntryInfoBuf
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
#include <windows.h>
#include <iostream.h>
#include <wininet.h>
void main()
{
LPCSTR lpszUrlSearchPattern = "*.*";
LPINTERNET_CACHE_ENTRY_INF
DWORD dwBufferSize = MAX_CACHE_ENTRY_INFO_SIZE;
lpCEInfo->dwStructSize = MAX_CACHE_ENTRY_INFO_SIZE;
HANDLE hEnumHandle = FindFirstUrlCacheEntry(
lpszUrlSearchPattern,
lpCEInfo,
&dwBufferSize
);
if( hEnumHandle == NULL )
cout << GetLastError();
else
{
do
{
lpCEInfo->dwStructSize = MAX_CACHE_ENTRY_INFO_SIZE;
dwBufferSize = MAX_CACHE_ENTRY_INFO_SIZE;
}
while( FindNextUrlCacheEntry( hEnumHandle, lpCEInfo, &dwBufferSize ) );
}
FindCloseUrlCache( hEnumHandle );
}