summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorch1p_ <me@ch1p.com>2018-12-16 16:11:27 +0300
committerch1p_ <me@ch1p.com>2018-12-16 16:11:27 +0300
commitd8846b3c5159f7c1d9eb6719b8d71cdbd0ed6af7 (patch)
tree5005f37942b6cbc998c14fda3d3baa97240c852d
parenta586acf8a4cb2cea7b7c9dc72ce79eab085f4092 (diff)
added resetIconCache functionHEADmaster
-rw-r--r--index.cc5
-rw-r--r--index.js3
-rw-r--r--package.json2
-rw-r--r--test.js2
4 files changed, 10 insertions, 2 deletions
diff --git a/index.cc b/index.cc
index 59e359d..9c6a0f2 100644
--- a/index.cc
+++ b/index.cc
@@ -263,11 +263,16 @@ void isUserAdmin(const v8::FunctionCallbackInfo<Value>& args) {
args.GetReturnValue().Set(Boolean::New(isolate, _isUserAdmin()));
}
+void resetIconCache(const v8::FunctionCallbackInfo<Value>& args) {
+ SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
+}
+
void Init(Handle<Object> exports) {
NODE_SET_METHOD(exports, "deelevate", deelevate);
NODE_SET_METHOD(exports, "elevate", elevate);
NODE_SET_METHOD(exports, "getSystem32Path", GetSystem32Path);
NODE_SET_METHOD(exports, "isUserAdmin", isUserAdmin);
+ NODE_SET_METHOD(exports, "resetIconCache", resetIconCache);
}
NODE_MODULE(winutils, Init)
diff --git a/index.js b/index.js
index 7c42f1d..6c9cf1a 100644
--- a/index.js
+++ b/index.js
@@ -11,5 +11,6 @@ module.exports = {
deelevate: bin.deelevate,
elevate: bin.elevate,
getSystem32Path: bin.getSystem32Path,
- isUserAdmin: bin.isUserAdmin
+ isUserAdmin: bin.isUserAdmin,
+ resetIconCache: bin.resetIconCache,
}
diff --git a/package.json b/package.json
index ef4e208..660ce9b 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"gypfile": true,
"main": "index.js",
"name": "winutils",
- "version": "1.0.0",
+ "version": "1.0.1",
"scripts": {
"install": "node-gyp rebuild || true",
"test": "node index.js"
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..6d9cdb1
--- /dev/null
+++ b/test.js
@@ -0,0 +1,2 @@
+const winutils = require('./index.js')
+winutils.resetIconCache()