计算机使用方法 vc6.0如何使用getwindowtext函数获取edit控件中的文本内容?

vc6.0如何使用getwindowtext函数获取edit控件中的文本内容?CWnd::GetWindowText(lptstr,lpszstring,int nmaxcount)CWnd::Get

vc6.0如何使用getwindowtext函数获取edit控件中的文本内容?

CWnd::GetWindowText(lptstr,lpszstring,int nmaxcount)CWnd::GetWindowText(CString&rstring)CWnd::GetWindowText(lptstr,lpszstringbuf,int nmaxcount)最简单和最常用的形式是第二种形式。(个人而言)使用示例:CEdit myueditcstring stringmyu编辑.GetWindowText(string)要在WMMessage中获取编辑框中的字符串,可以在命令中链接函数和控件ID,并使用编辑框的enSet force Message来获取所需的结果。例如:add in the header fileMSG void onsetfocusedit1()//add message mapping to application fileENuusetfocus(IDCEDIT1,onsetfocusedit1)