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