Solved

Subcalssing MDIClient window procedure

Posted on 1997-09-06
3
323 Views
Last Modified: 2013-11-20
I would lik to subclass the MDICLient window to control painting in this area.  Is anyone able to help me do this when using MFC? Doing this using the standard C API is relatively straight forward. Thanks
0
Comment
Question by:DunX
  • 2
3 Comments
 
LVL 4

Expert Comment

by:davmarc
ID: 1305859
With MFC subclassing is maybe even easier.
Get a HWND of the MDICLIENT window and call SubclassWindow() against the window that is intended to receive the messages before the original target.

Davide Marcato.
0
 

Author Comment

by:DunX
ID: 1305860
OK! perhaps I should have been more explicit.  Strictly speaking this is the correct answer but I was hoping for a more detailed explanation of how it actually works.  All I want to do is to trap the WM_PAINT message of the MDICLIENT window and paint on it.  What I have done is create a class using the cWnd as the base class and provide this with a message handler for the OnPaint event.  In this handler I draw on the DC but get rather strange behaviour when sizing the window - repainting does not occur correctly - sometime it seems no repaint message is event sent.  Try it by simply printing text to the middle of the MDI application window.  Let me know if you have further explanation of how to achieve this - sample code would be good !! (or I can send you mine to review)  Thanks Duncan
0
 
LVL 4

Accepted Solution

by:
davmarc earned 100 total points
ID: 1305861
Maybe KB article Q129471 "How to SubClass the MDIClient by Using MFC" can help you, altough it says mostly what I explained in my first answer.

Send along your code, I'll try to find some time to review it.

Davide Marcato.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now