全局函数
CWnd* pWnd = GetDlgItem(IDC_BUTTON2); HWND hWnd = pWnd->GetSafeHwnd();//CWnd*转化为HWND ::SetWindowText(hWnd,_T("测试"));//设置控件文本 //::全局作用域 //参数1:HWND窗口句柄 //参数2:文本字符串
MFC内部函数
CWnd* pWnd = GetDlgItem(IDC_BUTTON2); pWnd->SetWindowText(_T("CESI"));
标签:控件,MFC,HWND,pWnd,SetWindowText,CWnd From: https://www.cnblogs.com/liming19680104/p/16924261.html