public static void MoveToMiddleOf(this Form form, IntPtr refWnd) { if (refWnd != IntPtr.Zero) form.Handle.MoveToMiddleOf(refWnd.GetRectangle()); }