Author: ekohl
Date: Sat Aug 4 14:22:44 2007
New Revision: 28154
URL:
http://svn.reactos.org/svn/reactos?rev=28154&view=rev
Log:
- Ask the user when he closes the window only if the game is still running.
Modified:
trunk/reactos/base/applications/games/solitaire/solgame.cpp
trunk/reactos/base/applications/games/solitaire/solitaire.cpp
trunk/reactos/base/applications/games/solitaire/solitaire.h
Modified: trunk/reactos/base/applications/games/solitaire/solgame.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/games/so…
==============================================================================
--- trunk/reactos/base/applications/games/solitaire/solgame.cpp (original)
+++ trunk/reactos/base/applications/games/solitaire/solgame.cpp Sat Aug 4 14:22:44 2007
@@ -121,6 +121,8 @@
}
}
+ fGameStarted = true;
+
TRACE("EXIT RowStackDropProc(true)\n");
return true;
}
@@ -248,6 +250,7 @@
{
pSuitStack[i]->Flash(11, 100);
}
+ fGameStarted = false;
}
TRACE("EXIT SuitStackAddProc()\n");
}
@@ -273,6 +276,8 @@
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...
Modified: trunk/reactos/base/applications/games/solitaire/solitaire.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/games/so…
==============================================================================
--- trunk/reactos/base/applications/games/solitaire/solitaire.cpp (original)
+++ trunk/reactos/base/applications/games/solitaire/solitaire.cpp Sat Aug 4 14:22:44
2007
@@ -415,6 +415,7 @@
static int nWidth, nHeight;
int nStatusHeight = 0;//20;
int parts[] = { 100, -1 };
+ int ret;
MINMAXINFO *mmi;
@@ -492,7 +493,20 @@
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;
}
Modified: trunk/reactos/base/applications/games/solitaire/solitaire.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/games/so…
==============================================================================
--- trunk/reactos/base/applications/games/solitaire/solitaire.h (original)
+++ trunk/reactos/base/applications/games/solitaire/solitaire.h Sat Aug 4 14:22:44 2007
@@ -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