Exiting a program
Im working on this program,and when the user exits by clicking exit it should say do you wish to exit? and the user should be able to click yes or no. But lets say the user clicks the X at the upper right hand part of their screen to exit the program, it doesnt do that. Does anyone know how to make something happen if the user tries to exit by clicking the X and the upper right hand part of the screen?
How about something like this:
if(bFileNeedsSaved == true)
answer = MessageBox (NULL, TEXT ("Do you want to save your changes?"),
TEXT ("File has been modified!"), MB_YESNOCANCEL);
SendMessage(hwnd, WM_COMMAND, IDM_FILE_SAVE, 0);
return DefWindowProc (hwnd, message, wParam, lParam);