#include "hspcmp.as"
sdim txt, 128, 4 // 0:パックするファイル 1:暗号化キー 2:作成DPM名 3:重複チェック
sdim items, 128
notesel items
pos 370, 10 : button gosub "参照", *sansyou
pos 440, 10 : button gosub "追加", *add
pos 370, 40 : button gosub "削除", *del
pos 370, 130 : button gosub "作成", *making
objsize 200, 20
pos 10, 10 : mes "パックするファイル"
pos 160, 10 : input txt
pos 10, 40 : mes "パック予定ファイル"
pos 160, 40 : listbox index, 50, items
pos 10, 100 : mes "暗号キー(0:標準)"
pos 160, 100 : input txt.1, 100, 20
pos 10, 130 : mes "作成DPM名"
pos 160, 130 : input txt.2, 200, 20
stop
*sansyou
dialog "", 16, "追加ファイル"
if stat : objprm 4, refstr
return
*add
dupchk = 0 // 重複追加制御フラグ
repeat notemax
noteget txt.3, cnt
if txt.0 = txt.3 : dupchk = 1 : break
loop
exist txt
// 追加できないファイル
if strsize = -1 || dupchk = 1 {
dialog "「" + txt + "」は追加できません。"
// 追加可能なファイル
} else {
noteadd txt, -1
objprm 5, items
}
objprm 4, ""
return
*del
if index ! -1 {
noteget txt.3
objprm 4, txt.3 // パックするファイルに戻す
notedel index
objprm 5, items // パック予定ファイルから除名する
}
return
*making
if items = "" {
dialog "パックするファイルを設定してください。"
return
}
if txt.2 = "" {
dialog "DPMを決定してください。"
return
}
// PackFile作成
chdir dir_exe
notesave "packfile"
// DPM作成
pack_ini txt.2
pack_make 1, int(txt.1)
hsc_getmes txt.3 // HSPCMP.DLLからメッセージを受け取る
dialog txt.3 // 結果を表示
return
|