Order of Parent / Child WM_PAINT messages

I have a parent window (CFormView) that contains child controls (such as 
CEdit, CButton, etc...).  I need to do some drawing in the parent window 
after all the child controls are painted.  Currently, the parent receives 
WM_PAINT first, and then all of the child controls are painted over what I 
just drew in the parent window.  How do I know when all of the child 
controls are done painting so I can then draw in the parent?  Changing z 
order of the parent doesn't seem to help.  Thanks.

Timothy Dean 


0
tim.dean (3)
11/28/2007 1:44:58 AM
vc.mfc 33608 articles. 0 followers. Follow

8 Replies
627 Views

Similar Articles

[PageSpeed] 59

They happen in some order.  There is no reason to assume any order dependency exists.

You should create the parent with the WS_CLIPCHILDREN style.

It is rare to ever draw on a CFormView directly.
					joe

On Tue, 27 Nov 2007 18:44:58 -0700, "Timothy Dean" <tim.dean@mobiledataforce.com> wrote:

>I have a parent window (CFormView) that contains child controls (such as 
>CEdit, CButton, etc...).  I need to do some drawing in the parent window 
>after all the child controls are painted.  Currently, the parent receives 
>WM_PAINT first, and then all of the child controls are painted over what I 
>just drew in the parent window.  How do I know when all of the child 
>controls are done painting so I can then draw in the parent?  Changing z 
>order of the parent doesn't seem to help.  Thanks.
>
>Timothy Dean 
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
11/28/2007 6:28:57 AM
Depending on what you "write" onto the view you may want to consider just 
doing a custom control or using a control (like a CStatic) to contain your 
custom stuff.  That way it is easier to manage.  You can, of course, do 
things like write on the background or change background color, etc. pretty 
easily, but if you are extending a control I think it should be part of the 
control and not the view.

Tom

"Timothy Dean" <tim.dean@mobiledataforce.com> wrote in message 
news:uQh1JBWMIHA.1188@TK2MSFTNGP04.phx.gbl...
>I have a parent window (CFormView) that contains child controls (such as 
>CEdit, CButton, etc...).  I need to do some drawing in the parent window 
>after all the child controls are painted.  Currently, the parent receives 
>WM_PAINT first, and then all of the child controls are painted over what I 
>just drew in the parent window.  How do I know when all of the child 
>controls are done painting so I can then draw in the parent?  Changing z 
>order of the parent doesn't seem to help.  Thanks.
>
> Timothy Dean
> 

0
tom.nospam (3240)
11/28/2007 3:58:13 PM
This is drawing that I have to do on top of other controls to "decorate" 
them.  The controls are actually contained in another CWnd that is contained 
inside the form view.  Once all of the child windows contained in the form 
are painted, I then need to do drawing on top of the controls in a type of 
layered system (similar to AutoCAD).  Whether or not I draw to the view 
isn't the issue.  I could contain everthing in another CWnd, but I would 
still have the same problem.  The parent CWnd or CFormView receives the 
paint first, and then all of the child windows receive the paint message. 
How would I draw something to the parent window that will overlap any child 
controls?  If I could somehow get the paint message sent to the parent last, 
everything would be ok.  Is there a way to change the z order that would 
control the order?  Would I be better off creating another CWnd that would 
overlap all of the other controls, but would be a sibling instead of a 
parent to all the other controls?  Thanks.

Timothy Dean

"Tom Serface" <tom.nospam@camaswood.com> wrote in message 
news:262C18CA-05A8-4FA7-B232-E0BE41F7FD39@microsoft.com...
> Depending on what you "write" onto the view you may want to consider just 
> doing a custom control or using a control (like a CStatic) to contain your 
> custom stuff.  That way it is easier to manage.  You can, of course, do 
> things like write on the background or change background color, etc. 
> pretty easily, but if you are extending a control I think it should be 
> part of the control and not the view.
>
> Tom
>
> "Timothy Dean" <tim.dean@mobiledataforce.com> wrote in message 
> news:uQh1JBWMIHA.1188@TK2MSFTNGP04.phx.gbl...
>>I have a parent window (CFormView) that contains child controls (such as 
>>CEdit, CButton, etc...).  I need to do some drawing in the parent window 
>>after all the child controls are painted.  Currently, the parent receives 
>>WM_PAINT first, and then all of the child controls are painted over what I 
>>just drew in the parent window.  How do I know when all of the child 
>>controls are done painting so I can then draw in the parent?  Changing z 
>>order of the parent doesn't seem to help.  Thanks.
>>
>> Timothy Dean
>>
> 


0
tim.dean (3)
11/28/2007 10:58:36 PM
I've never tried to do what you're doing, but if I were to do it I'd 
probably still try to use something like a CStatic (transparent) then draw 
what I needed on the control.  You may find Ali's article to be interesting:

http://www.codeproject.com/staticctrl/TransparentStaticCtrl.asp

Tom

