This is a bit lengthy. But I'm sure you would like to know what I want to know if you already don't know.<br>
<br>
I have a major problem.<br>
<br>
I need to change the color of a Button. Foreground and the Background(Button Face).<br>
I think I have to trap the WM_CTLCOLORBTN message. I tried it - it worked somewhat in that I had to make the button style OWNERDRAW. But then it wouldn't show anything. So I trapped the WM_CTLCOLORBTN message in the parent window and it worked - somewhat. It colored the entire area of the button. No 3D effect, just a solid, flat, colored rectangle ! I am now totally confused.<br>
In MSDN I read (can't recall where in MSDN) that "unlike other controls, the button control has no pre-defined visual apperance when the OWNERDRAW style is set. The application and not the system, is responsible for all painting."<br>
<br>
Is there an easier way than this :<br>
1. Fill button area with solid, colored rectangle.<br>
2. Draw your own 3D lines around the button.<br>
3. Handle the click/button down events to simulate the pressing/depressing :) of the button.<br>
<br>
I was trying the above using MFC. I am using VC++ 5 and VC++ 6. I don't think the two versions have that major a difference as far as this problem is concerned ?<br>
<br>
<br>
Here are some of the things I tried :<br>
(I saw that CALC.EXE uses colored text on it's buttons)<br>
1. Used Spy++ to monitor messages on a button in CALC.EXE.<br>
2. Used Spy++ to monitor messages on the main dialog of CALC.EXE.<br>
The dialog did send the WM_CTLCOLORBTN message to the buttons.<br>
<br>
<br>
Here is a quirk I noticed :<br>
In a normal command button such as the Start button, when you do a mousedown on it, the button gets depressed. Also, the button's text changes position to reflect the down state.<br>
In CALC.EXE, no such thing ! The text stays where it is ! I thought maybe the button text was a Static text control. No such thing. I couldn't get a handle for it using Spy++.<br>
<br>
<br>
<br>
I'd REALLY appreciate ANY input from you.<br>
<br>
Thanks in advance !<br>
<br>
cIAo<br>
Bikram<br>
<br>
<br>
<br>
<br>
BTW, it is possible to change the color of a Static control, Dialog box, Edit control etc. using MFC. Thanks to Xotor for his help.<br>
<br>