I am working on an MDI app and a noticeable flickering happens every time the last child window is closed and one uses an Office-based UI theme.
The same flaw is apparent in ProfStudio, MDI_DynamicBars examples. Oddly enough, in those cases one needs to start anew (i.e., no info in the registry being used).
1. Steps to reproduce:
Remove Foss entry in the computer’s registry.
Start ProfStudio Project.
Set child windows to Standard MDI.
Set the UI theme to one of the NC-managed themes (Office 2007 or 2010)
Restore the existing child window ("un-maximize" it)
Close the Child window.
For a brief moment, the child window disappears, shows up again and then is deleted for good.
2. My Setup:
Machine - Dell Latitude 820
Platform - VS 2008 on XP Ultimate.
Build - Prof-UIS MBCS Debug
3. Debugging steps:
- Add the code below to the child frame (please note it doesn’t change anything in the program):
#include <crtdbg.h>
LRESULT CChildFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if (message == WM_NCPAINT)
{
::_CrtDbgReport(_CRT_WARN, NULL, NULL, "some module", "wParam - %d; lParam - %lp", wParam, lParam);
}
return CExtNCW<CMDIChildWnd>::WindowProc(message, wParam, lParam);
}
BOOL CChildFrame::DestroyWindow()
{
return CExtNCW<CMDIChildWnd>::DestroyWindow();
}
- Provide the corresponding declarations in the header.
- Put a breakpoint in CChildFrame::DestroyWindow().
- Make sure VS and ProfStudio windows do not overlap. Run the test as described above.
- Only after the breakpoint is hit, put a second breakpoint at _CrtDbgReport().
- Continue running: a sequence of 6-7 calls to WindowProc() with WM_NCPAINT as a message fill follow. After the second one , the child window is deleted only to re-occur before the subsequent steps.
If I re-run the experiment after the state is saved in the registry (i.e., stop and restart Prof Studio), the same sequence of WindowProc() with WM_NCPAINT is noticed on deletion but the child window is not deleted and redrawn! I haven’t tried to suppress the save/load state functionality...
Would it be possible for you to offer some workaround (or guidance if I am doing something wrong)?
Thank you,
Bogdan