?
Solved

Subcalssing MDIClient window procedure

Posted on 1997-09-06
3
Medium Priority
?
342 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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. …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

752 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