"Timothy Dean" <tim.dean@mobiledataforce.com> wrote in message 
news:e74b3IhMIHA.5904@TK2MSFTNGP02.phx.gbl...
> This is drawing that I have to do on top of other controls to "decorate" 
> them.  The controls are actually contained in another CWnd that is 
> contained inside the form view.  Once all of the child windows contained 
> in the form are painted, I then need to do drawing on top of the controls 
> in a type of layered system (similar to AutoCAD).  Whether or not I draw 
> to the view isn't the issue.  I could contain everthing in another CWnd, 
> but I would still have the same problem.  The parent CWnd or CFormView 
> receives the paint first, and then all of the child windows receive the 
> paint message. How would I draw something to the parent window that will 
> overlap any child controls?  If I could somehow get the paint message sent 
> to the parent last, everything would be ok.  Is there a way to change the 
> z order that would control the order?  Would I be better off creating 
> another CWnd that would overlap all of the other controls, but would be a 
> sibling instead of a parent to all the other controls?  Thanks.
>
> Timothy Dean

0
tom.nospam (3240)
11/29/2007 12:34:10 AM
Bad idea; you cannot draw onto other controls; only the other controls OnPaint handlers
can draw on the other controls.  There is no possible way you could know when to decorate
a control.  There is no support for layering as you describe.

You would have to subclass the controls, intercept the OnPaint notifications, and handle
them there, which is nontrivial in and of itself, but take it that without doing this it
is IMPOSSIBLE to know when a control redraws itself.  Or you could use an in-process hook
function to accomplish this. But you can safely assume that (a) you have no control over
drawing order and (b) no idea when to draw anything anywhere under any conditions, unless
you know when the WM_PAINT message comes in for that control!  While it may appear that
there is an order to the messages, there are lots of ways this order can change, so you
can't rely on it.  Z-order is irrelevant because the parent dialog is implicitly below
every other control and this cannot be changed.

If you place some other control on top of the control, it would have to be a transparent,
non-responsive, CStatic, and you would have to invalidate it whenever you intercepted a
WM_PAINT for the control it covers...and that's just a guess on my part that it could be
made to work at all.  And I'm not sure that would work, anyway.  Windows just has too many
assumptions built in that you are trying to violate all over the place, and therefore you
are fighting the basic design of the system.

Why don't the controls decorate themselves?  You are trying to accomplish something that
is not really supported by the fundamental operating system, and most attempts to achieve
what you want that do not involve actually subclassing the controls themselves, and in the
case of WM_PAINT this is a really, really dangerous thing to do, is likely going to be
doomed.
				joe

On Wed, 28 Nov 2007 15:58:36 -0700, "Timothy Dean" <tim.dean@mobiledataforce.com> wrote:

>This is drawing that I have to do on top of other controls to "decorate" 
>them.  The controls are actually contained in another CWnd that is contained 
>inside the form view.  Once all of the child windows contained in the form 
>are painted, I then need to do drawing on top of the controls in a type of 
>layered system (similar to AutoCAD).  Whether or not I draw to the view 
>isn't the issue.  I could contain everthing in another CWnd, but I would 
>still have the same problem.  The parent CWnd or CFormView receives the 
>paint first, and then all of the child windows receive the paint message. 
>How would I draw something to the parent window that will overlap any child 
>controls?  If I could somehow get the paint message sent to the parent last, 
>everything would be ok.  Is there a way to change the z order that would 
>control the order?  Would I be better off creating another CWnd that would 
>overlap all of the other controls, but would be a sibling instead of a 
>parent to all the other controls?  Thanks.
>
>Timothy Dean
>
>"Tom Serface" <tom.nospam@camaswood.com> wrote in message 
>news:262C18CA-05A8-4FA7-B232-E0BE41F7FD39@microsoft.com...
>> Depending on what you "write" onto the view you may want to consider just 
>> doing a custom control or using a control (like a CStatic) to contain your 
>> custom stuff.  That way it is easier to manage.  You can, of course, do 
>> things like write on the background or change background color, etc. 
>> pretty easily, but if you are extending a control I think it should be 
>> part of the control and not the view.
>>
>> Tom
>>
>> "Timothy Dean" <tim.dean@mobiledataforce.com> wrote in message 
>> news:uQh1JBWMIHA.1188@TK2MSFTNGP04.phx.gbl...
>>>I have a parent window (CFormView) that contains child controls (such as 
>>>CEdit, CButton, etc...).  I need to do some drawing in the parent window 
>>>after all the child controls are painted.  Currently, the parent receives 
>>>WM_PAINT first, and then all of the child controls are painted over what I 
>>>just drew in the parent window.  How do I know when all of the child 
>>>controls are done painting so I can then draw in the parent?  Changing z 
>>>order of the parent doesn't seem to help.  Thanks.
>>>
>>> Timothy Dean
>>>
>> 
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
11/29/2007 2:34:59 AM
Thanks.  That is helpful to know.  The controls I am decorating are already 
custom controls.  The controls actually do decorate themselves, but they 
can't draw the decorations to their own window.  The reason is that the 
decorations actually exceed the boundry of each controls window.  The 
decorations for a single control overlap itself as well as other adjacent 
controls.  It seems like the answer is to create another window drawn over 
the entire page of controls.  This window would be a sibling to the controls 
and drawn last.

Timothy Dean


