import win.ui;
import console;
import process;
import string.regex;
import libs.router;
/*DSG{{*/
mainForm = win.form(text="navigator";right=959;bottom=591)
mainForm.add(
edit={cls="edit";text="navigator:// 協定調用";left=12;top=12;right=949;bottom=579;db=1;dl=1;dr=1;dt=1;edge=1;multiline=1;z=1}
)
/*}}*/
function setV(v) {
mainForm.edit.text = mainForm.edit.text + v;
}
if (_CMDLINE) {
var router = libs.router(_CMDLINE)
if (router.getName() === 'openIt') {
var folder = router.getV()
process.execute(folder)
}
win.quitMessage(); //程式退出
return;
}
/*
var url = '"navigator://openIt/?folder=C:/Users/Reciter/Desktop/%E5%BF%AB%E6%8D%B7%E6%96%B9%E5%BC%8F"'
var router = libs.router(url)
var v1 = router.getV()
var v = ..inet.url.decodeUnicode(v1)
console.log(v1)
*/
if (_ARGV[1]) {
mainForm.edit.text = mainForm.edit.text + _ARGV[1] + _CMDLINE
}
import win.ui.atom;
var atom, hwndConflict = mainForm.atom("{45198ECD-5155-27ED-DD87-BC927891F976}.navigator");
if (!atom) {
win.quitMessage(); //程式退出
return;
};
//process.execute("c:\\windows\\explorer.exe", "d:\\")
mainForm.show();
return win.loopMessage();