void attemptQuit() { if (document.modified()) { UINT res = MessageBox(hwnd, "Save before exit?", mainWindowTitle, MB_YESNOCANCEL | MB_ICONQUESTION); if ((IDYES == res && fileSave()) || (IDNO == res)) DestroyWindow(hwnd); } else DestroyWindow(hwnd); }
static void attemptQuit() { SyncDocument *doc = trackView->getDocument(); if (doc->modified()) { UINT res = MessageBox(hwnd, "Save before exit?", mainWindowTitle, MB_YESNOCANCEL | MB_ICONQUESTION); if ((IDYES == res && fileSave()) || (IDNO == res)) DestroyWindow(hwnd); } else DestroyWindow(hwnd); }