如何更改应用程序的标题

xhyxyr 2003-09-11 03:35:22
一般的应用程序标题都是:“无标题-AnyApp”,请问,如何更改标题栏的标题?
...全文
58 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
u2m 2003-09-11
  • 打赏
  • 举报
回复
AfxGetMainWnd()->SetWindowText("My Title");
akiko 2003-09-11
  • 打赏
  • 举报
回复
AfxGetMainWnd()->SetWindowText("My Title");
bcpl 2003-09-11
  • 打赏
  • 举报
回复
1. 修改CMainFrame::PreCreateWindow

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style &= ~FWS_ADDTOTITLE; // *** 加上这句 ***
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs

return TRUE;
}

2. 在CMainFrame::OnCreate里设定标题

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
...
SetWindowText("Hello");
return 0;
}


15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