Need code to display message box in C++
Hi,
I want to know how to show the message box for C++?
I want it to appear on the screen like windows shows us the error messages. I know its possible with Vb. but I don't know how to do it in C++?
Need code to display message box in C++
Thanks in advance.
Re: Need code to display message box in C++
Standard C++ has no window GUI support: you need to use some form of GUI library to do it.
I have a similar kind of query.
How to display a popup message in system tray icon?
I want a small popup message to show me that I have got message or email from a server. I want to know how to code it just like the yahoo tell you in system tray icon that you have got a new message.
Thanks.
Re: Need code to display message box in C++
How to: Display Message Boxes
A MessageBox is a predefined dialog box that displays application-related information to the user. Message boxes are also used to request information from the user.
C++
Code:
public:
void PerformCalculations()
{
// Code is entered here that performs a calculation
// Display a message box informing the user that the calculations
// are complete
MessageBox::Show("The calculations are complete",
"My Application", MessageBoxButtons::OKCancel,
MessageBoxIcon::Asterisk);
}
Message boxes can also receive input. The Show method of the MessageBox class returns a value that can be used to determine a choice made by the user.
Code:
public:
void ExitApplication()
{
// Display a message box asking users if they
// want to exit the application.
if (MessageBox::Show("Do you want to exit?",
"My Application", MessageBoxButtons::YesNo,
MessageBoxIcon::Question) == DialogResult::Yes)
{
Application::Exit();
}
}
http://msdn.microsoft.com/en-us/libr...ow(VS.71).aspx
Re: Need code to display message box in C++
In Visual C++ you need to use APIs
MessageBox C++ Win32 API
I hope this video tutorial help you.