如何在MFC / C ++应用程序中重命名主窗口(窗体) [英] How do I rename the main window (form) in MFC/C++ app
本文介绍了如何在MFC / C ++应用程序中重命名主窗口(窗体)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好。
我一直致力于在Visual Studio 2012中使用MFC / C ++制作的项目,而且似乎工作得很好,唯一的问题是当我按下VS 2012中的运行/编译按钮时,主窗口(我称之为主窗体)在窗口顶部显示应用程序的原始名称。
我想要做的是重命名这个表格并保留我一直在工作的所有其他功能;有谁知道如何实现这一目标?先谢谢。
我最诚挚的问候。
Michael
Hi there.
I have been working on a project made in MFC/C++ in Visual Studio 2012 and al seem to work perfectly, the only issue is that when I press the button "run/compile" in VS 2012 the main window (what I have called "main form") displays the original name of the app in te very top of the window.
What I want to do is rename this form and keep all the other features that I have been work at; does anyone know how to perfom this taks? Thanks in advanced.
My best regards.
Michael
推荐答案
您可以随时在窗口HWND上调用SetWindowText
来设置其标题: https://msdn.microsoft.com/en-us/library/windows/desktop/ms633546%28v=vs.85%29.aspx [ ^ ]。
是的,对于顶级(弹出)窗口,它将在标题栏中设置其标题,没有别的。对于其他窗口(控件),它将设置一些文本。
-SA
You can always callSetWindowText
on the window HWND to set its title: https://msdn.microsoft.com/en-us/library/windows/desktop/ms633546%28v=vs.85%29.aspx[^].
Yes, for a top-level (popup) window it will set its title in the title bar, nothing else. For other windows (controls) it will set some text.
—SA
这篇关于如何在MFC / C ++应用程序中重命名主窗口(窗体)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文