简体   繁体   English

如何使用Visual Studio 2008在程序中添加菜单栏?

[英]How to add menubar in my program with Visual Studio 2008?

I managed to create the menubar in the menu editor by clicking and writing text to each menu item i wanted. 我设法通过在菜单编辑器中单击并将文本写入所需的每个菜单项来创建菜单栏。

I cant see any button to get the code to include the menu in my program. 我看不到任何按钮来获取将菜单包含在程序中的代码。

How i can get this menu working? 我如何才能使此菜单正常工作?

C++ C ++

depends on whether you are using pure win32 api or MFC. 取决于您使用的是纯Win32 API还是MFC。 But being a newbie i will first assume that you are using win32 api. 但是作为一个新手,我首先会假设您正在使用win32 api。 do a simple google search for forgers win32 tutorials. 做一个简单的谷歌搜索伪造的Win32教程。

just to satisify you, edit the main.cpp file and change the WNDCLASSEX structure, under the lpszMenuName part. 只是为了使您满意,请编辑lpszMenuName部分下的main.cpp文件并更改WNDCLASSEX结构。

See, you just cant keep using visual studio's code generation features. 瞧,您只是不能继续使用Visual Studio的代码生成功能。 You have to understand the code behind the menu, and it is not hard. 您必须了解菜单后面的代码,这并不难。 other wise you will never understand the more advanced features. 否则,您将永远无法理解更高级的功能。 No offence but these things are covered all over the internet. 没有冒犯,但这些东西已在整个互联网上覆盖。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM