ll_libload kernel, "kernel32.dll"
ll_getproc CreateFileA "CreateFileA", kernel
ll_getproc CloseHandle "CloseHandle", kernel
ll_getproc SetFileTime "SetFileTime", kernel
ll_getproc SystemTimeToFileTime "SystemTimeToFileTime", kernel
ll_getproc LocalFileTimeToFileTime "LocalFileTimeToFileTime", kernel
#module
#deffunc tm2st val, int, int, int, int, int, int, int
mref tm, 48 : mref y, 1 : mref m, 2 : mref d, 3 : mref h, 4 : mref mi, 5 : mref s, 6 : mref ms, 7
if y = 0 : gettime y, 0
if m = 0 : gettime m, 1
if d = 0 : gettime d, 3
if h = 0 & (mi = 0) & (s = 0) & (ms = 0) : gettime h, 4 : gettime mi, 5 : gettime s, 6 : gettime ms, 7
wpoke tm.0, 0, y
wpoke tm.0, 2, m
wpoke tm.1, 2, d
wpoke tm.2, 0, h
wpoke tm.2, 2, mi
wpoke tm.3, 0, s
wpoke tm.3, 2, ms
return
#deffunc settimestamp str, int, int, int, int, int, int, int
mref file, 32 : mref type, 1 : mref y, 2 : mref m, 3 : mref d, 4 : mref h, 5 : mref mi, 6 : mref s, 7
dim st, 4
tm2st st, y, m, d, h, mi, s
ll_getptr st : ll_ret prm.0
ll_getptr ft : ll_ret prm.1
ll_callfunc prm, 2, SystemTimeToFileTime@
prm = prm.1
ll_callfunc prm, 2, LocalFileTimeToFileTime@
ll_getptr file : ll_ret prm.0
prm.1 = 0x40000000, 0, 0, 0x0003, 0, 0
ll_callfunc prm, 7, CreateFileA@
ll_ret hfile
ll_getptr ft : ll_ret prm.4
prm = hfile, (type = 0) * prm.4, (type = 2) * prm.4, (type = 1) * prm.4
ll_callfunc prm, 4, SetFileTime@
ll_callfunc hfile, 1, CloseHandle@
return
#global
gettime d.0, 0
gettime d.1, 1
gettime d.2, 3
gettime d.3, 4
gettime d.4, 5
gettime d.5, 6
pos 10, 10 : input d.0, 40, 20
pos 70, 10 : mes "年"
pos 100, 10 : input d.1, 25, 20
pos 140, 10 : mes "月"
pos 170, 10 : input d.2, 25, 20
pos 210, 10 : mes "日"
pos 30, 40 : input d.3, 25, 20
pos 70, 40 : mes "時"
pos 100, 40 : input d.4, 25, 20
pos 140, 40 : mes "分"
pos 170, 40 : input d.5, 25, 20
pos 210, 40 : mes "秒"
pos 10, 70 : combox index, , "作成\n更新\nアクセス"
pos 100, 70 : button "セット", *set
stop
*set
dialog "", 16, "タイムスタンプ設定対象ファイル"
if stat : settimestamp refstr, index, d.0, d.1, d.2, d.3, d.4, d.5
stop
|