I Want to Try WIN32API
→ 日本語版を読むWhat Is WIN32API?
There are two ways to create apps that run on Windows: using the .NET framework, or using WIN32API.
To program for Windows, you work with APIs provided by Windows. These APIs are called Windows APIs. Currently there are also WIN32API and WIN64API.
To create native apps on Windows, you typically use languages like C or C++. However, those languages alone cannot perform Windows OS-specific operations such as rendering windows. That is where WIN32API comes in.
When programming for Windows, it is necessary to call WIN32API from these languages (i.e., C or C++).
For more details on WIN32API, see here.
Setting Up a Compiler for C++
WIN32API can be used with C and C++. I'll use C++ this time.
To run C++, I'll install the gcc compiler using MinGW, following the steps below.
2021 Edition: Setting Up an Environment for C/C++ Beginners (Windows) - LYNCS Blog
Running WIN32API
I want to run the WinMain.cpp code found here:
Learn WIN32 Programming in a Week | Day 1: The Most Basic Program
Open a terminal in Visual Studio Code and compile with the following command. This outputs an executable called WinMain.exe.
g++ -o WinMain .\WinMain.cpp
Then run the executable:
./WinMain.exe
As per the program, a message box with an OK button is displayed. Clicking OK terminates the program.