Hi
I wanna sk something more:
I want my application when user press EXIT button give him the choise to cancel or continue exit.
For example:
"You sure wanna exit";
OK CANCEL
Any code ideas;
Printable View
Hi
I wanna sk something more:
I want my application when user press EXIT button give him the choise to cancel or continue exit.
For example:
"You sure wanna exit";
OK CANCEL
Any code ideas;
Look at ::MessageBox().
Cheers
you can use WM_QUERYENDSESSION too.Code:case WM_CLOSE :
if (IDYES == MessageBox (hwnd, TEXT ("Really want to close?"),
saName, MB_YESNO | MB_ICONQUESTION) )
return 1 ;
else
return 0 ;
I think your code is wrong
In WM_CLOSE in your window procedure you can do:
Code:case WM_CLOSE:
{
if (MessageBox(hWnd, "Are You Sure You Want To Exit?", "Exit", MB_YESNO) == IDYES)
{
PostQuitMessage(0);
}
else
return 0;
}break;
Ok thanks i finally did it like this:
if
(MessageBox(NULL,"Are You Sure You Want To Exit?", "Exit", MB_YESNO) == IDYES)
{
ShowMessage("Thank You");
PostQuitMessage(0);
}