1 / 4

Usin g Visua l Studi o t o Creat e a Win32 API Application with a Menu and an Icon

Usin g Visua l Studi o t o Creat e a Win32 API Application with a Menu and an Icon. Open Visua l Studio , ope n a Ne w Project creat e a n empt y Win3 2 application Creat e a ne w Visua l C+ + sourc e file , typ e or past e i n th e cod e (winapp2.cpp) ,

veta
Download Presentation

Usin g Visua l Studi o t o Creat e a Win32 API Application with a Menu and an Icon

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. UsingVisualStudiotoCreatea Win32APIApplicationwitha MenuandanIcon

  2. OpenVisualStudio, • openaNewProject • createanemptyWin32application • CreateanewVisualC++sourcefile, • typeor pasteinthecode(winapp2.cpp), • saveitasa C++ source file in the app’s subdirectory • must have: #include “resource.h” • Addittotheproject • Create the Icon Resource (and the .rcfile) • Select‘Project|AddResource|Icon|New’– Bringsupiconeditor • Draw desired icon • Click on IDI_ICON1 in “Resource View” to bring up the “Properties” window and change the icon ID to “MYICON”- don't forget the quote marks • Give a name to .ico file (or leave the default name)

  3. Select‘Project|AddResource|Menu|New’ This bringsupthemenueditor • Type the caption: &Circle in the “Type Here” rectangle • Inresulting"Properties"box,Select“False”for“Pop- up” • Click on the Circle menu item to bring up the “Properties”box again. • NotethedefaultIDofID_CIRCLE • Click on the next rectangle over in the menu editor • Repeattheabove 5 stepsusingcaption:&Rectangle • Keep the default IDs • Repeatfor: • Clear&Screen,&Quitmenuitems • Keep default IDs

  4. Clickon“IDI_MENU1”in“ResourceView” tobringupthe“Properties”windowand changethemenuIDto“MYMENU”- • Don’tforgetthequotemarks • Buildtheproject

More Related