in main(): TaskBarCreated = RegisterWindowMessage(L"TaskbarCreated"); HWND TrayHwnd = FindWindow(L"Qt640TrayIconMessageWindowClass", nullptr); if(TrayHwnd) { OldWndProc = (WNDPROC)GetWindowLongPtrW(TrayHwnd, GWLP_WNDPROC); SetWindowLongPtrW(TrayHwnd, GWLP_WNDPROC, (LONG_PTR)WindowProc); } WindowProc: LRESULT CALLBACK WindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { if(Msg == TaskBarCreated) { qDebug() << "Reloading tray icon to fix resolution change bug"; trayIcon->setIcon(QIcon(":/tray_icon.ico")); } return CallWindowProcW(OldWndProc, hWnd, Msg, wParam, lParam); }