Display text in Mainwindow of an MDI apllication

Display text in Mainwindow of an MDI apllication

I have an MDI application where I display text in the Client area of the Mainwindow(i.e. in WM_PAINT message of the Mainwndproc). I would like to know if this is advisable or should I rather display text only in one of the child windows. How will the message handling differ with the two methods. I am currently having some problem with the WM_SIZE and WM_PAINT method because of this.

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Well, it's not advisable -- if you want text in main window, use SDI architecture instead. It is possible, though (but I don't recall any application which does so).

Few notes: first, in MDI framework, the grey surface you see behind child windows is not main window, but its child window of class "MDIClient"; that window serves as parent for other children and if you want to paint something, you should paint it in its WndProc/WM_PAINT (subclassed probably).

Second, in most but simplest SDI frameworks there's at least one child window which obscures entire client area of the frame window. (Try Spy++ on, say, IE, Wordpad or Notepad). In this way, various problems with interaction with toolbar, scrollbar etc. are avoided.



Leave a Comment

Please sign in to add a comment. Not a member? Join today