English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

If you ever try to paint on the surface of a window created with CreateDialog or CreateDialogIndirect, you'll notice that it's not what you expect. Need an explanation (or link to one) of the internal details of the dialog painting mechanism as opposed to that of other windows. Preferential credit to an explanation of how to circumvent any limitations.

2006-08-03 10:33:09 · 4 answers · asked by jacinablackbox 4 in Computers & Internet Programming & Design

The IDE and code I use are not really relevant. One thing though: I create my dialog boxes wrapped in the MFC CDialog class. What I need is a thorough definition of the differences among DoModal, CreateDialog, and generic windows with respect to painting.

For example I noticed the InvalidateRect API does not work predictably on dialogs, and artifacts are left behind.

2006-08-03 16:34:42 · update #1

> the InvalidateRect command doesn't get processed until a WM_PAINT message is sent

I'm afraid that isn't accurate. Firstly, WM_PAINT messages are never "sent." Secondly, the InvalidateRect function generates a WM_PAINT message immediately (the window needn't be obscured).

At least it should. But it doesn't seem to work consistently for dialogs, as if they're filtering the messages. I need a pointer as to exactly how they do that.

2006-08-04 13:52:35 · update #2

4 answers

Okay, I think I understand the question better now.
You probably already have this, but here is a link to the msdn help for InvalidateRect. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/pantdraw_7ano.asp
One thing that I noticed in the msdn help file is that the InvalidateRect command doesn't get processed until a WM_PAINT message is sent. A way to test this to see if it is your issue is to drag your dialog off the screen and then back on. This causes a repaint. Or you could just send a WM_PAINT message.

I haven't seen any difference between modal/modeless dialogs as far as painting. For modeless, just make sure you have your PostNCDestroy defined with 'delete this;' inside.

Hope this helps. I use C++/MFC on a daily basis, but do not consider myself an expert since I've not had classes on it. I've just learned from doing.

2006-08-03 10:39:05 · answer #1 · answered by realius 2 · 0 0

Look into the Windows API. Thats about all I got time for.

2006-08-03 17:37:58 · answer #2 · answered by Special Ed 5 · 0 0

www.gadgetdetective.com

2006-08-03 17:36:09 · answer #3 · answered by cookedermott 6 · 0 0

***** **** ***** ** * **** * ** * * *********** * ****** * **** ********!

2006-08-03 17:37:47 · answer #4 · answered by Anonymous · 0 0

fedest.com, questions and answers