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
基础教程推荐
- 如何更改 SysDateTimePick32 或 CDateTimeCtrl 的背景颜色? 2022-01-01
- 如何部分禁用 cmake C/C++ 自定义编译器检查 2021-01-01
- 将不可复制的闭包对象传递给 std::function 参数 2021-01-01
- 与 CAS 的原子交换(使用 gcc 同步内置函数) 2022-01-01
- 为什么我们不能使用“虚拟继承"?在 COM 中? 2022-01-01
- 随机插入/删除的综合向量与链表基准 2022-01-01
- c++ STL设置差异 2022-01-01
- 如何在 C++ 中正确使用命名空间? 2022-01-01
- 提升 ASIO 流缓冲 2021-01-01
- C++:获取传递给函数的多维数组的行大小 2021-01-01
