Hi, this has been driving me mad for a week or two, but our view keeps repainting repeatedly. I eventually tracked it down to the following sequence of events:
- The WM_MDIREFRESHMENU message keeps being sent to the MDI tabs window.
- ProfUIS catches this in CExtTMWI::OnHookWndMsg() and sets the __EXTTAB_MDI_UPDATE_TIMER_ID timer.
- The timer event is handled in CExtTMWI::WindowProc(), and calls _SyncAllItems()
- Downstream from this I think RecalcLayout() gets called and that probably causes a repaint of the current view itself.
It’s only in some types of view we have that this happens. My guess is that I redraw and the window is marked as valid, but the timer is set before this and acted on after this, causing a loop.
First, why does WM_MDIREFRESHMENU ever cause a redraw of the view? Especially when nothing in the menu has changed. I don’t even know why that event keeps arriving.
Second, why is a timer used at all?? It seems a really bad way to delay an update till there’s a spare moment. Isn’t OnIdle() the place for this? Seems like a much safer way to do things.
Any other thoughts about why this is happening? Currently I am overriding OnHookWndMsg() to catch the WM_MDIREFRESHMENU event and ignore it, and the MDI tabs bar menu still seems to remain valid, but I’m sure this is just hiding the real problem rather than fixing it. And since doing it I have other problems, but not sure if they’re related.
Thanks,
Rob.