does anyone know how to create
a multieline editbox, that you can
not put the cursor into?
I have tried many styles to try and get
a editbox that will not accept input
and that is not gray, and that will not let
you click into and place a cursor anywhere
in it.
Thanks in advance....
Zcoder.....
a multieline editbox, that you can
not put the cursor into?
I have tried many styles to try and get
a editbox that will not accept input
and that is not gray, and that will not let
you click into and place a cursor anywhere
in it.
Thanks in advance....
Zcoder.....
hi set your edit box up with the ES_READONLY style
to make sure to keep the white background you need to process the WM_CTLCOLORSTATIC messsage.
.elseif uMsg == WM_CTLCOLORSTATIC
.if lParam == hEdit
invoke GetStockObject, WHITE_BRUSH
ret
.endif
then to make sure your window doesnt show the caret do this:
invoke HideCaret,hedit
to make sure to keep the white background you need to process the WM_CTLCOLORSTATIC messsage.
.elseif uMsg == WM_CTLCOLORSTATIC
.if lParam == hEdit
invoke GetStockObject, WHITE_BRUSH
ret
.endif
then to make sure your window doesnt show the caret do this:
invoke HideCaret,hedit
subclass/superclass the edit control and then handle the WM_SETFOCUS message on the edit control message handler. If it receives WM_SETFOCUS use the SetFocus API thus rerouting the focus to a new window or control.
invoke SetFocus, WindowHandleToRerouteTheFocus
:)hi zcoder,
i coded this example up. it uses most of what i posted above except for the HideCaret. I used another api call for that.
i coded this example up. it uses most of what i posted above except for the HideCaret. I used another api call for that.
Smurf,
that worked great for me.
Now I think I can continue to
make my chat program, this was
all that was stoping me, as I could
not stop the message window from
getting messed up when the user
clicked in that window, cause it would
place the cursor in a new place, then
when messages came, the edit box
got messed up with printing text over
other text ect.
Thanks big time.
Zcoder....
that worked great for me.
Now I think I can continue to
make my chat program, this was
all that was stoping me, as I could
not stop the message window from
getting messed up when the user
clicked in that window, cause it would
place the cursor in a new place, then
when messages came, the edit box
got messed up with printing text over
other text ect.
Thanks big time.
Zcoder....
Zcoder,
You can get around that problem by appending the next line to the end of the existing buffer. This allows the user to copy data from the window but not write to it.
Making it read only is easy, subclass it and throwe away all of the incoming key strokes. You shoudl block out the clipboard as well for pasting.
Regards,
hutch@movsd.com
You can get around that problem by appending the next line to the end of the existing buffer. This allows the user to copy data from the window but not write to it.
Making it read only is easy, subclass it and throwe away all of the incoming key strokes. You shoudl block out the clipboard as well for pasting.
Regards,
hutch@movsd.com