Hello again :rolleyes:
As I'm lazy and I wanted to go the short way displaying always another text in the same Dialog I used an EditControl instead of DrawText.
It was definitively easy and I have almost nothing to complain except that I have no clue how to change the textcolor of this disabled control! Let us be serious... Light-grey on dark-grey is kinda biting each other!
Intercepting the WM_CTLCOLOREDIT I was able to change the background to black, hollow, white & on... But my SetTextColor calls simply get ignored???
Question: Is there a way to change the TextColor of an disabled EditControl?
Thanks :cool:
This message was edited by JimmyClif, on 3/13/2001 6:38:01 PM
Hi Jimmy.
WM_CTLCOLOREDIT is only called for enabled edit controls. Disabled edit controls are treated as static controls and you should set your colours on WM_CTLCOLORSTATIC.
AHA!
Great question JimmyClif! And even better answer Comrade! Thanks.
I've been wrestling with this one for a while now. I did the searches, followed a few threads, but seemed forever destined to having boring grey disabled edit control backgrounds and text. I knew WM_CTLCOLOREDIT didn't work on a disabled control, but intercepting WM_CTLCOLORSTATIC puts the Control back in CTL.
So I started playing around with the other Dialog box messages in this group, WM_CTLCOLORDLG, WM_CTLCOLORBTN and the like and had no problems with them until I tried WM_CTLCOLORMSGBOX, with which you can apparently change the text and background colors of a MessageBox. Now I'm not really sure I'd ever want to do that anyway, but I can't seem to get this one implemented properly.
Under normal conditions a MessageBox would be called in response to something like a button being clicked and a condition being/not being met. In which case a WM_COMMAND message would be in the message queue before the WM_CTLCOLORMSGBOX could be processed. I can't seem to figure out how this message could be used with something like the following to color the MessageBox. Or does this just create an impossible message queue situation anyway?
.ELSEIF uMsg==WM_COMMAND
mov eax,wParam
.IF ax==IDC_BUTTON
shr eax,16
.IF ax==BN_CLICKED
.IF SomeCondition
invoke MessageBox
.ENDIF
Just curious that's all. Man I love this stuff :)
Cheers,
KayakerIt gets a little bit messy, but i have got around this problem before with using a rich edit control. You dont actualy disable, but im cant remember what exactly i did sorry.
Thanks Comrade!
It's sounds so logical once you know the answer *g*, I'm looking forward going home trying it... I wasted almost two hours yesterday trying different methods using
WM_CTLCOLOREDIT
JimmyClif
(Kayaker: Hellau :) Not regged yet?)