The. net call to refresh the tray area code in the win11 system does not take effect when clearing residual icons
Xia Xia1 Kang
0
Reputation points
The relevant code for refreshing the tray area is called in the win11 system code, and it does not take effect occasionally
The residual icon still exists, it can disappear when the mouse hovers over it
The code is as follows:
const uint WM_MOUSEMOVE = 0x0200;
bool isSuccess = GetClientRect(windowHandle, out Rect rect);
LogsHelper.Instance.DebugWrite($"isSuccess:{isSuccess} GetClientRect right:{rect.right} bottom:{rect.bottom}");
if (rect.right == 0)
{
rect.right = 320;
}
if (rect.bottom == 0)
{
rect.bottom = 320;
LogsHelper.Instance.DebugWrite("rect.bottom = 320");
}
for (int x = 0; x < rect.right; x += 5)
{
for (int y = 0; y < rect.bottom; y += 5)
{
SendMessage(windowHandle, WM_MOUSEMOVE, 0, (y << 16) + x);
}
}
1 answer
Sort by: Most helpful
-
Deleted
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more