CMDIChildWnd look & feel on Windows-10

删除回忆录丶 提交于 2021-02-19 05:51:51

问题


I have an MDI application. It has been developed over the years. On Windows-7 everything looks native. When I start the application on windows-10, normal dialogs will have the windows-10 look & feel. But all child views still have the Windows-7 look & feel.

I tried to change from CMDIChildWnd to CMDIChildWndEx but it made no difference to the window look & feel (except of another border style around the client rect). I do not want to change all child views to dock panes as it will change the user experience a lot. I just want to have the native look & feel for the child views.

Is this even possible? Can i easily migrate to docker windows and configure them to behave like normal windows (no docking functionality at all, min/max/restore buttons)?


回答1:


By default this isn't done. The default implementation for the MDI child windows just draws the windows in the old style.

When looking into the source code of the MFC Next stuff, it should be possible to implement it via OnNcPaint.

CMDIChildWndEx already implements OnNcPaint. And when you use a style that returns TRUE on CMFCVisualManager::GetInstance()->IsOwnerDrawCaption() the caption and the frame is already drawn by the visual manager.

All components are there. Maybe it is sufficient to force m_Impl.OnNcPaint always to be called. So create your own MDI Child window class and force the MDI system to use it. (See your doc template class).

If this isn't enough you can call all components of the visualizer to draw the frame by yourself.

PS: I just rechecked it in the BCG implementation and it was possible for me to show the MDI child windows in a different style.



来源:https://stackoverflow.com/questions/33297775/cmdichildwnd-look-feel-on-windows-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!