An MFC tabbed MDI application has the following undesired behaviour (under Windows 7):
1. I open two documents in the application.
2. I minimise the main frame.
3. I restore the main frame by clicking on one of the two document thumbnails above the program icon on the task bar.
The appropriate document comes up as the current one, but
a. it doesn't get the focus properly.
b. the tool bars are not drawn correctly - the area outside the buttons is black.
I have produced this behaviour in a small app created with re VS2010 wizard. [The focus isn't obvious in the blank documents but the tool bar problem is clear.]
What appears to be happening is that, when the frame is restored, CView::OnActivateView gets called but the line
if (IsTopParentActive()) SetFocus();
is finding thatthe parent is not active, so SetFocus() does not get called.
Everything is apparently restored to a correct state, toolbar apearance included, if I click on the tab of the other document, and stays correct if I thien click on the first one again.
Can you confirm this is a bug? I attach the mini app I created to demonstrate it (in which all code is as generated by the App Wizard).