Starting to make a Windows game
The first thing to understand before we start making a Windows game is how a window or a message box is drawn. We need to be aware of the numerous inbuilt functions that Windows provides us with and the different callback functions that we can use.
Getting ready
To work through this recipe, you will need a machine running Windows. You also need to have a working copy of Visual Studio installed on your Windows machine. There are no other prerequisites.
How to do it…
In this recipe, we will see how easy it is to create a message box in Windows. There are different types of message box we can create, and it is only a matter of a few lines of code. Follow these steps:
- Open Visual Studio.
- Create a new C++ project.
- Select a Win32 Windows application.
- Add a source file called
Source.cpp
. - Add the following lines of code to
Source.cpp
:#define WIN32_LEAN_AND_MEAN #include <windows.h> #include <windowsx.h> int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE...