Write a Windows Program to display a message box with cancel, Retry and Continue.
Steps:
1. Open DEV C++.
2. Click “File” then “New” after that “Project”.
3. From “Basic” select “Wildows Application”.
4. Select “C++ project”.
5. Give a project name.
6. Click “ok” then “save”.
1. Open DEV C++.
2. Click “File” then “New” after that “Project”.
3. From “Basic” select “Wildows Application”.
4. Select “C++ project”.
5. Give a project name.
6. Click “ok” then “save”.
Remove some code and write according to below program.
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
int nResult=MessageBox(NULL, “An example of Cancel, Retry, Continue”, “Hello Message Box!”, MB_ICONERROR|MB_ABORTRETRYIGNORE);
{
int nResult=MessageBox(NULL, “An example of Cancel, Retry, Continue”, “Hello Message Box!”, MB_ICONERROR|MB_ABORTRETRYIGNORE);
switch (nResult)
{
case IDABORT:
break;
case IDRETRY:
break;
case IDIGNORE:
break;
}
return 0;
}
{
case IDABORT:
break;
case IDRETRY:
break;
case IDIGNORE:
break;
}
return 0;
}
Steps:
1. From “Execute” menu click on “Compile and run”.
2. Give it a name and save it.
3. Wait until your compilation is completed by the compiler.
4. Hope you get your output.
2. Give it a name and save it.
3. Wait until your compilation is completed by the compiler.
4. Hope you get your output.
Comments
Post a Comment