Solved

Subcalssing MDIClient window procedure

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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…
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.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

809 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