ll_libload kernel, "kernel32.dll"
ll_getproc CreateFileA "CreateFileA", kernel
ll_getproc CloseHandle "CloseHandle", kernel
ll_getproc GetFileTime "GetFileTime", kernel
ll_getproc FileTimeToLocalFileTime, "FileTimeToLocalFileTime", kernel
ll_getproc FileTimeToSystemTime, "FileTimeToSystemTime", kernel
#module
#deffunc gettimestamp str, int
mref file, 32 : mref type, 1
mref rstr, 65
prm = 0, 0, 0, 0, 0x0003, 0, 0
ll_getptr file : ll_ret prm.0
ll_callfunc prm, 7, CreateFileA@
ll_ret hfile
dim i, 4
ll_getptr i : ll_ret j
prm = hfile,(type = 0) * j, (type = 2) * j, (type = 1) * j
ll_callfunc prm, 4, GetFileTime@
prm = j, j
ll_callfunc prm, 2, FileTimeToLocalFileTime@
ll_callfunc prm, 2, FileTimeToSystemTime@
ll_callfunc hfile, 1, CloseHandle@
j = i.0 >> 0 & 0xFFFF : rstr = "" + j
j = i.0 >> 16 & 0xFFFF : rstr += "/" + j
j = i.1 >> 16 & 0xFFFF : rstr += "/" + j
j = i.2 >> 0 & 0xFFFF : rstr += " " + j
j = i.2 >> 16 & 0xFFFF : rstr += ":" + j
j = i.3 >> 0 & 0xFFFF : rstr += ":" + j
return
#global
dialog "", 16, "タイムスタンプ取得対象ファイル"
if stat = 0 : end
path = refstr
gettimestamp path, 0
mes "作成日時 :" + refstr
gettimestamp path, 1
mes "最終書込日時 :" + refstr
gettimestamp path, 2
mes "最終アクセス日時:" + refstr
stop
|