|
-
December 9th, 2008, 01:10 AM
#1
[RESOLVED] Exit message
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;
-
December 9th, 2008, 08:03 AM
#2
Re: Exit message
Look at ::MessageBox().
Cheers
-
December 10th, 2008, 03:21 AM
#3
Re: Exit message
Code:
case WM_CLOSE :
if (IDYES == MessageBox (hwnd, TEXT ("Really want to close?"),
saName, MB_YESNO | MB_ICONQUESTION) )
return 1 ;
else
return 0 ;
you can use WM_QUERYENDSESSION too.
Last edited by codecX; December 10th, 2008 at 03:24 AM.
-
December 12th, 2008, 01:35 AM
#4
Re: Exit message
I think your code is wrong
-
December 12th, 2008, 01:48 AM
#5
Re: Exit message
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;
-
December 12th, 2008, 01:58 AM
#6
Re: Exit message
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);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|