关于VC中得到窗体标题

来源:百度知道 编辑:UC知道 时间:2024/05/29 21:28:39
怎样得到另一个窗体的标题文本
用GetDlgItemText函数具体怎样实现?谢谢!
谢谢2位 请问具体怎么实现 比如获得一个VB窗体的标题 并保留到str中

CWnd::GetDlgItemText
Call this member function to retrieve the title or text associated with a control in a dialog box.
//用这个函数重新得到对话框的标题

int GetDlgItemText(
int nID,
LPTSTR lpStr,
int nMaxCount
) const;
int GetDlgItemText(
int nID,
CString& rString
) const;

Parameters//参数
nID
Specifies the integer identifier of the control whose title is to be retrieved.
//对话框的ID号
lpStr
Points to the buffer to receive the control's title or text.
//读取后存放标题的指针型变量
nMaxCount
Specifies the maximum length (in characters) of the string to be copied to lpStr. If the string is longer than nMaxCount, it is truncated.
//定义字符串的最大尺寸,如果超过这个尺寸,将被切除掉.这个尺寸是上一参数lpStr的尺寸
rString
A reference to a CString.
//一个访问的字符串?
Return Value//反回值
Specifies the actual number of characters copied to the buffer, not including the terminating null character. The value is 0