"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
news:9t8sk39qhvo8kuptvipf5ceffl06up5v32@4ax.com...
> Bad idea; you cannot draw onto other controls; only the other controls 
> OnPaint handlers
> can draw on the other controls.  There is no possible way you could know 
> when to decorate
> a control.  There is no support for layering as you describe.
>
> You would have to subclass the controls, intercept the OnPaint 
> notifications, and handle
> them there, which is nontrivial in and of itself, but take it that without 
> doing this it
> is IMPOSSIBLE to know when a control redraws itself.  Or you could use an 
> in-process hook
> function to accomplish this. But you can safely assume that (a) you have 
> no control over
> drawing order and (b) no idea when to draw anything anywhere under any 
> conditions, unless
> you know when the WM_PAINT message comes in for that control!  While it 
> may appear that
> there is an order to the messages, there are lots of ways this order can 
> change, so you
> can't rely on it.  Z-order is irrelevant because the parent dialog is 
> implicitly below
> every other control and this cannot be changed.
>
> If you place some other control on top of the control, it would have to be 
> a transparent,
> non-responsive, CStatic, and you would have to invalidate it whenever you 
> intercepted a
> WM_PAINT for the control it covers...and that's just a guess on my part 
> that it could be
> made to work at all.  And I'm not sure that would work, anyway.  Windows 
> just has too many
> assumptions built in that you are trying to violate all over the place, 
> and therefore you
> are fighting the basic design of the system.
>
> Why don't the controls decorate themselves?  You are trying to accomplish 
> something that
> is not really supported by the fundamental operating system, and most 
> attempts to achieve
> what you want that do not involve actually subclassing the controls 
> themselves, and in the
> case of WM_PAINT this is a really, really dangerous thing to do, is likely 
> going to be
> doomed.
> joe
>
> On Wed, 28 Nov 2007 15:58:36 -0700, "Timothy Dean" 
> <tim.dean@mobiledataforce.com> wrote:
>
>>This is drawing that I have to do on top of other controls to "decorate"
>>them.  The controls are actually contained in another CWnd that is 
>>contained
>>inside the form view.  Once all of the child windows contained in the form
>>are painted, I then need to do drawing on top of the controls in a type of
>>layered system (similar to AutoCAD).  Whether or not I draw to the view
>>isn't the issue.  I could contain everthing in another CWnd, but I would
>>still have the same problem.  The parent CWnd or CFormView receives the
>>paint first, and then all of the child windows receive the paint message.
>>How would I draw something to the parent window that will overlap any 
>>child
>>controls?  If I could somehow get the paint message sent to the parent 
>>last,
>>everything would be ok.  Is there a way to change the z order that would
>>control the order?  Would I be better off creating another CWnd that would
>>overlap all of the other controls, but would be a sibling instead of a
>>parent to all the other controls?  Thanks.
>>
>>Timothy Dean
>>
>>"Tom Serface" <tom.nospam@camaswood.com> wrote in message
>>news:262C18CA-05A8-4FA7-B232-E0BE41F7FD39@microsoft.com...
>>> Depending on what you "write" onto the view you may want to consider 
>>> just
>>> doing a custom control or using a control (like a CStatic) to contain 
>>> your
>>> custom stuff.  That way it is easier to manage.  You can, of course, do
>>> things like write on the background or change background color, etc.
>>> pretty easily, but if you are extending a control I think it should be
>>> part of the control and not the view.
>>>
>>> Tom
>>>
>>> "Timothy Dean" <tim.dean@mobiledataforce.com> wrote in message
>>> news:uQh1JBWMIHA.1188@TK2MSFTNGP04.phx.gbl...
>>>>I have a parent window (CFormView) that contains child controls (such as
>>>>CEdit, CButton, etc...).  I need to do some drawing in the parent window
>>>>after all the child controls are painted.  Currently, the parent 
>>>>receives
>>>>WM_PAINT first, and then all of the child controls are painted over what 
>>>>I
>>>>just drew in the parent window.  How do I know when all of the child
>>>>controls are done painting so I can then draw in the parent?  Changing z
>>>>order of the parent doesn't seem to help.  Thanks.
>>>>
>>>> Timothy Dean
>>>>
>>>
>>
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm 


0
tim.dean (3)
11/29/2007 6:20:24 PM
Well, up to but not including Vista, you actually can do this, because of a design error
in Windows: most controls use CS_PARENTDC, which means the DC has a clipping region
equivalent to the parent clipping region.  But they fixed this design defect in Vista.

There are a couple ways to handle this.  For example, you could use a "buddy" window, a
CStatic that was of the desired size and which was the immediate predecessor in the
Z-order.  So the custom control would then get the previous control in the Z-order, and
SendMessage a user-defined message to it.  This control would simply draw itself.  If the
dialog has WS_CLIPSIBLINGS, then it will not overwrite its sibling control.  If I wanted
to do this, that's the approach I'd take.  Note that if the immediate sibling is NOT one
of your magical decoration CStatics, then the message will be ignored (I would not use
other than a RegisteredWindowMessage message for this).  Or, you could have a "master"
CStatic that covered the entire dialog, and you would SendMessage the handle or CWnd* of
your current control.  From this handle or CWnd*, you can GetWindowRect, ScreenToClient,
expand the resulting rectangle by the size of the decoration, Invalidate that area, and
just let that window redraw.  It would query each custom control by doing a SendMessage of
a RegisteredWindowMessage, saying "please tell me about your decorations" and the LRESULT
would either be NULL ("no decorations, or I'm not one of your custom windows") or a
pointer to some useful information that tells it what decorations to add.  Both of these
are substantially easier than most other approaches I can think of.
					joe

