This commit is contained in:
Federico Terzi 2019-09-30 22:47:00 +02:00
parent a56de80ef8
commit 23ae1fafc1

View File

@ -59,6 +59,8 @@ HBITMAP g_espanso_bmp = NULL;
HICON g_espanso_ico = NULL; HICON g_espanso_ico = NULL;
NOTIFYICONDATA nid = {}; NOTIFYICONDATA nid = {};
UINT WM_TASKBARCREATED = RegisterWindowMessage(L"TaskbarCreated");
// Callbacks // Callbacks
KeypressCallback keypress_callback = NULL; KeypressCallback keypress_callback = NULL;
@ -258,6 +260,9 @@ LRESULT CALLBACK window_procedure(HWND window, unsigned int msg, WPARAM wp, LPAR
return 0; return 0;
} }
default: default:
if (msg == WM_TASKBARCREATED) { // Explorer crashed, recreate the icon
Shell_NotifyIcon(NIM_ADD, &nid);
}
return DefWindowProc(window, msg, wp, lp); return DefWindowProc(window, msg, wp, lp);
} }
} }