private static void RefreshWindow(IntPtr hWnd) { if (hWnd != IntPtr.Zero && WinApi.IsWindow(hWnd)) { WinApi.InvalidateRect(hWnd, IntPtr.Zero, true); WinApi.UpdateWindow(hWnd); WinApi.RedrawWindow(hWnd, IntPtr.Zero, IntPtr.Zero, WinApi.RedrawWindowFlags.Frame | WinApi.RedrawWindowFlags.Invalidate | WinApi.RedrawWindowFlags.UpdateNow | WinApi.RedrawWindowFlags.AllChildren); } }