- Update to r53061
[reactos.git] / base / applications / games / solitaire / solitaire.cpp
index a571b2c..bf45a53 100644 (file)
@@ -1,10 +1,3 @@
-#include <windows.h>
-#include <commctrl.h>
-#include <tchar.h>
-#include <stdlib.h>
-
-#include "resource.h"
-#include "cardlib/cardlib.h"
 
 #include "solitaire.h"
 
@@ -19,7 +12,8 @@ TCHAR szAppName[128];
 TCHAR MsgQuit[128];
 TCHAR MsgAbout[128];
 TCHAR MsgWin[128];
-DWORD dwOptions = 8;
+TCHAR MsgDeal[128];
+DWORD dwOptions = OPTION_THREE_CARDS;
 
 CardWindow SolWnd;
 
@@ -135,6 +129,7 @@ int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int iCm
     LoadString(hInst, IDS_SOL_ABOUT, MsgAbout, sizeof(MsgAbout) / sizeof(MsgAbout[0]));
     LoadString(hInst, IDS_SOL_QUIT, MsgQuit, sizeof(MsgQuit) / sizeof(MsgQuit[0]));
     LoadString(hInst, IDS_SOL_WIN, MsgWin, sizeof(MsgWin) / sizeof(MsgWin[0]));
+    LoadString(hInst, IDS_SOL_DEAL, MsgDeal, sizeof(MsgDeal) / sizeof(MsgDeal[0]));
 
     //Window class for the main application parent window
     wndclass.style            = 0;//CS_HREDRAW | CS_VREDRAW;
@@ -198,7 +193,7 @@ int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int iCm
 }
 
 
-BOOL CALLBACK OptionsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
     switch (uMsg)
     {
@@ -356,7 +351,7 @@ CardImageWndProc(HWND hwnd,
 }
 
 
-BOOL CALLBACK CardBackDlgProc(HWND hDlg,
+INT_PTR CALLBACK CardBackDlgProc(HWND hDlg,
                               UINT uMsg,
                               WPARAM wParam,
                               LPARAM lParam)
@@ -475,6 +470,13 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
             // Force the window to process WM_GETMINMAXINFO again
             GetWindowRect(hwndStatus, &rcStatus);
             nStatusHeight = rcStatus.bottom - rcStatus.top;
+
+            // Hide status bar if options say so
+            if (!(dwOptions & OPTION_SHOW_STATUS))
+            {
+                ShowWindow(hwndStatus, SW_HIDE);
+            }
+
             SetWindowPos(hwnd, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOZORDER);
 
             NewGame();
@@ -495,8 +497,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
             if (dwOptions & OPTION_SHOW_STATUS)
             {
                 MoveWindow(SolWnd, 0, 0, nWidth, nHeight - nStatusHeight, TRUE);
-                MoveWindow(hwndStatus, 0, nHeight - nStatusHeight, nWidth, nHeight, TRUE);
-                SendMessage(hwndStatus, WM_SIZE, wParam, lParam);
+                MoveWindow(hwndStatus, 0, nHeight - nStatusHeight, nWidth, nStatusHeight, TRUE);
             }
             else
             {
@@ -579,3 +580,4 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
 }
 
 
+