2

Hi my old Windows 10 app uses MFC's CMDIChildWndEx class for some of its windows, and they look about 100 years old, presumably as MDI got deprecated. But is there a way to get a more modern look? The CDialog dialogs look nice and modern after applying a simple #pragma, but this had no effect on the CMDIChildWndEx windows.

enter image description here

Apologies for repeating as this has been asked before a couple of years ago, but it never got a solution.

Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
drb01
  • 189
  • 1
  • 2
  • 17
  • MDI is a lost case. It was based on the accidental assumption, that foreign code is to be trusted. That trust was failed, time and time again, to the point where Microsoft didn't consider it to be real enough to make for a valid use case. MDI is dead. Deader than 5.25" floppy disks. Time to move on. What problem are you trying to solve? – IInspectable Jan 21 '21 at 17:05
  • I'm just trying to make my 25 yr old program look a bit more modern. The dialogs are all ok. So that leaves the CMDIChildWnd windows. Some of these are super simple windows with text and scroll bars. Another is used to display images, albeit fixed size, but there is a lot of code behind that class. I was just hoping to find a switch, or an updated class that someone has created, but I guess I am being overly optimistic. TBH my knowledge of MFC is pretty limited (I had someone else write most of the GUI code) so any solution is going to have to be pretty simple .. – drb01 Jan 21 '21 at 17:27
  • 1
    @drb01 You could tab it or dock it, then you'll see less of that classical non-client area. – dxiv Jan 21 '21 at 17:55
  • Here's my inexperience in MFC ... Is there an easy to tab/dock, or does it take a lot of code rewriting? – drb01 Jan 21 '21 at 18:30
  • @drb01 Check out [MDI Tabbed Groups](https://learn.microsoft.com/en-us/cpp/mfc/mdi-tabbed-groups?view=msvc-160) and [`CMDIFrameWndEx::EnableDocking`](https://learn.microsoft.com/en-us/cpp/mfc/reference/cmdiframewndex-class?view=msvc-160#enabledocking). – dxiv Jan 21 '21 at 22:47
  • Thought: Create a new MDI test project with VS2019 and see the look and feel. Is it better? If so, locate the difference? Possibly app manifest content in the stdafx header. – Andrew Truckle Jan 22 '21 at 05:44
  • In VS2019 I created an MFC app, Multiple Documents. I disabled Tabbed Docs, Document/View Architecture support, Visual Style=Windows Native. Command Bar=Use a Classic Menu, Classic Menu Options=None. I get the same old style window as my app (see pic in original post). I tried other options and I get tabbed windows instead, but I need floating windows.. – drb01 Jan 22 '21 at 15:31
  • @IInspectable MDI is dead? I still use it a lot, easy to show multiple views for the same document.(Tabbed-MDI). What is the new way today? A CView with a hosted CTabCtrl? – Tom Tom Jan 23 '21 at 08:41
  • 1
    @tom I'm not saying that MDI is dead because it weren't useful. The concept is still being used all over the place (every code editor does, for example). It's dead because the technology didn't age well (see [MDI](https://learn.microsoft.com/en-us/windows/win32/winmsg/multiple-document-interface) for rationale). The 'new' way is to either launch every document into its own application instance (like Office does), or provide tabs that switch between documents that take up the entire client area (commonly employed by browsers). – IInspectable Jan 23 '21 at 09:45
  • 1
    Also, having multiple views into the same document doesn't require MDI. That's part of the Document-View architecture. – IInspectable Jan 23 '21 at 09:45
  • @IInspectable, altough it is named as MDI, we can it use for only one document. (I use always one). I use MDI because the support for multiple views (Tabbed views) is very great and in simple manner. – Tom Tom Jan 24 '21 at 21:24

0 Answers0