Rich Edit control captures my cursor!
Dick Dievendorff <
dieven@...>
2009-02-02 05:35:46 GMT
I'm wrestling with a Rich Edit control that I'm using as a read-only event
logging window.
When events occur, I AppendText to the rich edit control. I also use
LineScroll to scroll down by the number of lines I've inserted.
My problem is the cursor. When I start a long process (that spans multiple
windows messages), I load an IDC_WAIT cursor in my WM_SETCURSOR handler.
This is working fine.
However when I'm all done and restore the cursor (and call SetCursor with
the old cursor), the wait cursor remains, over my rich edit control, until I
move the cursor slightly with the mouse, then it changes to an I-bar cursor.
I'd like to keep the input focus away from the readonly rich edit control
to another control in my dialog, using GotoDlgCtrl(a button). I'm doing
this in my OnInitDialog method (returning 0), in my OnShowWindow handler,
and also right after I restore the cursor to its earlier non-wait cursor.
None of the GoToDlgCtrl calls moves the cursor to the chosen control, it
remains over my read-only rich edit control, which is the first control in
the dialog.
What is it about Rich Edit windows that are so insistent about holding the
cursor focus?
The RichEdit control is set up in a dialog with this RC statement:
"", IDC_RICHEDIT_LOADER, "RichEdit20A", ES_MULTILINE | ES_AUTOHSCROLL |
ES_READONLY | WS_BORDER | WS_VSCROLL | WS_HSCROLL. It does not have a
WS_TABSTOP.
(Continue reading)