[SOLITAIRE]
authorEric Kohl <eric.kohl@reactos.org>
Thu, 31 Dec 2015 12:58:18 +0000 (12:58 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Thu, 31 Dec 2015 12:58:18 +0000 (12:58 +0000)
solitaire: no action upon doubleclick
Patch by Carlo Bramini.
CORE-6514 #resolve #comment Thanks a lot!

svn path=/trunk/; revision=70470

reactos/base/applications/games/solitaire/solgame.cpp
reactos/base/applications/games/solitaire/solitaire.cpp

index 58ef8e2..67877a6 100644 (file)
@@ -12,6 +12,7 @@ extern TCHAR MsgDeal[128];
 CardStack activepile;
 int LastId;
 bool fGameStarted = false;
+bool bAutoroute = false;
 
 void NewGame(void)
 {
@@ -233,7 +234,7 @@ bool CARDLIBPROC SuitStackDropProc(CardRegion &stackobj, CardStack &dragcards)
     SetPlayTimer();
 
     //only drop 1 card at a time
-    if(dragcards.NumCards() != 1)
+    if (!bAutoroute && dragcards.NumCards() != 1)
     {
         TRACE("EXIT SuitStackDropProc()\n");
         return false;
@@ -415,7 +416,9 @@ void CARDLIBPROC RowStackDblClickProc(CardRegion &stackobj, int iNumClicked)
         //stackobj.MoveCards(pDest, 1, true);
         //use the SimulateDrag funcion, because we get the
         //AddProc callbacks called for us on the destination stacks...
+        bAutoroute = true;
         stackobj.SimulateDrag(pDest, 1, true);
+        bAutoroute = false;
     }
     TRACE("EXIT RowStackDblClickProc()\n");
 }
index 7ad7f0f..04c8e4e 100644 (file)
@@ -243,6 +243,8 @@ int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int iCm
                 NULL,                     // use window class menu
                 hInst,                    // program instance handle
                 NULL);                    // creation parameters
+    if (hwnd == NULL)
+        return 1;
 
     hwndMain = hwnd;