简体   繁体   English

如何从丰富的编辑控件作为CString获取文本

[英]How to get text from rich edit control as a CString

I want to get the entire text in a rich edit control as a CString something like GetDlgItemText but this is for dialog boxes. 我想在整个丰富的编辑控件中将整个文本作为CString之类的东西,例如GetDlgItemText,但这是用于对话框的。 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.... 我可以从研究中找到的最接近的东西是: GetTextRange并通过使用GetTextLength来获取范围。但是我怀疑还有更好的方法。

  • GetWindowText. GetWindowText。
  • GetDlgItemText works to, if you use the parent window and the ID of the RTF Control. 如果您使用父窗口和RTF控件的ID,则GetDlgItemText可以工作。
  • WM_GETETXT. WM_GETETXT。

If you want to retrieve the complete RTF text you Need to use EM_STREAMOUT (enough samples in the net). 如果要检索完整的RTF文本,则需要使用EM_STREAMOUT(网络中足够的示例)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM