#include <Date.au3>
Const $tagCache = "dword;ptr[2];dword[5];dword[2];dword[2];dword[2];dword[2];ptr;dword;ptr"
Dim $hFind = _FindFirstUrlCacheEntry()
FileWrite("TempFile.txt", "TempInternetFiles" & @CRLF)
While True
$aCache = _FindNextUrlCacheEntry($hFind)
If @error Then ExitLoop
For $o = 0 to Ubound($aCache) - 1
FileWrite("TempFile.txt", $aCache[$o] & @CRLF)
Next
FileWrite("TempFile.txt", @CRLF)
WEnd
ShellExecute("TempFile.txt")
Func _FindFirstUrlCacheEntry()
Local $tCache, $pCache, $hFind
$hFind = DllCall("Wininet.dll", "hWnd", "FindFirstUrlCacheEntry", _
"str", "", "ptr", 0, "int*", 0)
$tCache = DllStructCreate("ubyte[" & $hFind[3] & "]")
$pCache = DllStructGetPtr($tCache)
$hFind = DllCall("Wininet.dll", "hWnd", "FindFirstUrlCacheEntry", _
"str", "", "ptr", $pCache, "int*", $hFind[3])
$tCache = 0
Return $hFind[0]
EndFunc ;==>_FindFirstUrlCacheEntry()
Func _FindNextUrlCacheEntry(ByRef $hFind)
Local $tBuffer, $pBuffer, $iSizeofBuffer, $tCache, $iResult
$iResult = DllCall("Wininet.dll", "int", "FindNextUrlCacheEntry", _
"hWnd", $hFind, "ptr", 0, "int*", 0)
$iSizeofBuffer = $iResult[3]
$tBuffer = DllStructCreate("ubyte[" & $iSizeofBuffer & "]")
$pBuffer = DllStructGetPtr($tBuffer)
$iResult = DllCall("Wininet.dll", "int", "FindNextUrlCacheEntry", _
"hWnd", $hFind, "ptr", $pBuffer, "int*", $iSizeofBuffer)
If Not $iResult[0] Then Return SetError(259, 0, 0)
Local $tCache, $tSrcUrl, $tLocalFile, $aResult[10], $sFileExt
$tCache = DllStructCreate($tagCache, $pBuffer)
$tSrcUrl = DllStructCreate("char[512]", DllStructGetData($tCache, 2, 1))
$tLocalFile = DllStructCreate("char[512]", DllStructGetData($tCache, 2, 2))
$aResult[0] = DllStructGetData($tLocalFile, 1)
$aResult[1] = DllStructGetData($tSrcUrl, 1)
$sFileExt = StringRegExp($aResult[0], "\.([^\.]+$)", 3)
If IsArray($sFileExt) Then
$aResult[2] = $sFileExt[0] & " File"
Else
$aResult[2] = "Unknown File"
EndIf
$aResult[3] = DllStructGetData($tCache, 3, 1)
$aResult[4] = DllStructGetData($tCache, 3, 2)
$aResult[5] = DllStructGetData($tCache, 3, 3)
$aResult[6] = _FormatTime(DllStructGetPtr($tCache, 4))
$aResult[7] = _FormatTime(DllStructGetPtr($tCache, 5))
$aResult[8] = _FormatTime(DllStructGetPtr($tCache, 6))
$aResult[9] = _FormatTime(DllStructGetPtr($tCache, 7))
$tBuffer = 0
$tCache = 0
$tSrcURL = 0
$tFileExt = 0
$tLocalFile = 0
Return SetError(Not $iResult[0], 0, $aResult)
EndFunc ;==>_FindNextUrlCacheEntry()
Func _FormatTime($pTime)
Local $tSysTime
$tSysTime = _Date_Time_FileTimeToSystemTime($pTime)
Return _Date_Time_SystemTimeToDateTimeStr($tSysTime)
EndFunc ;==>_FormatTime()