- Ask the user when he closes the window only if the game is still running.

svn path=/trunk/; revision=28154
This commit is contained in:
Eric Kohl 2007-08-04 10:22:44 +00:00
parent 415aa5eb49
commit 2f2abb39d0
3 changed files with 21 additions and 2 deletions

View file

@ -121,6 +121,8 @@ bool CARDLIBPROC RowStackDropProc(CardRegion &stackobj, const CardStack &dragca
}
}
fGameStarted = true;
TRACE("EXIT RowStackDropProc(true)\n");
return true;
}
@ -248,6 +250,7 @@ void CARDLIBPROC SuitStackAddProc(CardRegion &stackobj, const CardStack &added)
{
pSuitStack[i]->Flash(11, 100);
}
fGameStarted = false;
}
TRACE("EXIT SuitStackAddProc()\n");
}
@ -273,6 +276,8 @@ void CARDLIBPROC RowStackDblClickProc(CardRegion &stackobj, int iNumClicked)
if(pDest != 0)
{
fGameStarted = true;
//stackobj.MoveCards(pDest, 1, true);
//use the SimulateDrag funcion, because we get the
//AddProc callbacks called for us on the destination stacks...

View file

@ -415,6 +415,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
static int nWidth, nHeight;
int nStatusHeight = 0;//20;
int parts[] = { 100, -1 };
int ret;
MINMAXINFO *mmi;
@ -492,7 +493,20 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
return 0;
case WM_CLOSE:
DestroyWindow(hwnd);
if (fGameStarted == false)
{
DestroyWindow(hwnd);
return 0;
}
else
{
ret = MessageBox(hwnd, MsgQuit, szAppName, MB_OKCANCEL|MB_ICONQUESTION);
if (ret == IDOK)
{
WinHelp(hwnd, szHelpPath, HELP_QUIT, 0);
DestroyWindow(hwnd);
}
}
return 0;
}

View file

@ -3,7 +3,7 @@
extern CardWindow SolWnd;
extern TCHAR szAppName[];
extern bool fGameStarted;
extern bool fGameStarted;
#define OPTION_THREE_CARDS 8
#define CARDBACK_START IDC_CARDBACK1