MFC Feature Pack: CFrameWndEx is maximized to wrong window size on multi-monitor system - by R Harmsen

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 526256 Comments
Status Resolved Workarounds
Type Bug Repros 0
Opened 1/21/2010 2:53:36 AM
Access Restriction Public


When you maximize a minimized CFrameWndEx window on a multi-monitor system it is resized according to the resolution of the left-most monitor, even if the window is not located on the left-most monitor. This only happens when the Office 2007 application look is used.

This caused by the fact that CFrameImpl::OnGetMinMaxInfo uses the window rectangle to determine which monitor should be used to determine the maximized size. When the window is minimized the top-left point of the rectangle returned by GetWindowRect is (-32000, -32000). When this rectangle is used to determine the monitor the left-most monitor is returned.

Replacing "MonitorFromPoint(rectWindow.CenterPoint(), MONITOR_DEFAULTTONEAREST)" with "MonitorFromWindow(m_pFrame->m_hWnd, MONITOR_DEFAULTTONEAREST)" in CFrameImpl::OnGetMinMaxInfo seems to fix this bug.
Sign in to post a comment.
Posted by Microsoft on 1/24/2010 at 5:41 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(