Click here to Skip to main content
15,908,906 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Shares Pin
David Crow16-Jan-06 2:59
David Crow16-Jan-06 2:59 
QuestionRe: Shares Pin
kelprinc16-Jan-06 3:07
kelprinc16-Jan-06 3:07 
GeneralRe: Shares Pin
David Crow16-Jan-06 3:16
David Crow16-Jan-06 3:16 
QuestionRe: Shares Pin
kelprinc16-Jan-06 3:46
kelprinc16-Jan-06 3:46 
AnswerRe: Shares Pin
Jon Hulatt16-Jan-06 3:54
Jon Hulatt16-Jan-06 3:54 
Questionadd-in to internet explorer Pin
Dave_Nunes16-Jan-06 2:32
Dave_Nunes16-Jan-06 2:32 
AnswerRe: add-in to internet explorer Pin
khan++16-Jan-06 3:54
khan++16-Jan-06 3:54 
QuestionChanging the background color of a STATIC control Pin
Axonn Echysttas16-Jan-06 2:12
Axonn Echysttas16-Jan-06 2:12 
Hi everybody. I'm running into a bit of a complication when creating a window of the class "Static". I want to create using CreateWindowEX a simple text label. All went fine until I wanted to change the background color and text color. I can set the font ok, but when it comes to colors, I simply can't understand what to do! Here's how I create the window, with the necessary comments.

hwndControl = CreateWindowEx //Creating the window.
(
NULL, //ExStyles.
"Static", //Class name.
Text, //Text of the label, appears ok, using the font I give it.
WS_CHILD, //Styles.
0, //X.
0, //Y.
100, //Width.
30, //Height.
hwndThis, //Parent.
NULL, //Menu.
(HINSTANCE)hwndThis, //This is the handle of a window which contains this window.
NULL //CreateStruct.
);

hwndThis is a handle of another window, a WS_POPUP. I created that window too, and in it, I want to load this new window, the label.

So how do I change the colors? I subclassed this window but I don't receive any WM_CTLCOLORSTATIC or WM_CTLCOLOR messages. I only get WM_PAINT, WM_NCPAINT and WM_ERASEBKGND. I don't want to totally rewrite the paint since that would totally miss the point of me creating this Static control: I want to benefit from Window's wrapping and aligning the text.

Thank you in advance for your help ::- ).

For those who don't know, this is for a freeware application I'm working on, anybody that helps me will do so for a good cause, and will be mentioned in the Thanks section.

-= E C H Y S T T A S =-
The Greater Mind Balance
AnswerRe: Changing the background color of a STATIC control Pin
Rage16-Jan-06 6:03
professionalRage16-Jan-06 6:03 
GeneralRe: Changing the background color of a STATIC control Pin
Axonn Echysttas16-Jan-06 6:25
Axonn Echysttas16-Jan-06 6:25 
GeneralRe: Changing the background color of a STATIC control Pin
ThatsAlok16-Jan-06 17:20
ThatsAlok16-Jan-06 17:20 
GeneralRe: Changing the background color of a STATIC control Pin
Axonn Echysttas16-Jan-06 18:49
Axonn Echysttas16-Jan-06 18:49 
GeneralRe: Changing the background color of a STATIC control Pin
Stephen Hewitt16-Jan-06 19:52
Stephen Hewitt16-Jan-06 19:52 
QuestionWriting a service in VC++ Pin
BadKarma16-Jan-06 2:00
BadKarma16-Jan-06 2:00 
AnswerRe: Writing a service in VC++ Pin
prcarp16-Jan-06 5:10
prcarp16-Jan-06 5:10 
AnswerRe: Writing a service in VC++ Pin
Jack Puppy16-Jan-06 5:33
Jack Puppy16-Jan-06 5:33 
AnswerRe: Writing a service in VC++ Pin
basementman16-Jan-06 7:51
basementman16-Jan-06 7:51 
GeneralRe: Writing a service in VC++ Pin
BadKarma17-Jan-06 1:45
BadKarma17-Jan-06 1:45 
QuestionVS2005 - compiler bug with CStrings? Pin
#realJSOP16-Jan-06 1:45
professional#realJSOP16-Jan-06 1:45 
AnswerRe: VS2005 - compiler bug with CStrings? Pin
toxcct16-Jan-06 2:17
toxcct16-Jan-06 2:17 
GeneralRe: VS2005 - compiler bug with CStrings? Pin
#realJSOP16-Jan-06 2:43
professional#realJSOP16-Jan-06 2:43 
GeneralRe: VS2005 - compiler bug with CStrings? Pin
toxcct16-Jan-06 2:51
toxcct16-Jan-06 2:51 
GeneralRe: VS2005 - compiler bug with CStrings? Pin
#realJSOP16-Jan-06 3:11
professional#realJSOP16-Jan-06 3:11 
GeneralRe: VS2005 - compiler bug with CStrings? Pin
toxcct16-Jan-06 3:17
toxcct16-Jan-06 3:17 
AnswerRe: VS2005 - compiler bug with CStrings? Pin
kakan16-Jan-06 3:25
professionalkakan16-Jan-06 3:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.