On Thu, 29 Nov 2007 11:20:24 -0700, "Timothy Dean" <tim.dean@mobiledataforce.com> wrote:

>Thanks.  That is helpful to know.  The controls I am decorating are already 
>custom controls.  The controls actually do decorate themselves, but they 
>can't draw the decorations to their own window.  The reason is that the 
>decorations actually exceed the boundry of each controls window.  The 
>decorations for a single control overlap itself as well as other adjacent 
>controls.  It seems like the answer is to create another window drawn over 
>the entire page of controls.  This window would be a sibling to the controls 
>and drawn last.
>
>Timothy Dean
>
>
>"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
>news:9t8sk39qhvo8kuptvipf5ceffl06up5v32@4ax.com...
>> Bad idea; you cannot draw onto other controls; only the other controls 
>> OnPaint handlers
>> can draw on the other controls.  There is no possible way you could know 
>> when to decorate
>> a control.  There is no support for layering as you describe.
>>
>> You would have to subclass the controls, intercept the OnPaint 
>> notifications, and handle
>> them there, which is nontrivial in and of itself, but take it that without 
>> doing this it
>> is IMPOSSIBLE to know when a control redraws itself.  Or you could use an 
>> in-process hook
>> function to accomplish this. But you can safely assume that (a) you have 
>> no control over
>> drawing order and (b) no idea when to draw anything anywhere under any 
>> conditions, unless
>> you know when the WM_PAINT message comes in for that control!  While it 
>> may appear that
>> there is an order to the messages, there are lots of ways this order can 
>> change, so you
>> can't rely on it.  Z-order is irrelevant because the parent dialog is 
>> implicitly below
>> every other control and this cannot be changed.
>>
>> If you place some other control on top of the control, it would have to be 
>> a transparent,
>> non-responsive, CStatic, and you would have to invalidate it whenever you 
>> intercepted a
>> WM_PAINT for the control it covers...and that's just a guess on my part 
>> that it could be
>> made to work at all.  And I'm not sure that would work, anyway.  Windows 
>> just has too many
>> assumptions built in that you are trying to violate all over the place, 
>> and therefore you
>> are fighting the basic design of the system.
>>
>> Why don't the controls decorate themselves?  You are trying to accomplish 
>> something that
>> is not really supported by the fundamental operating system, and most 
>> attempts to achieve
>> what you want that do not involve actually subclassing the controls 
>> themselves, and in the
>> case of WM_PAINT this is a really, really dangerous thing to do, is likely 
>> going to be
>> doomed.
>> joe
>>
>> On Wed, 28 Nov 2007 15:58:36 -0700, "Timothy Dean" 
>> <tim.dean@mobiledataforce.com> wrote:
>>
>>>This is drawing that I have to do on top of other controls to "decorate"
>>>them.  The controls are actually contained in another CWnd that is 
>>>contained
>>>inside the form view.  Once all of the child windows contained in the form
>>>are painted, I then need to do drawing on top of the controls in a type of
>>>layered system (similar to AutoCAD).  Whether or not I draw to the view
>>>isn't the issue.  I could contain everthing in another CWnd, but I would
>>>still have the same problem.  The parent CWnd or CFormView receives the
>>>paint first, and then all of the child windows receive the paint message.
>>>How would I draw something to the parent window that will overlap any 
>>>child
>>>controls?  If I could somehow get the paint message sent to the parent 
>>>last,
>>>everything would be ok.  Is there a way to change the z order that would
>>>control the order?  Would I be better off creating another CWnd that would
>>>overlap all of the other controls, but would be a sibling instead of a
>>>parent to all the other controls?  Thanks.
>>>
>>>Timothy Dean
>>>
>>>"Tom Serface" <tom.nospam@camaswood.com> wrote in message
>>>news:262C18CA-05A8-4FA7-B232-E0BE41F7FD39@microsoft.com...
>>>> Depending on what you "write" onto the view you may want to consider 
>>>> just
>>>> doing a custom control or using a control (like a CStatic) to contain 
>>>> your
>>>> custom stuff.  That way it is easier to manage.  You can, of course, do
>>>> things like write on the background or change background color, etc.
>>>> pretty easily, but if you are extending a control I think it should be
>>>> part of the control and not the view.
>>>>
>>>> Tom
>>>>
>>>> "Timothy Dean" <tim.dean@mobiledataforce.com> wrote in message
>>>> news:uQh1JBWMIHA.1188@TK2MSFTNGP04.phx.gbl...
>>>>>I have a parent window (CFormView) that contains child controls (such as
>>>>>CEdit, CButton, etc...).  I need to do some drawing in the parent window
>>>>>after all the child controls are painted.  Currently, the parent 
>>>>>receives
>>>>>WM_PAINT first, and then all of the child controls are painted over what 
>>>>>I
>>>>>just drew in the parent window.  How do I know when all of the child
>>>>>controls are done painting so I can then draw in the parent?  Changing z
>>>>>order of the parent doesn't seem to help.  Thanks.
>>>>>
>>>>> Timothy Dean
>>>>>
>>>>
>>>
>> Joseph M. Newcomer [MVP]
>> email: newcomer@flounder.com
>> Web: http://www.flounder.com
>> MVP Tips: http://www.flounder.com/mvp_tips.htm 
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
11/30/2007 12:28:34 AM
Alternatively, the "buddy", in its WM_PAINT handler, could SendMessage to the control "on
its right" to ask it what decorations need to be provided.
					joe

