0

I have setup richedit control as a chat window and I've no idea how to remove the blinking caret from the control, does anyone know how to do that in edit/richedit control?

Sam
  • 3
  • 2
  • Since you say rich edit control, I am assuming you are using Windows controls. Is my assumption correct? If yes, doesn't the cursor disappear once the control looses focus? – yasouser Jan 18 '11 at 15:06
  • Yes, standard rich edit control 2.0. It does but I need to remove it when the window has keyboard focus. – Sam Jan 18 '11 at 15:08

2 Answers2

2

Use HideCaret().

Daniel Gehriger
  • 7,339
  • 2
  • 34
  • 55
1

Based on this page, you need to handle the EN_SETFOCUS Windows message and call HideCaret(). The docs there say that calls to HideCaret() are cumulative, so you probably should only call it once (use a static variable to remember whether it has been set), or alternatively call ShowCaret() in response to EN_KILLFOCUS.

j_random_hacker
  • 50,331
  • 10
  • 105
  • 169