Newsgroups: comp.windows.ms.programmer Path: utzoo!utgpu!watserv1!watmath!hyper.hyper.com!bonneau From: bonneau@hyper.hyper.com (Paul Bonneau) Subject: Re: Control class colors Message-ID: <1991May8.164008.11941@hyper.hyper.com> Reply-To: bonneau@hyper.UUCP (Paul Bonneau,,) Organization: HyperCube Inc. References: <1991May3.213512.7371@ulowell.ulowell.edu> <917360id@cctb.wa.com> Date: Wed, 8 May 1991 16:40:08 GMT In article <917360id@cctb.wa.com> curt@cctb.wa.com (Curt Johnson) writes: >In article <1991May3.213512.7371@ulowell.ulowell.edu> dpelland@hawk.ulowell.edu (David Pelland) writes: >| Could someone please enlighten me as to how I can set >| the background color of a control class window. I've >| tried doing it at creation time, and by processing the >| WM_CTLCOLOR message. I must be doing something wrong. >| Any help is appreciated. >| >| All I wanted was a red button... :( > >Sorry, you can't do it. > >All windows will let you change is the color the button >procedure uses for the WINDOW background, this color is >placed in 1 pixel in each corner of the button (to give >it a somewhat rounded look). > This is simply not true. While setting the background brush may not be enough (depends on the control), you can still call SetBkColor(wParam, your_color_here) when you get the WM_CTLCOLOR message. Also, there is no problem returning a brush handle from a dialog proc (even though the docs imply that only 0 or non-zero are significant). BTW, it sounds like your response is for a windows version *2* PushButton! cheers - Paul Bonneau.