In your while loop you don' assign anything to check. So once the loop is entered it will never leave anymore.
maybe this is what you want
Code:
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nShowCmd)
{
int check = MessageBox(NULL, "Click an Option!",
"MessageBox Example!!", MB_ICONQUESTION |MB_YESNOCANCEL);
while (check != IDCANCEL)
{
if (check == IDYES)
{
MessageBox(NULL, "You Hit YES!",
"MessageBox Example!!", MB_ICONASTERISK);
}
else if (check == IDNO)
{
MessageBox(NULL, "You Hit NO!",
"MessageBox Example!!", MB_ICONASTERISK);
}
else if (check == IDCANCEL)
{
MessageBox(NULL, "You Hit CANCEL - Goodbye!",
"MessageBox Example!!", MB_ICONASTERISK);
}
check = MessageBox(NULL, "Click an Option!",
"MessageBox Example!!", MB_ICONQUESTION |MB_YESNOCANCEL);
}
return 0;
}
Kurt