Re: ? Resetting CListCtrl color [flag] to (default) system color scheme
From: Joseph M. Newcomer (newcomer_at_flounder.com)
Date: 05/21/04
- Next message: Joseph M. Newcomer: "Re: CreateFileMapping Question"
- Previous message: Shizuka: "Problems in Petzold's book!"
- In reply to: Gary Chang: "Re: ? Resetting CListCtrl color [flag] to (default) system color scheme"
- Next in thread: Joseph M. Newcomer: "Re: ? Resetting CListCtrl color [flag] to (default) system color scheme"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 21 May 2004 03:25:52 -0400
I didn't check out Spy++ to see the WM_SYSCOLORCHANGE being propagated downwards, but if
that is truly what happens in DefWindowProc, then the example I gave of having a
UWM_MY_COLOR_CHANGE handler can be replaced by putting in an OnSysColorChange handler in
the child control. The one line of code inside it remains the same. And the
SendMessageToDescendants call that I showed is what DefWindowProc is doing.
joe
On Fri, 21 May 2004 01:40:59 GMT, v-garych@online.microsoft.com (Gary Chang) wrote:
>Hi Alex,
>
>I was reviewing this thread carefully and consulted your problem with the
>Windows User Interface team, one team member answered your question as
>below:
>
>"Actually, the message that is broadcast when the system colors change is
>WM_SYSCOLORCHANGE. Top-level windows are responsible for passing this
>message to its children. DefWindowProc will do this for you if you do not
>handle the message directly.
>
>When you customize the colors used by a standard window control (edit,
>listbox, etc) you handle one or more of the WM_CTLCOLOR* messages to set
>the text and background colors used when painting the control. The controls
>will internally hold on to the text and background colors (but not the
>brush) that were set when handling the WM_CTLCOLOR* message.
>
>The common controls tend to have specific messages that can be used to
>change the colors that are used when drawing the control, such as
>LVM_SETBKCOLOR, LVM_SETTEXTCOLOR, and LVM_SETTEXTBKCOLOR for the list view
>control. These colors are stored internally by the control.
>
>Once you start customizing a control's colors, then the application is
>responsible for updating the control's colors in response to a
>WM_SYSCOLORCHANGE message. There is no *reset* message/flag that will tell
>to controls to start using the system colors again short of destroying and
>recreating the control."
>
>
>Thanks!
>
>Best regards,
>
>Gary Chang
>Microsoft Online Partner Support
>
>Get Secure! - www.microsoft.com/security
>This posting is provided "AS IS" with no warranties, and confers no rights.
>--------------------
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
- Next message: Joseph M. Newcomer: "Re: CreateFileMapping Question"
- Previous message: Shizuka: "Problems in Petzold's book!"
- In reply to: Gary Chang: "Re: ? Resetting CListCtrl color [flag] to (default) system color scheme"
- Next in thread: Joseph M. Newcomer: "Re: ? Resetting CListCtrl color [flag] to (default) system color scheme"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|