ll_libload shell, "shell32.dll"
ll_getproc SHFileOperation, "SHFileOperationA", shell
#module
#deffunc filedel val, int
mref files, 24 : mref prg, 1
mref stt, 64
strlen i, files
sdim f, i + 2
dim pFileOp, 8
i.2 = 0
repeat
// ファイルパス取り出し
strlen i, files
instr i.1, files, "\n"
if i.1 = -1 : i.1 = i : if i = 0 : break
strmid s, files, 0, i.1
strmid files, files, i.1 + 2, i - i.1 - 2
// NULL区切りに変更
strlen i, s
repeat i
peek i, s, cnt
poke f, i.2, i
i.2++
loop
i.2++
loop
ll_getptr f : ll_ret prm.2
i = 0, 0x0003, prm.2, 0, (prg ! 0) * 0x0004 + 0x0450 // FOF_ALLOWUNDO | FOF_NOCONFIRMATION | FOF_NOERRORUI
ll_getptr i : ll_ret prm
ll_callfunc prm, 1, SHFileOperation@
ll_ret i : stt = i
return
#global
sdim path, 2000
notesel path
pos 10, 10 : button "追加", *add
pos 10, 40 : button "削除", *del
pos 10, 70 : button "実行", *rmv
objsize 320, 30
pos 80, 10 : listbox index, 400, path
stop
*add
dialog "", 16
if stat {
noteadd refstr, -1
objprm 3, path
}
stop
*del
if index ! -1 {
notedel index
objprm 3, path
}
stop
*rmv
filedel path, 1
if stat : dialog "削除に失敗しました"
path = ""
objprm 3, path
stop
|