From 23ae1fafc167a77526ff951f2cc411a9e9cf2888 Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Mon, 30 Sep 2019 22:47:00 +0200 Subject: [PATCH] Fix #40 --- native/libwinbridge/bridge.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/native/libwinbridge/bridge.cpp b/native/libwinbridge/bridge.cpp index e5a4b27..3d977f6 100644 --- a/native/libwinbridge/bridge.cpp +++ b/native/libwinbridge/bridge.cpp @@ -59,6 +59,8 @@ HBITMAP g_espanso_bmp = NULL; HICON g_espanso_ico = NULL; NOTIFYICONDATA nid = {}; +UINT WM_TASKBARCREATED = RegisterWindowMessage(L"TaskbarCreated"); + // Callbacks KeypressCallback keypress_callback = NULL; @@ -258,6 +260,9 @@ LRESULT CALLBACK window_procedure(HWND window, unsigned int msg, WPARAM wp, LPAR return 0; } default: + if (msg == WM_TASKBARCREATED) { // Explorer crashed, recreate the icon + Shell_NotifyIcon(NIM_ADD, &nid); + } return DefWindowProc(window, msg, wp, lp); } }