I modified the code to substitute WM_CTLCOLORBTN by a subclass, but it isn't working. It should show a black button in the main dialog.Take a look. Can you help me?
Posted on 2004-08-01 14:03:42 by Marginais
Mmm,

I don't quite know how I can explain this, to color a button effectively you must use Owner draw. Even if you do find that you used

CMP DWORD PTR , 0Fh

instead of

CMP DWORD PTR , 0Fh

you will still find that it doesn't work as you might expect. A button consists of multiple pens, brushes and windows including parts that cannot have their color changed under any circumstances like the FrameControl. You can either create a custom control or go owner draw because WM_CTLCOLORBTN will not work either...

MSDN WM_CTLCOLORBTN
Drawing push buttons requires several different brushes-face, highlight and shadow-but the WM_CTLCOLORBTN message allows only one brush to be returned.


I did manage to do a button in a subclass once but it was way too much work when ownerdraw is relatively simple to do...
Posted on 2004-08-02 14:29:27 by donkey
Marginais
Why mix BS_OWNERDRAW ? Subclass?
Posted on 2004-08-02 22:42:06 by P2M