아래 질문에 소스를 잘못올렸습니다. ㅜ.ㅜ
아래 소스를 실행해보니 이번주의 익스플로러 히스토리만 가져옵니다.
익스플로러에서는 3주이전까지 확인이 가능한데요.
3주전까지 익스플로러 내용을 확인하려면 어떻게 해야할까요
// 선언부분
function GetUrlCacheEntryInfo(lpszUrlName: PChar; lpCacheEntryInfo:
PInternetCacheEntryInfo; var lpdwCacheEntryInfoBufferSize: DWORD): BOOL; stdcall;
function FindFirstUrlCacheEntry(lpszUrlSearchPattern: PChar;
lpFirstCacheEntryInfo: PInternetCacheEntryInfo;
var lpdwFirstCacheEntryInfoBufferSize: DWORD): THandle; stdcall;
function FindNextUrlCacheEntry(hEnumHandle: THandle; lpNextCacheEntryInfo:
PInternetCacheEntryInfo; var lpdwNextCacheEntryInfoBufferSize: DWORD): BOOL; stdcall;
const
URLHISTORY_CACHE_ENTRY = $00200000;
winetdll = 'wininet.dll';
function FindFirstUrlCacheEntry; external winetdll name 'FindFirstUrlCacheEntryA';
function FindNextUrlCacheEntry; external winetdll name 'FindNextUrlCacheEntryA';
function GetUrlCacheEntryInfo; external winetdll name 'GetUrlCacheEntryInfoA';
// 소스부분
function FileTimeToDt(Ft: TFileTime): string;
var
l: Integer;
lft: TFileTime;
begin
FileTimeToLocalFiletime(Ft, lft);
if FileTimeToDosDateTime(lft, Longrec(l).Hi, Longrec(l).Lo) then
result := DateTimeToStr(FiledateToDatetime(l)) else
result := '';
end;
function FileTimeToLongStr(ft : TFileTime): string;
var
st: TSystemTime;
begin
if FileTimeToLocalFileTime(ft, ft) then
if FileTimeToSystemTime(ft, st) then
Result := FormatDateTime('yyyy/mm/dd hh:mm:ss', SystemTimeToDateTime(st))
else
Result := ''
else
Result := '';
end;
procedure Form.GetURL;
var
T: PInternetCacheEntryInfo;
D: Cardinal;
H: THandle;
begin
D := 0;
H := FindFirstUrlCacheEntry(nil, nil, D); //Get bufferSize
GetMem(T, D);
if D > 0 then T^.dwStructSize := D;
H := FindFirstUrlCacheEntry(nil, T, D);
if GetLastError <> 0 then
repeat
if (T^.CacheEntryType = T^.CacheEntryType or URLHISTORY_CACHE_ENTRY) then
listHistory.Items.Add(T^.lpszSourceUrlName);
Freemem(T, D);
D := 0;
FindNextUrlCacheEntry(H, nil, D); //Get BufferSize
GetMem(T, D);
if D > 0 then T^.dwStructSize := D;
until not FindNextUrlCacheEntry(H, T, D);
FreeMem(T, D);
FindCloseUrlCache(H);
listHistory.ItemIndex := -1;
end;