[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

WM_PAINT not sent to descendants?

Posted on 2004-10-15
4
Medium Priority
?
766 Views
Last Modified: 2013-11-20
Experts,

I recently discovered the true answer to the question I asked in a recent post:

http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_21157382.html

The actual problem was that the m_pMainWnd of the application was the owner of these popup windows.  When it closed evidentally the parent window did in fact repaint, but the children (who cover most of the parent) did not.  It seems that WM_PAINT messages were not relayed from the parent to the child.  I would have thought that MFC would automatically send this message along to them.  I was able to easily send it myself, since I had already overridden the WindowProc as follows:

//Broadcast custom defined messages to all windows
if(message>=WM_APP && message<=0xBFFF){
      SendMessageToDescendants(message, wParam, lParam, TRUE, TRUE);
}

return CDialog::WindowProc(message, wParam, lParam);

This wouldn't have interrupted the sending of WM_PAINT to descendants.

I really would have thought that MFC would take care of this itself.  Have I messed something up that prohibits it from doing this or are you really required to do this yourself using a method like the one above?

Thanks,
David John
0
Comment
Question by:david_johns
[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
4 Comments
 
LVL 2

Accepted Solution

by:
Ruskialt earned 200 total points
ID: 12372682
I can't find a reason for ever posting a paint message. You can call Invalidate() on the window that need repainting, and the system will shortly send paint messages for display updates. I don't think paint message have to come from the parent. Paint messages are also send to windows if you draw another window over it. The system usually takes care of who need be repainted...
0
 

Author Comment

by:david_johns
ID: 12561667
Experts, DanRollins,

I recommend to delete the question since no answer was ever given.  Unless I am just not reading between the lines, Ruskialt's comment just said that this should never happen, but did not propose a way to fix the problem I am having.  If someone wants to make a more directive statement on what I need to do I am happy to accept it and reward them with the points.

Thanks,
David
0
 
LVL 2

Expert Comment

by:Ruskialt
ID: 12563054
Fair enough, my statement won't help you much except for confirming to you that you are probably on the wrong track, since you should never have to send paint messages. Some questionable design decisions are probably to be found elsewhere in your application - hard to say where.

No harm cancelling the points :-)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

649 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