我使用以下代码尝试将插入符号定位在丰富的编辑控件中的文本末尾:
int len = GetWindowTextLength(editwin);
SendMessage(editwin,EM_SETSEL,0,MAKELONG(len,len));
不幸的是,它似乎突出显示(选择)了整个文本。我不知道我做错了什么。
最佳答案
来自documentation对于 EM_SETSEL
:
Parameters
wParam The starting character position of the selection.
lParam The ending character position of the selection.
因此您需要将len
传递给wParam
和lParam
。
关于c++ - 将光标定位在 RichEdit 控件中文本的末尾,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32454634/