From 4322167a9390d767c93784d300da553f9de3629f Mon Sep 17 00:00:00 2001 From: chrisjbillington Date: Tue, 12 May 2020 15:16:25 +1000 Subject: [PATCH] Refresh icon cache after installing a shortcut --- .gitignore | 3 ++- desktop_app/windows.py | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d3a7493..8f48d42 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ __pycache__ *.egg-info -dist \ No newline at end of file +dist +*.eggs \ No newline at end of file diff --git a/desktop_app/windows.py b/desktop_app/windows.py index c599782..d27794b 100644 --- a/desktop_app/windows.py +++ b/desktop_app/windows.py @@ -59,6 +59,14 @@ def create_shortcut( ) store.Commit() + # Refresh the icon cache: + shell.SHChangeNotify( + shellcon.SHCNE_ASSOCCHANGED, + shellcon.SHCNF_IDLIST | shellcon.SHCNF_FLUSH, + None, + None, + ) + def set_process_appusermodel_id(appid): _checkwindows() shell.SetCurrentProcessExplicitAppUserModelID(appid) \ No newline at end of file