Tech Support > Microsoft Windows > Development Resources > Questions about RichEdit
Questions about RichEdit
Posted by Flzw on July 14th, 2004


I'm having two problems with RichEdit.
First one is, I use one just for output and I would like it not to show a
blinking caret when selected, I have made quite a lot of research and found
nothing helpful on the matter.

Another thing I want to do, is given a CHARFORMAT, find a simple to way to
determine the height of a line... IN PIXELS, there seem to be a way to get
it in twips, what the hell am I supposed to do with twips ?!

Finally, and that has to be the dumbest question, how do I give the focus to
a RichEdit control ?? I tried a SendMessage with WM_SETFOCUS, well, that
does make appear the caret but it either beeps or disappear right when I
type something in, I suppose WM_SETFOCUS is just used to warn a control it
just got the focus, not to actually give it to it, found nothing else and I
feel quite stupid about this one.

If you can help with any of these, I would really appreciate it. Thanks!


Posted by Tim Robinson on July 14th, 2004


Flzw wrote:
There are 20 twips in a point. There are 72 points in an inch. The vertical
resolution of the display can be obtained from GetDeviceCaps(LOGPIXELSY).
From that, you should be able to convert twips to pixels.

There's an example of converting points to pixels in the MSDN page on the
LOGFONT structure.

WM_SETFOCUS is what a window receives when it gains the focus. SetFocus sets
the focus.

--
Tim Robinson (MVP, Windows SDK)
http://mobius.sourceforge.net/



Posted by Norman Bullen on July 15th, 2004


Flzw wrote:
If the RichEdit control is for output only, you can disable it. This
will probably prevent it from getting the focus and that will prevent it
from showing a cursor.

If that doesn't work, subclass the control and don't pass the
WM_SETFOCUS and WM_KILLFOCUS messages to it.

Norm

--
--
To reply, change domain to an adult feline.


Posted by kal on July 15th, 2004


Norman Bullen <norm@BlackKittenAssociates.com.INVALID> wrote in message news:<tPkJc.2890$mL5.54@newsread1.news.pas.earthli nk.net>...

This is not a good idea. What then does one do with
WM_KEYUP, WM_KEYDOWN, WM_CHAR etc. messages?

Posted by Norman Bullen on July 15th, 2004


kal wrote:
The OP said he wanted an output only window. I've suggested that he make
it disabled, in which case it should not get any keyboard messages. If
it does, again, just ignore them.

Norm

--
--
To reply, change domain to an adult feline.



Similar Posts