How to get text from rich edit control as a CString

浪尽此生 提交于 2019-12-02 20:04:49

问题


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....


回答1:


  • GetWindowText.
  • GetDlgItemText works to, if you use the parent window and the ID of the RTF Control.
  • WM_GETETXT.

If you want to retrieve the complete RTF text you Need to use EM_STREAMOUT (enough samples in the net).



来源:https://stackoverflow.com/questions/20700343/how-to-get-text-from-rich-edit-control-as-a-cstring

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!