On Thu, 29 Nov 2007 19:28:34 -0500, Joseph M. Newcomer <newcomer@flounder.com> wrote:

>Well, up to but not including Vista, you actually can do this, because of a design error
>in Windows: most controls use CS_PARENTDC, which means the DC has a clipping region
>equivalent to the parent clipping region.  But they fixed this design defect in Vista.
>
>There are a couple ways to handle this.  For example, you could use a "buddy" window, a
>CStatic that was of the desired size and which was the immediate predecessor in the
>Z-order.  So the custom control would then get the previous control in the Z-order, and
>SendMessage a user-defined message to it.  This control would simply draw itself.  If the
>dialog has WS_CLIPSIBLINGS, then it will not overwrite its sibling control.  If I wanted
>to do this, that's the approach I'd take.  Note that if the immediate sibling is NOT one
>of your magical decoration CStatics, then the message will be ignored (I would not use
>other than a RegisteredWindowMessage message for this).  Or, you could have a "master"
>CStatic that covered the entire dialog, and you would SendMessage the handle or CWnd* of
>your current control.  From this handle or CWnd*, you can GetWindowRect, ScreenToClient,
>expand the resulting rectangle by the size of the decoration, Invalidate that area, and
>just let that window redraw.  It would query each custom control by doing a SendMessage of
>a RegisteredWindowMessage, saying "please tell me about your decorations" and the LRESULT
>would either be NULL ("no decorations, or I'm not one of your custom windows") or a
>pointer to some useful information that tells it what decorations to add.  Both of these
>are substantially easier than most other approaches I can think of.
>					joe
>
>On Thu, 29 Nov 2007 11:20:24 -0700, "Timothy Dean" <tim.dean@mobiledataforce.com> wrote:
>
>>Thanks.  That is helpful to know.  The controls I am decorating are already 
>>custom controls.  The controls actually do decorate themselves, but they 
>>can't draw the decorations to their own window.  The reason is that the 
>>decorations actually exceed the boundry of each controls window.  The 
>>decorations for a single control overlap itself as well as other adjacent 
>>controls.  It seems like the answer is to create another window drawn over 
>>the entire page of controls.  This window would be a sibling to the controls 
>>and drawn last.
>>
>>Timothy Dean
>>
>>
>>"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
>>news:9t8sk39qhvo8kuptvipf5ceffl06up5v32@4ax.com...
>>> Bad idea; you cannot draw onto other controls; only the other controls 
>>> OnPaint handlers
>>> can draw on the other controls.  There is no possible way you could know 
>>> when to decorate
>>> a control.  There is no support for layering as you describe.
>>>
>>> You would have to subclass the controls, intercept the OnPaint 
>>> notifications, and handle
>>> them there, which is nontrivial in and of itself, but take it that without 
>>> doing this it
>>> is IMPOSSIBLE to know when a control redraws itself.  Or you could use an 
>>> in-process hook
>>> function to accomplish this. But you can safely assume that (a) you have 
>>> no control over
>>> drawing order and (b) no idea when to draw anything anywhere under any 
>>> conditions, unless
>>> you know when the WM_PAINT message comes in for that control!  While it 
>>> may appear that
>>> there is an order to the messages, there are lots of ways this order can 
>>> change, so you
>>> can't rely on it.  Z-order is irrelevant because the parent dialog is 
>>> implicitly below
>>> every other control and this cannot be changed.
>>>
>>> If you place some other control on top of the control, it would have to be 
>>> a transparent,
>>> non-responsive, CStatic, and you would have to invalidate it whenever you 
>>> intercepted a
>>> WM_PAINT for the control it covers...and that's just a guess on my part 
>>> that it could be
>>> made to work at all.  And I'm not sure that would work, anyway.  Windows 
>>> just has too many
>>> assumptions built in that you are trying to violate all over the place, 
>>> and therefore you
>>> are fighting the basic design of the system.
>>>
>>> Why don't the controls decorate themselves?  You are trying to accomplish 
>>> something that
>>> is not really supported by the fundamental operating system, and most 
>>> attempts to achieve
>>> what you want that do not involve actually subclassing the controls 
>>> themselves, and in the
>>> case of WM_PAINT this is a really, really dangerous thing to do, is likely 
>>> going to be
>>> doomed.
>>> joe
>>>
>>> On Wed, 28 Nov 2007 15:58:36 -0700, "Timothy Dean" 
>>> <tim.dean@mobiledataforce.com> wrote:
>>>
>>>>This is drawing that I have to do on top of other controls to "decorate"
>>>>them.  The controls are actually contained in another CWnd that is 
>>>>contained
>>>>inside the form view.  Once all of the child windows contained in the form
>>>>are painted, I then need to do drawing on top of the controls in a type of
>>>>layered system (similar to AutoCAD).  Whether or not I draw to the view
>>>>isn't the issue.  I could contain everthing in another CWnd, but I would
>>>>still have the same problem.  The parent CWnd or CFormView receives the
>>>>paint first, and then all of the child windows receive the paint message.
>>>>How would I draw something to the parent window that will overlap any 
>>>>child
>>>>controls?  If I could somehow get the paint message sent to the parent 
>>>>last,
>>>>everything would be ok.  Is there a way to change the z order that would
>>>>control the order?  Would I be better off creating another CWnd that would
>>>>overlap all of the other controls, but would be a sibling instead of a
>>>>parent to all the other controls?  Thanks.
>>>>
>>>>Timothy Dean
>>>>
>>>>"Tom Serface" <tom.nospam@camaswood.com> wrote in message
>>>>news:262C18CA-05A8-4FA7-B232-E0BE41F7FD39@microsoft.com...
>>>>> Depending on what you "write" onto the view you may want to consider 
>>>>> just
>>>>> doing a custom control or using a control (like a CStatic) to contain 
>>>>> your
>>>>> custom stuff.  That way it is easier to manage.  You can, of course, do
>>>>> things like write on the background or change background color, etc.
>>>>> pretty easily, but if you are extending a control I think it should be
>>>>> part of the control and not the view.
>>>>>
>>>>> Tom
>>>>>
>>>>> "Timothy Dean" <tim.dean@mobiledataforce.com> wrote in message
>>>>> news:uQh1JBWMIHA.1188@TK2MSFTNGP04.phx.gbl...
>>>>>>I have a parent window (CFormView) that contains child controls (such as
>>>>>>CEdit, CButton, etc...).  I need to do some drawing in the parent window
>>>>>>after all the child controls are painted.  Currently, the parent 
>>>>>>receives
>>>>>>WM_PAINT first, and then all of the child controls are painted over what 
>>>>>>I
>>>>>>just drew in the parent window.  How do I know when all of the child
>>>>>>controls are done painting so I can then draw in the parent?  Changing z
>>>>>>order of the parent doesn't seem to help.  Thanks.
>>>>>>
>>>>>> Timothy Dean
>>>>>>
>>>>>
>>>>
>>> Joseph M. Newcomer [MVP]
>>> email: newcomer@flounder.com
>>> Web: http://www.flounder.com
>>> MVP Tips: http://www.flounder.com/mvp_tips.htm 
>>
>Joseph M. Newcomer [MVP]
>email: newcomer@flounder.com
>Web: http://www.flounder.com
>MVP Tips: http://www.flounder.com/mvp_tips.htm
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
11/30/2007 6:57:04 AM
Reply:

Similar Artilces:

Infreqent error posting SOAP message ( 0x800A1518 )
I am getting occasional errors when invoking calls on the low level API of the SOAP library (3.0 Toolkit). The HRESULT code is always 0x800A1518. The _com_error Description is "Connector:Http error while parsing server's response. HRESULT=0x800A1526 - Connector:Unspecified HTTP error. HRESULT=0x800A1518". The _com_error ErrorMessage is "Unknown error 0x800A1518". The specific method that I am noticing the error on is with EndMessage( ) of an HttpConnector30 object. The second or third attempt at repeating just the EndMessage method will frequently be succes...

Order Management Error
Hi All! We are testing if we can use BP3 for our customers to enter their orders, everything goes well until the point when we click the Check Out button to complete the order, then we get an error, "The order cannot be processed at this time. Please try again later.", then when we look at Event viewer to see the details, there's "The Microsoft Business Framework must be started using EnterpriseSession.Initialize()." on the description. Any ideas on how to get around this issue? Zama, Can you confirm the event is directly related to clicking the "Check Out&...

Pop Up Message
Is it possable to have a pop up message appear when a user clicks into a field something like "Data Requires Review"? The message would also need to close when user tabs to next field. Can this be done? acss, You could use the OnEnter event to trigger a dialog box (MsgBox). The user would close the dialog box manually. Or, place your message (Text Control or Label) somewhere on the form, and make it Visible = No. On the OnEnter, make that Visible = Yes, and OnExit make it Visible = No. That would require no user intervention at all. -- hth Al Campagna Access MVP 2007...

Tab order for purchase orders and sales orders
Is there a way to set the tab order while entering items in a purchase order and sales order. My client would like to be able to have the order taker be able to be prompted for a quantity while entering in line items to purchase orders and sales orders. Marc, For POS, enter the quantity first, then the * key, then the ILC So for 5 of 11212, enter 5*11212 <enter> For PO's see if QuickScan works better for you. -- * "Marc Arbesman" <MarcArbesman@discussions.microsoft.com> wrote in message news:05BD48AA-08BB-4CFE-A04D-46BBCC5B95CC@microsoft.com... Is there a w...

