mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 15:04:58 +00:00
Update winlibs.js
This commit is contained in:
parent
8c307807ed
commit
45465d12e3
|
@ -21,21 +21,30 @@ exports.loadLibrary = function(LIB) {
|
|||
};
|
||||
};
|
||||
|
||||
exports.openControlPanel = function(name, args) {
|
||||
exports.openControlPanel = function(name, applets, args) {
|
||||
var shell32 = exports.loadLibrary("shell32");
|
||||
var _applets = [];
|
||||
var _args = [];
|
||||
|
||||
_args.push(name + ".cpl");
|
||||
|
||||
if (typeof(args) !== "undefined") {
|
||||
for (var i in args) {
|
||||
_args.push(args[i]);
|
||||
|
||||
// write a applets section
|
||||
_applets.push(name + ".cpl");
|
||||
if (typeof(applets) !== "undefined") {
|
||||
for (var i in applets) {
|
||||
_applets.push(applets[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// write a args section
|
||||
_args.push(_applets.join(','));
|
||||
|
||||
// run command
|
||||
return shell32.call("Control_runDLL", _args);
|
||||
};
|
||||
|
||||
exports.openNetworkControlPanel = function() {
|
||||
exports.openTimezonePanel = function() {
|
||||
return exports.openControlPanel("desk", ["@0", 1]);
|
||||
};
|
||||
|
||||
exports.openNetworkPanel = function() {
|
||||
return exports.openControlPanel("ncpa");
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user