Hey. I've managed to change the code to suit my needs by checking to see if the window size has changed before sending a F5 to refresh the window after moving. This is a change to the moveAndSizeWin function in Slot.cs. This way it doesn't refresh unnecessarily after the window moves. For me, it removes all of the delay and freezing that occurs when I close a window in an early slot with ripple and F5 enabled. It only stops the refresh if the slots are the same size.
This could be useful to others, so I'm posing the code here (under GPL, of course).
Code:
public void moveAndSizeWin(bool movable, bool sizable, bool sendF5)
{
bool success;
if (sendF5)
{
Win32.RECT oldRect = new Win32.RECT();
success = Win32.GetWindowRect(hWND, out oldRect);
if (!success)
{
// Get the last Win32 error code
int errorCode = Marshal.GetLastWin32Error();
string errorMessage = String.Format(Resources.setWindowPosFailureFormat, "move and size", errorCode);
throw new Win32Exception(errorMessage);
}
if ((oldRect.Right - oldRect.Left) == _shape.Width && (oldRect.Bottom - oldRect.Top) == _shape.Height)
{
// Don't sendF5 if the window size has not changed
sendF5 = false;
}
}
success = Win32.SetWindowPos(hWND, Win32.HWND_TOP, _shape.X, _shape.Y, _shape.Width, _shape.Height,
Win32.SWP_NOZORDER | Win32.SWP_NOACTIVATE |
((movable) ? 0 : Win32.SWP_NOMOVE) | ((sizable) ? 0 : Win32.SWP_NOSIZE));
if (!success)
{
// Get the last Win32 error code
int errorCode = Marshal.GetLastWin32Error();
string errorMessage = String.Format(Resources.setWindowPosFailureFormat, "move and size", errorCode);
throw new Win32Exception(errorMessage);
}
if (sendF5)
{
//Attempt to cause redraw
showWin();
SendKeys.Send("{F5}");
}
}
Last edited by Lyrrad; 04-10-2009 at 11:07 PM.