Creating dialogbased Win32 Application (1)/Create dialog-based WIN32 application (i) new Form/Win32, VC + +, Windows

Source: Internet
Author: User

Create a dialog-based WIN32 application (i)-New form

1. Create a new empty Project for Visual C + +.

2. In Solution Explorer, right-click Add New Item, adding a. cpp file and providing an entry point function for the WIN32 application.

3. In Solution Explorer or Resources View, right-click Add Resource, select dialog. and modify the relevant content.

4. Switch to the. cpp file, create a callback function (DLG_PROC), and call Dialogboxparam in the entry point function.

1#include <Windows.h>2#include <tchar.h>3#include"Resource.h"4 5 int_ptr WINAPI Dlg_proc (HWND hwnd, UINT umsg, WPARAM WPARAM, LPARAM LPARAM) {6     Switch(umsg)7     {8      CaseWm_close:9EndDialog (hwnd,0);Ten          Break; One     } A  -     return(FALSE); - } the  - intWINAPI WinMain (hinstance hinstexe, hinstance, Ptstr Pszcmdline,int) { - Dialogboxparam (Hinstexe, Makeintresource (idd_dialog), - NULL, Dlg_proc, _ttoi (Pszcmdline)); +     return(0); -}
Win32WindowsApplication.cpp

5. When you press F5 Start debugging, you can see the dialog box that you just created.

————————————————

This article for my original, reproduced please indicate the source.

Creating dialogbased Win32 Application (1)/Create dialog-based WIN32 application (i) new Form/Win32, VC + +, Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.