SAFERHANGUP win32gui (from <Someone>)

This commit is contained in:
nethack.allison
2003-09-30 03:42:01 +00:00
parent 4349f52899
commit 1bdf37ec00
3 changed files with 42 additions and 3 deletions

View File

@@ -496,8 +496,21 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
}
else
{
/* prompt user for action */
switch (NHMessageBox(hWnd, TEXT("Save?"), MB_YESNOCANCEL | MB_ICONQUESTION)) {
case IDYES: NHEVENT_KBD('y'); dosave(); break;
case IDYES:
#ifdef SAFERHANGUP
/* destroy popup window - it has its own loop and we need to
return control to NetHack core at this point */
if( IsWindow( GetNHApp()->hPopupWnd ) )
SendMessage( GetNHApp()->hPopupWnd, WM_COMMAND, IDCANCEL, 0);
/* tell NetHack core that "hangup" is requested */
hangup(1);
#else
NHEVENT_KBD('y'); dosave();
#endif
break;
case IDNO: NHEVENT_KBD('q'); done(QUIT); break;
case IDCANCEL: break;
}