Modify back order transfer to order process
Got a question for anyone who is familiar with the transfer process from back order to order. I'd like to make a modification in that process to clear the PICTICNU and PCKSLPNO fields in SOP10100 for the new SOP order created. Currently those fields retain the values from the original SOP order. Has anyone made a similar mod? Any pointers? Thanks. -- Jim@TurboChef Jim - I am assuming you are on Version 8 or higher. Go to Tools - Setup - Sales - Sales Order Processing On this window, click on the numbers button - the last two options are Packing Slip and Picking Ticket. You pr...

Outlook REPLY-original messages CORRUPTED
--------------D331DED46FA3E7C0416BE9C9 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit When replying to an email, the sender's portion gets lost... Sequence of events: I send a msg to correspondant. Correspondant replies I get reply. It contains both her msg and my original message. I press reply. The msg displayed for me to reply contains my original message, but NOT Correspondant's reply. What is happenning and how can be fixed? Leo --------------D331DED46FA3E7C0416BE9C9 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit <!d...

How to edit a message header on email received?
I would like to be able to edit an email message header that I receive in Outlook to make it more meaningful to me. Lobelia <Lobelia@discussions.microsoft.com> wrote: > I would like to be able to edit an email message header that I > receive in Outlook to make it more meaningful to me. What header do you wish to edit? -- Brian Tillman ...

Deleting a posted message
Is there a way I can delete a posted message OR at least take my email off. I have mistakenly given my email and have been receiving spam like anything. It would be really helpful if the admins of this group can help me delete that specific post. Use the .NET serializer to turn it to a string . Use the .Whatever in 2005, asking for MS for Permission to post an 'unmanaged' question. "Neo" <anonymous@discussions.microsoft.com> wrote in message news:026501c3a56a$f77b3870$a401280a@phx.gbl... > Is there a way I can delete a posted message OR at least > ...

error messages in Outlook ????
I just installed Outlook as part of Office 2003 and am trying to set it up as my email reader onto POP3 accounts. I have set up my accounts / passwords/ incoming & outoing servers / etc, but it will not send / retrieve email. I get a message that says "Operation failed. An object could not be found." What does this mean? I can't figure out how to make the darn program work. This is infuriating. Are you using the Test Account Settings button when setting up your account? Try creating a fresh mail profile here: Control Panel->MAil Icon->Show Profiles->New....

Error Message 10-24-07
I cannot now run Windows Media Player because I keep getting a error message that reads C00D11B1. I have tried to uninstall the programme and reinstall but it will no allow Any solutions Terry This newsgroup is dedicated to supporting Microsoft Access, the database product. Try posting in a Media Player newsgroup. Regards Jeff Boyce Microsoft Office/Access MVP "terryingle" <terryingle@ntlworld.com> wrote in message news:%23gRxbrkFIHA.4228@TK2MSFTNGP02.phx.gbl... >I cannot now run Windows Media Player because I keep getting a error >message that reads C00D11B1...

Outlook 2003 will not send a specific message
Is there any way to debug this phenomenon? My office 2003 professional Outlook gets certain messages stuch in the outbox and they just will not send. I see no error messages. I can send other messages, but for some reason I can not phathom certain messages get stuck. I am not sure what the common thread is. Some are replies, in which I add a few recipients. I tend to use the BCC field because I don't want everyone to see to whom else the message went. I also often edit the message in word for it's message writing tools then copy the document into a message body. I am not sure if ...

Purchase Orders Slowness
I just installed this module for version 8.00g7. Now when I access the company, it takes 2 to 3 minutes to log you on. The access time before was less than 40 secs. Does anybody have a clue? It created these views: CPO10113 CPO10114 CPO10600 Also I noticed when you change user in the same company is fast. -- Thanks in advance. Luis Sorry I forgot to tell that the module is Purchase Orders Enhancenments. -- Thanks in advance. Luis "Luis" wrote: > I just installed this module for version 8.00g7. > Now when I access the company, it takes 2 to 3 minutes to log you on. >...

Inbox showing minus 1 read messages
We have a user who is using outlook 2000 conected to exchange 5.5 whos mailbox is constantly showing -1 unread messages next to the inbox in the outlook bar. I have selected all the messages and marked them as read but this made no difference, I even marked them as unread and then read, still no change. Please help. If there are five real unread messages, does it show 5, 6, or 1? Create a temp folder, select all (from the edit menu) from the inbox and move it to the temp folder. Does it still show 1 or did the 1 move to the temp folder? If the latter, move the good ones back one at a ...

Sales Order unfulfillment
We have customer send us projections of what they would be buying thru next sixth months. We would like to block (allocate) this quantities for this particular customer. At the moment we create a fake order and we put all of these items on this order. When we receive actual orders, we unallocate the fake order for the quantity on the master order, create a brand new order again put the unallocated quantity on the new order. Can we simplify this process? If so, how? Third party solutions? System: GP 8.0 SP1 SQL 2000 Modules: SOP, Inventory, POP, RM, PM, GL We have thought about creating a new...

