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
基础教程推荐
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 这个宏可以转换成函数吗? 2022-01-01
- 我有静态或动态 boost 库吗? 2021-01-01
- 常量变量在标题中不起作用 2021-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
