WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

How To
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Get IE Cache history


Keywords: Internet explorer history retrieve


;MSIE Cache history retrieval
;Guido 04/03

;exclusive(@on)

wininet=dllload(strcat(dirwindows(1),"wininet.dll"))
kernel32=dllload(strcat(dirwindows(1),"kernel32.dll"))

a=GetTickCount()

ERROR_CACHE_FIND_FAIL=0
ERROR_INSUFFICIENT_BUFFER=122

boxopen("History:","")

bsize=binaryalloc(4) ;stores structure size
MAX_SIZE=4096
ICE=binaryalloc(MAX_SIZE) ;structure
SYSTEMTIME=binaryalloc(16) 

ICEadd=intcontrol(42,ICE,0,0,0)
binarypoke4(bsize,0,MAX_SIZE)

hfile=fileopen("c:\temp\history.txt","write")

;call to get info
hfind=dllcall(wininet,long:"FindFirstUrlCacheEntryA",lpstr:"visited:",lpbinary:ICE,lpbinary:bsize)
binaryeodset(ICE,MAX_SIZE)

if hfind<>ERROR_CACHE_FIND_FAIL 
purl=binarypeek4(ICE,4) ;url pointer
pft=ICEadd+48 ;LastAccess FILETIME pointer 

url=binarypeekstr(ICE,purl-ICEadd,MAX_SIZE)

;last access
dllcall(kernel32,long:"FileTimeToSystemTime",long:pft,lpbinary:SYSTEMTIME)
y=binarypeek2(SYSTEMTIME,0)
m=binarypeek2(SYSTEMTIME,2)
d=binarypeek2(SYSTEMTIME,6)
h=binarypeek2(SYSTEMTIME,8)
mm=binarypeek2(SYSTEMTIME,10)

date=strcat(y," ",m," ",d," ",h,":",mm)
boxtext(strcat(url,@crlf,date))

filewrite(hfile,strcat(url,@crlf,date))

while 1

;call to get info
binarypoke4(bsize,0,MAX_SIZE)
if !dllcall(wininet,long:"FindNextUrlCacheEntryA",long:hfind,lpbinary:ICE,lpbinary:bsize) then break
binaryeodset(ICE,MAX_SIZE)
purl=binarypeek4(ICE,4)

url=binarypeekstr(ICE,purl-ICEadd,MAX_SIZE)

;last access
dllcall(kernel32,long:"FileTimeToSystemTime",long:pft,lpbinary:SYSTEMTIME)
y=binarypeek2(SYSTEMTIME,0)
m=binarypeek2(SYSTEMTIME,2)
d=binarypeek2(SYSTEMTIME,6)
h=binarypeek2(SYSTEMTIME,8)
mm=binarypeek2(SYSTEMTIME,10)

date=strcat(y," ",m," ",d," ",h,":",mm)
boxtext(strcat(url,@crlf,date))

filewrite(hfile,strcat(url,@crlf,date))

endwhile

endif

message("",GetTickCount()-a)

fileclose(hfile)

dllfree(wininet)
dllfree(kernel32)
binaryfree(bsize)
binaryfree(ICE)
binaryfree(SYSTEMTIME)

Article ID:   W16462
File Created: 2005:02:18:12:20:50
Last Updated: 2005:02:18:12:20:50