概览:
New
打开VS2019 创建新项目 -> windows桌面应用程序 (是C++类哦),源代码在文末。

裁剪
代码文件只留下framework.h
和main.cpp(可能为项目名.cpp)
.
并在framework.h
删掉#include "targetver.h"
,hello world不需要这些部分也可以运行。
hello world
1 2 3 4 5 6 7 8 9
|
#include "framework.h"
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { MessageBox(NULL, TEXT("Hello windows,are you there?"), TEXT("Hello world"), 1); return 0; }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdlib.h> #include <malloc.h> #include <memory.h> #include <tchar.h>
|
效果

Hi there, I’m Mardan(ka1i).