如何改变窗口标题 如何改变窗口标题 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 BOOL SetWindowText( HWND hWnd, // handle to window or control LPCTSTR lpString // title or text); 调用CWnd : : SetWindowText可以改变任何窗口(包括控件)的标题。//Set title for application's main frame window .AfxGetMainWnd ( ) —> SetWindowText (_T("Application title") );//Set title for View's MDI child frame window .GetParentFrame ( ) —> SetWindowText ("_T ("MDI Child Frame new title") );//Set title for dialog's push button control.GetDigitem (IDC_BUTTON) —> SetWindowText (_T ("Button new title ") ); 如果需要经常修改窗口的标题(注:控件也是窗口),应该考虑使用半文档化的函数AfxSetWindowText。该函数在AFXPRIV.H中说明,在WINUTIL.CPP中实现,在联机帮助中找不到它,它在AFXPRIV.H中半文档化, 在以后发行的MFC中将文档化。AfxSetWindowText的实现如下:voik AFXAPI AfxSetWindowText (HWND hWndCtrl , LPCTSTR IpszNew ){ itn nNewLen= Istrlen (Ipaznew); TCHAR szOld [256]; //fast check to see if text really changes (reduces flash in the controls ) if (nNewLen >_contof (szOld) || : : GetWindowText (hWndCrtl , szOld , _countof (szOld) !=nNewLen || Istrcmp (szOld , IpszNew )! = 0{ //change it : : SetWindowText (hWndCtrl , IpszNew ); }} CWnd* pWnd = AfxGetMainWnd(); pWnd->SetWindowText("your new title here!"); 有没有第三方保证的项目交易啊 大家来讨论讨论当前应该是比较实用的技术问题(DNS),让你的电脑做服务器 关于代码组织问题 请教! 怎么集成子程序 如何检查另一个进程的当前的鼠标状态,并检查其显示是否正确?高手们请指教! 问一个窗体中控件消息的问题,急!!! CreatePen中设定画笔宽度(〉2),CPU占有率100%问题 一个简单的问题,急!!! 能不能将数据就保存到本应用程序的 exe 文件! MOV large fs:0 0x1h 请教各位怎么样确定应用程序的 路径 如何创建一个不规则形状的窗口
HWND hWnd, // handle to window or control
LPCTSTR lpString // title or text
);
//Set title for application's main frame window .
AfxGetMainWnd ( ) —> SetWindowText (_T("Application title") );//Set title for View's MDI child frame window .
GetParentFrame ( ) —> SetWindowText ("_T ("MDI Child Frame new title") );//Set title for dialog's push button control.
GetDigitem (IDC_BUTTON) —> SetWindowText (_T ("Button new title ") );
如果需要经常修改窗口的标题(注:控件也是窗口),应该考虑使用半文档化
的函数AfxSetWindowText。该函数在AFXPRIV.H中说明,在WINUTIL.CPP中实现,在
联机帮助中找不到它,它在AFXPRIV.H中半文档化, 在以后发行的MFC中将文档化。
AfxSetWindowText的实现如下:
voik AFXAPI AfxSetWindowText (HWND hWndCtrl , LPCTSTR IpszNew )
{
itn nNewLen= Istrlen (Ipaznew);
TCHAR szOld [256];
//fast check to see if text really changes (reduces flash in the controls )
if (nNewLen >_contof (szOld) ||
: : GetWindowText (hWndCrtl , szOld , _countof (szOld) !=nNewLen ||
Istrcmp (szOld , IpszNew )! = 0
{
//change it
: : SetWindowText (hWndCtrl , IpszNew );
}
}
pWnd->SetWindowText("your new title here!");