当前位置:网站首页>Create simple windowing programs using Visual Studio 2017
Create simple windowing programs using Visual Studio 2017
2022-06-12 09:51:00 【Tody Guo】
Currently for use VS2017 Creating windows is a little difficult , however , It has been proved by some examples of open source code , There is still a very simple way .
You can create some simple window programs with simple code . This is especially suitable for the development of some small tools , For large projects , It still needs professional tools .
Let me introduce the method to you :
1. Use the Project menu to create a Windows Application The program , And select the blank item .
2. In the newly-built project , Create a “DIALOG” Dialog resources for .
3. Create a new one source Of CPP file , And add the following code to it ( Remember in CPP Add the header file of resources to the file )
#include "resource.h"
#include <Windows.h>
BOOL CALLBACK dialogproc(HWND h, UINT m, WPARAM w, LPARAM l)
{
switch (m) {
case WM_COMMAND:
switch (LOWORD(w)) {
case IDCANCEL:
MessageBox(h, L"IDCANCEL", L"tip", 48);
DestroyWindow(h);
return 1;
case IDOK:
MessageBox(h, L"now test", L"tip", 48);
return 1;
}
case WM_INITDIALOG:
MessageBox(h, L"WM_INITDIALOG", L"tip", 48);
break;
case WM_DESTROY:
MessageBox(h, L"WM_DESTROY", L"tip", 48);
break;
}
return 0;
}
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
// main dialog
DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, &dialogproc);
return 0;
}Running effect :

边栏推荐
- [cloud native] what exactly does it mean? This article shares the answer with you
- Storage R & D Engineer Recruitment
- 7-5 哲哲打游戏
- 5种最常见的CEPH失败方案
- The Dragon Boat Festival is in good health -- people are becoming more and more important in my heart
- Mysql5.7 partition table
- MySQL安装
- Reading notes of the fifth cultivation
- Abstract classes and interfaces
- 硬盘 SMART 检测参数详解
猜你喜欢
Do you know how to improve software testing ability?

markdown_ Picture side by side scheme

markdown_图片并排的方案
Summary of APP test interview questions, which must be taken in the interview

001:数据湖是什么?

Example interview -- dongyuhang: harvest love in the club

Combat tactics based on CEPH object storage
Share the basic knowledge of software testing and write something you don't know

电阻的作用有哪些?(超全)

Code implementation of hash table based on linear detection
随机推荐
Differences among list, set and map
Do you know how to improve software testing ability?
《要领》读书笔记
Code implementation of hash table based on linear detection
Introduction to applet
Cas d'essai et spécification de description des bogues référence
哈希表的线性探测法代码实现
Auto.js学习笔记7:js文件调用另一个js文件里的函数和变量,解决调用失败的各种问题
2026年中国软件定义存储市场容量将接近45.1亿美元
7-4 网红点打卡攻略(dfs)
Auto.js学习笔记5:autojs的UI界面基础篇1
Auto.js学习笔记9:脚本引擎使用,启动指定路径脚本文件和关闭等基础方法
SAP HANA 错误消息 SYS_XSA authentication failed SQLSTATE - 28000
Record and store user video playback history selection
004:AWS数据湖解决方案
卖疯了的临期产品:超低价、大混战与新希望
Implementation of hotspot reference
硬盘 SMART 检测参数详解
Financial test interview questions to help you get the offer
ThreadLocal