MessageBox in C++


This is a simple code on how to show a MessageBox on a Windows platform.

To view what a message box is click here:

Click here to view an alert

Now you know what an alert is i will show you how to make one in C++. You will need a compiler, i used Dev-C++ for this so i recommend that.

Code
#include <windows.h> /* Includes the MessageBox class */
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
/* All that above just makes the window box */
{ /* Opens the app */

MessageBox(NULL, " Title of the Messagebox", "The messagebox text!", NULL); /* This is the messagebox itself, edit to your nees */
return 0; /* Command to end the program if there is no errors */
} /* Closes the app */


Well thats all for now, this code is for learning purposes only.
Alex's Avatar
Author:
Views:
1,261
Rating:
There are currently no comments for this tutorial, login or register to leave one.