Leaving a copy of a message on the server
I have two computers and each has a copy of Outlook 2003 and Outlook Express, giving me a total of four copies of outlook. I have chosen to leave a copy of my email messages on the server so that I can view them on both computers. Can I disable or uninstall the two copies of Outlook Express that are installed on the two computers, so that I don't have to go through all four outlook accounts and delete the emails from all four of them? I don't really want to stop saving copies of the messages on the server, in case I want to view the same email on the other computer. Any s...

Microsoft Money 2001 Error message while updating
When Money 2001 first starts up I have it look for updates and get online quotes and currency. I get the quotes and currency but when it looks for updates for money I get a message that states: An error occured while processing a downloaded file ("SMRTINET.INI") during smart connect. Any help??? Thanks. Try clearing webcache - you will need to search for it as it's location may vary.That is where Money stores temporary downloaded files. You could also clear your temporary internet files. Tools > Options > delete files. -- Regards Bob Peel, Microsoft MVP - Money ...

"blank" email messages
we recently had to rebuild our message store because of a corrupted restore attempt. now we have some users that have what seems to be blank messages. when outlook is opened, and messages are listed in the inbox or deleted items folder, these messages are blank except for the word "none" in the date field. they can not be accessed nor deleted. any ideas on how to resolve this issue?? thanks! Care to tell us how exactly you have rebuilt store? kamor56 wrote: > we recently had to rebuild our message store because of a corrupted > restore attempt. now we have some users that ...

messages not arriving from outside vendor
We have a contractor whose emails (from an Earthlink address) are not making it to their intended recipients within our agency. He doesn't get any kind of error back like "message undeliverable." He can send emails to people outside of our organization and they arrive just fine. I have him white-listed in the IMF so that isn't the problem. I used the Exchange message tracking tool and it can't find anything from him as far back as January 1. It's as if his emails aren't making it to our server. He contacted tech support at Earthlink but they haven'...

All Unread Messages are loaded into Inbox As Read
I am using Windoes Mail on Vista-x64. My mail account is with AOL and Windows Mail is configured to use it as an IMAP server. There are no problems sending or receiving e-mails except that all e-mail coming into the Inbox are never in BOLD to indicate they are unread. They are all loaded as if they were read. I can manually set an e-mail to Unread and in that case it will hold the message in BOLD indicating it is unread and it stays that way even if I close and reopen Windows mail. This started happening recently and I'm not sure what triggered it. Any help would be ap...

Parent Account field in a workflow?
Is there a way to force the Parent Account field to be available when building a workflow? It is set to searchable in CRM and is available in my advanced find but not available in a workflow. TIA, Melissa One option if this is critical would be to get a developer to write a workflow assembly that can retrieve the parent account for you. ============================== John O'Donnell Microsoft CRM MVP Web - http://www.crowecrm.com Blog - http://www.crowecrm.com/crowe/microsoft/crmblog.cfm "Melissa Ragsdale" <MelissaRagsdale@discussions.microsoft.com> wrote in messa...

Spurious WM_PAINT or confused ::IsWIndow()
I have a modeless dialog with an OnPaint() handler How do I find out why OnPaint() is getting called ? The problem is it is being called when the dialog THINKS it isn't a window i.e. so the first line of code "CPaintDC dc(this)" fails with an assert I can't simply check ::IsWindow(m_hWnd) and return if FALSE since of course windows will just keep firing WM_PAINT messages at me Interestingly, ::IsWindow(..) returns FALSE even though I can clearly see my dialog ! Note that : 1) I *never* call OnPaint() myself 2) I *never* post WM_PAINT message 3) Repainting requests are do...

Back Order Work Order
Hello, When adding an item with 0 inventory to a sale I get a prompt to create a back order. When I add the same exact item to a work order there is no prompt to create a back order. Is that correct? I expect to have some back orders on work orders is there a work around method (or maybe I am missing a fix)? Thank you, Jim This is a multi-part message in MIME format. ------=_NextPart_000_0572_01C89517.067BEB30 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable JimF, In RMS' mind, an order, is an order, is an order, and not a sale. --=20...

Font Choice for Plain Text Messages
I must be missing it because I cannot find an option to change the font of received plain-text messages. I can change the font of the message list and the preview header but not the message in the preview pane or a selected message. Where is it hiding? ...

'Subject' field is NOT displayed when I create new message
I am using OUTLOOK to check my home mail while in the office, hence it is not set as the "default" email handler since my office mail is gets that setting on another mail handler. However, when I try post or reply to home mail with OUTLOOK, and I can, I just have no way of entering or editing the message "subject". Any suggestions? William While in the new message window, click View | Message Header and see if the Subject field reappears. -- Jocelyn Fiorello MVP - Outlook *** Replies sent to my e-mail address will probably not be answered -- please reply only to t...

Hibernating error message
I've get this message when turning on Microsoft word on my home laptop. How can I clear it What message? On May 27, 4:54=A0pm, MoeMrtn <MoeM...@discussions.microsoft.com> wrote: > I've get this message when turning on Microsoft word on my home laptop. = =A0How > can I clear it ...