Solved

Subcalssing MDIClient window procedure

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

773 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