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

边栏推荐
- Do you know the meaning behind these questions?
- III Regular expression to finite state automata: NFA to DFA
- Mycat的使用
- Example interview -- dongyuhang: harvest love in the club
- 5种最常见的CEPH失败方案
- 科创人·世界500强集团CIO李洋:数字化转型成事在人,决策者应时刻聚焦于「柴」
- 电阻的作用有哪些?(超全)
- Auto.js学习笔记8:常用且重要的一些API
- 7-4 network red dot punch in strategy (DFS)
- Autojs微信研究:微信不同的版本或模拟器上的微信里的控件ip是不同的。
猜你喜欢

Autojs学习笔记6:text(txt).findOne()切换app时会报错,最后解决实现效果,切换任何app直到脚本找到指定的txt文字的控件进行点击。

Dazzle the "library" action - award solicitation from the golden warehouse of the National People's Congress - high availability failover and recovery of kingbasees cluster

Theoretical explanation of hash table

QQ, wechat chat depends on it (socket)?

List of computer startup shortcut keys

《真北》读书笔记

Network layer IP protocol ARP & ICMP & IGMP nat

网络层IP协议 ARP&ICMP&IGMP NAT

How to write test cases?

UE4_以现成资源探索创建背景场景的方法
随机推荐
Difference between MySQL unreal reading and non repeatable reading
7-13 地下迷宫探索(邻接表)
markdown_ Picture side by side scheme
Selection of interview questions for software testing
PandoraBox 使用防火墙规则定义非上网时间
[cloud native | kubernetes] kubernetes networkpolicy
ThreadLocal
001:数据湖是什么?
7-4 network red dot punch in strategy (DFS)
004:aws data Lake solution
001: what is a data lake?
端午節安康--諸佬在我心裏越來越粽要了
基于SSM实现水果商城批发平台
002:数据湖有哪些特征
Introduction to applet
How to write test cases?
Example interview -- dongyuhang: harvest love in the club
Summary of APP test interview questions, which must be taken in the interview
5种最常见的CEPH失败方案
Abstract classes and interfaces