How to get text from rich edit control as a CString(如何从富编辑控件中获取文本作为 CString)
问题描述
我想将富编辑控件中的整个文本作为 CString 获取,例如 GetDlgItemText,但这是用于对话框的.我可以从我的研究中找到最接近的东西是:GetTextRange 并使用 GetTextLength....但我怀疑有更好的方法....
I want to get the entire text in a rich edit control as a CString something like GetDlgItemText but this is for dialog boxes. The closest thing i can find from my research is: GetTextRange and get the range by using GetTextLength....But I suspect there is a better way....
推荐答案
- 获取窗口文本.
- GetDlgItemText 适用于,如果您使用父窗口和 RTF 控件的 ID.
- WM_GETETXT.
如果要检索完整的 RTF 文本,需要使用 EM_STREAMOUT(网络中有足够的样本).
If you want to retrieve the complete RTF text you Need to use EM_STREAMOUT (enough samples in the net).
这篇关于如何从富编辑控件中获取文本作为 CString的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何从富编辑控件中获取文本作为 CString
基础教程推荐
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- CString 到 char* 2021-01-01
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- 初始化列表*参数*评估顺序 2021-01-01
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
