public static void Refresh() { try { int sysTrayWnd = SysTray.GetSysTrayWnd(); HRect hRect = default(HRect); Windows.GetClientRect((IntPtr)sysTrayWnd, out hRect); for (int i = 0; i < hRect.right; i += 2) { for (int j = 0; j < hRect.bottom; j += 2) { Message.SendMessage(sysTrayWnd, 512, 0, Message.MakeLParam(i, j)); } } } catch (Exception ex) { LogManage.WriteLog(typeof(SysTray), ex); } }
public static extern bool GetClientRect(IntPtr hWnd, out HRect lpRect);
public static extern bool GetWindowRect(HandleRef hwnd, out HRect rect);