+ 1
How to use the alert function in C++. Plz send me an illustration
I wanted to use the alert function in c++. Can anyone send me the code for it?!
3 Answers
+ 4
You may use a simple message box in WinAPI on a Windows PC.
Eg :
#include<string>
#include<windows.h>
int Alert(string Prompt="", string Title="",
UINT BtnLst=MB_OK)
{
return MessageBox(nullptr,Prompt.c_str()
,Title.c_str(),BtnLst);
}
int main()
{
Alert("Click Me!");
// the return value can be compared to
// do something when OK is clicked.
}
+ 1
Itâs called message box in C
MessageBox(0, "Content", "Title", MB_OK);
https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505(v=vs.85).aspx
+ 1
Thanks