Update winlibs.js

This commit is contained in:
Namhyeon Go 2020-07-26 05:46:25 +09:00 committed by GitHub
parent 9db9f4d4eb
commit 8c307807ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,6 @@
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// Windows Library API // Windows Library API
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
var SHELL = require("lib/shell"); var SHELL = require("lib/shell");
exports.loadLibrary = function(LIB) { exports.loadLibrary = function(LIB) {
@ -15,9 +14,28 @@ exports.loadLibrary = function(LIB) {
commandOptions.push("rundll32.exe"); commandOptions.push("rundll32.exe");
commandOptions.push(LIB + ".dll," + FN); commandOptions.push(LIB + ".dll," + FN);
commandOptions.push(args.join(' ')); commandOptions.push("\"" + args.join("\" \"") + "\"");
return SHELL.exec(commandOptions.join(' ')); return SHELL.exec(commandOptions.join(' '));
} }
}; };
}; };
exports.openControlPanel = function(name, args) {
var shell32 = exports.loadLibrary("shell32");
var _args = [];
_args.push(name + ".cpl");
if (typeof(args) !== "undefined") {
for (var i in args) {
_args.push(args[i]);
}
}
return shell32.call("Control_runDLL", _args);
};
exports.openNetworkControlPanel = function() {
return exports.openControlPanel("ncpa");
};