//rundll 运行DLL import fsys import process; namespace process; class rundll{ ctor(dll,arg,...){ if( dll === null ) dll = "shell32.dll"; this.dll = (..fsys.shortpath(dll):dll) this@ = { _get = function(arg,ownerCall){ if(ownerCall || type.isString(arg) ){ return function(...){ var cmd = this.dll +"," +arg; if(...) cmd = cmd +" "+ ..string.join({ ...},",") ..process.execute("rundll32.exe",cmd); } } } } if(arg){ var cmd = this.dll +"," +arg; if(...) cmd = cmd +" "+ ..string.join({ ...},",") ..process.execute("rundll32.exe",cmd); } } } /**intellisense(process) rundll = 运行 DLL 接口支持库\n启动控制面板项也可以使用 process.control rundll(.("DLL文件","回调函数名 参数列表") = 运行DLL回调函数,回调函数原型:\n void(addr hwnd,pointer hinst,str lpCmdLine,int nCmdShow)\n参数@1指定dll文件,省略则默认为shell32.dll rundll(.("DLL文件") = 如果只指定一个参数或不指定参数,\n可调用返回对象的成员函数以运行 DLL 的函数\n打开环境变量编辑器示例:\nprocess.rundll("sysdm.cpl").EditEnvironmentVariables() rundll() = 返回一个对象用于调用 shell32.dll 函数\n!processRundll. end intellisense**/ /**intellisense(!processRundll) ? = 运行 DLL 函数\n函数原型必须为 void(addr hwnd,pointer hinst,str lpCmdLine,int nCmdShow)\n调用时只能用一个或多个字符串指定 lpCmdLine 参数,\n传入多个字符串参数则以逗号为分隔符合并为一个参数 OpenAs_RunDLL(__) = shell32.dll 函数用于指定文件打开方式,\n参数指定文件完整路径 Control_RunDLL(__) = 运行控制面板命令,参数指定 *.cpl,\ncpl 其实也是 DLL 文件,\n所以也可以用 process.rundll 直接调用其函数,\n例如 process.rundll("sysdm.cpl").EditEnvironmentVariables() SHHelpShortcuts_RunDLL(__) = 可用参数\nAddPrinter 添加新打印机\nPrintersFolder 打开打印机目录\nFontsFolder 打开字体目录 end intellisense**/