当前位置:网站首页>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 :

边栏推荐
- gnu-efi开发环境设置
- JVM garbage collection
- SAP Hana error message sys_ XSA authentication failed SQLSTATE - 28000
- Crazy temporary products: super low price, big scuffle and new hope
- 7-5 zhe zhe playing games
- Golandidea 2020.01 cracked version
- 传输层协议 ——— TCP协议
- 7-4 网红点打卡攻略(dfs)
- Do you know how to improve software testing ability?
- Mycat的使用
猜你喜欢

软件测试面试官问这些问题的背后意义你知道吗?

MySQL优化之慢日志查询

Ceph性能优化与增强

优质好书助成长 猿辅导携四大出版社推荐“暑期好书”
Summary of APP test interview questions, which must be taken in the interview

使用Visual Studio 2017创建简单的窗口程序

MySQL-MVCC
Test case and bug description specification reference

7-13 underground maze exploration (adjacency table)

How to do industry analysis
随机推荐
Abstract classes and interfaces
科创人·神州数码集团CIO沈旸:最佳实践模式正在失灵,开源加速分布式创新
Differences among list, set and map
《保护我们的数字遗产:DNA数据存储》白皮书发布
Thread deadlock and its solution
行业分析怎么做
MySQL installation
Overview of software definition storage (one article is enough)
端午节安康--诸佬在我心里越来越粽要了
Crazy temporary products: super low price, big scuffle and new hope
MySQL-MVCC
CEPH performance optimization and enhancement
SAP HANA 错误消息 SYS_XSA authentication failed SQLSTATE - 28000
网络层IP协议 ARP&ICMP&IGMP NAT
NiO principle
价值投资.
7-5 zhe zhe playing games
List、Set、Map的区别
哈希表的线性探测法代码实现
2022 极术通讯-安谋科技纷争尘埃落定,本土半导体产业基石更稳