如何从富编辑控件中获取文本作为 CString [英] How to get text from rich edit control as a CString

查看:16
本文介绍了如何从富编辑控件中获取文本作为 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