一个对话框的程序,如何在 InitInstance()中的dlg.DoModal()之前修改应用程序窗口的标题
解决方案 »
- 请问一下哪里有打印list control 的activex 控件下载?
- 给一百分
- vc中的类型转换
- 急问!如何用IDirectDrawSurface->Blt()函数来做一个半透明的表面?
- 中等难度,会者不难,500分求教!!!!!!!
- 为什么在网上传图象后,图象无法打开
- 图像处理
- 大家怎么学习Programming Windows 95 Charles Petzold?
- ActiveX嵌入Word组件时出现ASSERT wincore.cpp 900错误
- ListCtrl控件删除一项后,如何刷新(会留下空白)?
- 怎么把Menu里的选择项连接到Dialog的对话界面???具体步骤...谢谢了
- radio button同步问题
SetWindowText(...)
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
SetWindowText("Your title");
return TRUE; // return TRUE unless you set the focus to a control
}
dlg.DoModal()之前dlg的句柄为空,无法SetWindowText,可以在OnInitDialog中
SetWindowText(...)
CXXAPP::Initinstance()
{//在这儿修改标题,在oModal之前
dlg.DoModal();
}
AfxMessageBox(AfxGetApp()->m_pszAppName);
AfxMessageBox(AfxGetApp()->m_pszExeName);
但修改好象不行,
以下是微软MFC 的APPINI.CPP的97-106行在对m_pszAppName赋值时的说明:
// m_pszAppName is the name used to present to the user
if (m_pszAppName == NULL)
{
BOOL bEnable = AfxEnableMemoryTracking(FALSE);
if (AfxLoadString(AFX_IDS_APP_TITLE, szTitle) != 0)
m_pszAppName = _tcsdup(szTitle); // human readable title
else
m_pszAppName = _tcsdup(m_pszExeName); // same as EXE
AfxEnableMemoryTracking(bEnable);
}