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....

Posted on 2002-04-03 00:48:42 by 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.

.if lParam == hEdit
invoke GetStockObject, WHITE_BRUSH

then to make sure your window doesnt show the caret do this:

invoke HideCaret,hedit
Posted on 2002-04-03 01:12:29 by smurf
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
Posted on 2002-04-03 01:14:59 by stryker
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.
Posted on 2002-04-03 02:57:22 by 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.

Posted on 2002-04-04 22:57:40 by 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.

Posted on 2002-04-05 04:19:32 by hutch--