Solved

Subcalssing MDIClient window procedure

Posted on 1997-09-06
3
326 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
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.

895 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

15 Experts available now in Live!

Get 1:1 Help Now