Skip to content

Commit

Permalink
Recreate notification icon on TaskbarCreated
Browse files Browse the repository at this point in the history
Fixes #11
  • Loading branch information
lesderid committed Feb 28, 2021
1 parent 6f3dca7 commit 9f0f1f7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/keynavish/window.d
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ HWND windowHandle;
bool active;
bool quitting;

UINT taskbarCreatedMessage;

void registerWindowClass()
{
WNDCLASSEX windowsClassEx;
Expand Down Expand Up @@ -64,6 +66,9 @@ LRESULT windowProc(HWND handle, UINT message, WPARAM wParam, LPARAM lParam)

switch (message)
{
case WM_CREATE:
taskbarCreatedMessage = RegisterWindowMessage("TaskbarCreated");
goto default;
case WM_PAINT:
PAINTSTRUCT ps;
auto deviceContext = BeginPaint(handle, &ps);
Expand All @@ -78,6 +83,12 @@ LRESULT windowProc(HWND handle, UINT message, WPARAM wParam, LPARAM lParam)
handleNotifyIconMessage(wParam, lParam);
break;
default:
if (message == taskbarCreatedMessage)
{
removeNotifyIcon();
addNotifyIcon();
}

return DefWindowProc(handle, message, wParam, lParam);
}
return 0;
Expand Down

0 comments on commit 9f0f1f7

Please sign in to comment.