1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| #ifdef Q_OS_WIN auto RefreshTrayIcon = []() { HWND hShellTrayWnd = ::FindWindow(L"Shell_TrayWnd", NULL); HWND hTrayNotifyWnd = ::FindWindowEx(hShellTrayWnd, 0, L"TrayNotifyWnd", NULL); HWND hSysPager = ::FindWindowEx(hTrayNotifyWnd, 0, L"SysPager", NULL); HWND hToolbarWindow32; if (hSysPager) { hToolbarWindow32 = ::FindWindowEx(hSysPager, 0, L"ToolbarWindow32", NULL); } else { hToolbarWindow32 = ::FindWindowEx(hTrayNotifyWnd, 0, L"ToolbarWindow32", NULL); } if (hToolbarWindow32) { RECT r; ::GetWindowRect(hToolbarWindow32, &r); int width = r.right - r.left; int height = r.bottom - r.top;
int iconWidth = GetSystemMetrics(SM_CXSMICON); int iconHeight = GetSystemMetrics(SM_CYSMICON);
for (int x = 1; x < width; x+=iconWidth) { for (int y = 1; y < height; y+=iconHeight) { ::SendMessage(hToolbarWindow32, WM_MOUSEMOVE, 0, MAKELPARAM(x, y)); } } } };
#endif
|