ReactOS  0.4.12-dev-75-g00dd17e
solitaire.cpp File Reference
#include "solitaire.h"
#include <winreg.h>
#include <commctrl.h>
#include <tchar.h>
#include "resource.h"
Include dependency graph for solitaire.cpp:

Go to the source code of this file.

Classes

struct  _CardBack
 

Typedefs

typedef struct _CardBack CARDBACK
 
typedef struct _CardBackPCARDBACK
 

Functions

LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
 
void MakePath (TCHAR *szDest, UINT nDestLen, const TCHAR *szExt)
 
VOID LoadSettings (VOID)
 
VOID SaveSettings (VOID)
 
int GetScoreMode (void)
 
void UpdateStatusBar (void)
 
void SetPlayTimer (void)
 
int WINAPI _tWinMain (HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int iCmdShow)
 
INT_PTR CALLBACK OptionsDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
VOID ShowGameOptionsDlg (HWND hwnd)
 
LRESULT CALLBACK CardImageWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK CardBackDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
VOID ShowDeckOptionsDlg (HWND hwnd)
 

Variables

TCHAR szHelpPath [MAX_PATH]
 
DWORD dwAppStartTime
 
HWND hwndMain
 
HWND hwndStatus
 
HINSTANCE hInstance
 
TCHAR szAppName [128]
 
TCHAR szScore [64]
 
TCHAR szTime [64]
 
TCHAR MsgQuit [128]
 
TCHAR MsgAbout [128]
 
TCHAR MsgWin [128]
 
TCHAR MsgDeal [128]
 
DWORD dwOptions = OPTION_THREE_CARDS
 
DWORD dwTime
 
DWORD dwWasteCount
 
DWORD dwWasteTreshold
 
DWORD dwPrevMode
 
long lScore
 
UINT_PTR PlayTimer = 0
 
CardWindow SolWnd
 

Typedef Documentation

◆ CARDBACK

◆ PCARDBACK

Function Documentation

◆ _tWinMain()

int WINAPI _tWinMain ( HINSTANCE  hInst,
HINSTANCE  hPrev,
LPTSTR  szCmdLine,
int  iCmdShow 
)

Definition at line 184 of file solitaire.cpp.

185 {
186  HWND hwnd;
187  MSG msg;
188  WNDCLASS wndclass;
190  HACCEL hAccelTable;
191 
192  hInstance = hInst;
193 
194  // Load application title
195  LoadString(hInst, IDS_SOL_NAME, szAppName, sizeof(szAppName) / sizeof(szAppName[0]));
196  // Load MsgBox() texts here to avoid loading them many times later
197  LoadString(hInst, IDS_SOL_ABOUT, MsgAbout, sizeof(MsgAbout) / sizeof(MsgAbout[0]));
198  LoadString(hInst, IDS_SOL_QUIT, MsgQuit, sizeof(MsgQuit) / sizeof(MsgQuit[0]));
199  LoadString(hInst, IDS_SOL_WIN, MsgWin, sizeof(MsgWin) / sizeof(MsgWin[0]));
200  LoadString(hInst, IDS_SOL_DEAL, MsgDeal, sizeof(MsgDeal) / sizeof(MsgDeal[0]));
201 
202  LoadString(hInst, IDS_SOL_SCORE, szScore, sizeof(szScore) / sizeof(TCHAR));
203  LoadString(hInst, IDS_SOL_TIME, szTime, sizeof(szTime) / sizeof(TCHAR));
204 
205  //Window class for the main application parent window
206  wndclass.style = 0;//CS_HREDRAW | CS_VREDRAW;
207  wndclass.lpfnWndProc = WndProc;
208  wndclass.cbClsExtra = 0;
209  wndclass.cbWndExtra = 0;
210  wndclass.hInstance = hInst;
211  wndclass.hIcon = LoadIcon (hInst, MAKEINTRESOURCE(IDI_SOLITAIRE));
212  wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
213  wndclass.hbrBackground = (HBRUSH)NULL;
215  wndclass.lpszClassName = szAppName;
216 
217  RegisterClass(&wndclass);
218 
219  ice.dwSize = sizeof(ice);
220  ice.dwICC = ICC_BAR_CLASSES;
221  InitCommonControlsEx(&ice);
222 
223  srand((unsigned)GetTickCount());//timeGetTime());
224 
225 // InitCardLib();
226 
227  LoadSettings();
228 
230 
231  //Construct the path to our help file
232  MakePath(szHelpPath, MAX_PATH, _T(".hlp"));
233 
234  hwnd = CreateWindow(szAppName, // window class name
235  szAppName, // window caption
237  ,//|WS_CLIPCHILDREN, // window style
238  CW_USEDEFAULT, // initial x position
239  CW_USEDEFAULT, // initial y position
240  0, // The real size will be computed in WndProc through WM_GETMINMAXINFO
241  0, // The real size will be computed in WndProc through WM_GETMINMAXINFO
242  NULL, // parent window handle
243  NULL, // use window class menu
244  hInst, // program instance handle
245  NULL); // creation parameters
246  if (hwnd == NULL)
247  return 1;
248 
249  hwndMain = hwnd;
250 
251  UpdateStatusBar();
252 
253  ShowWindow(hwnd, iCmdShow);
254  UpdateWindow(hwnd);
255 
257 
258  while(GetMessage(&msg, NULL,0,0))
259  {
260  if(!TranslateAccelerator(hwnd, hAccelTable, &msg))
261  {
262  TranslateMessage(&msg);
263  DispatchMessage(&msg);
264  }
265  }
266 
267  SaveSettings();
268 
269  return msg.wParam;
270 }
#define IDS_SOL_ABOUT
Definition: resource.h:43
#define TranslateAccelerator
Definition: winuser.h:5726
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define DispatchMessage
Definition: winuser.h:5631
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define IDS_SOL_QUIT
Definition: resource.h:44
#define IDR_ACCELERATOR1
Definition: resource.h:7
#define CreateWindow
Definition: winuser.h:5620
TCHAR szTime[64]
Definition: solitaire.cpp:18
HWND hwndMain
Definition: solitaire.cpp:12
TCHAR MsgWin[128]
Definition: solitaire.cpp:21
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define IDR_MENU1
Definition: resource.h:6
BOOL WINAPI UpdateWindow(_In_ HWND)
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
void __cdecl srand(_In_ unsigned int _Seed)
int cbClsExtra
Definition: winuser.h:3118
LPCSTR lpszMenuName
Definition: winuser.h:3124
VOID SaveSettings(VOID)
Definition: solitaire.cpp:92
TCHAR MsgAbout[128]
Definition: solitaire.cpp:20
HBRUSH hbrBackground
Definition: winuser.h:3123
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define IDS_SOL_DEAL
Definition: resource.h:46
int GetScoreMode(void)
Definition: solitaire.cpp:128
int cbWndExtra
Definition: winuser.h:3119
#define LoadAccelerators
Definition: winuser.h:5676
HCURSOR hCursor
Definition: winuser.h:3122
TCHAR szHelpPath[MAX_PATH]
Definition: solitaire.cpp:9
#define CW_USEDEFAULT
Definition: winuser.h:225
HINSTANCE hInstance
Definition: solitaire.cpp:14
smooth NULL
Definition: ftsmooth.c:416
#define IDS_SOL_NAME
Definition: resource.h:42
#define IDS_SOL_WIN
Definition: resource.h:45
#define IDI_SOLITAIRE
Definition: resource.h:4
char TCHAR
Definition: xmlstorage.h:189
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
#define _T(x)
Definition: vfdio.h:22
#define IDS_SOL_SCORE
Definition: resource.h:47
DWORD dwPrevMode
Definition: solitaire.cpp:28
#define MAX_PATH
Definition: compat.h:26
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
#define IDS_SOL_TIME
Definition: resource.h:48
LPCSTR lpszClassName
Definition: winuser.h:3125
#define LoadCursor
Definition: winuser.h:5678
TCHAR szAppName[128]
Definition: solitaire.cpp:16
UINT style
Definition: winuser.h:3116
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:598
HINSTANCE hInst
Definition: dxdiag.c:13
HINSTANCE hInstance
Definition: winuser.h:3120
TCHAR szScore[64]
Definition: solitaire.cpp:17
#define GetMessage
Definition: winuser.h:5656
WNDPROC lpfnWndProc
Definition: winuser.h:3117
#define msg(x)
Definition: auth_time.c:54
#define IDC_ARROW
Definition: winuser.h:682
TCHAR MsgDeal[128]
Definition: solitaire.cpp:22
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define RegisterClass
Definition: winuser.h:5702
void UpdateStatusBar(void)
Definition: solitaire.cpp:148
#define LoadIcon
Definition: winuser.h:5679
TCHAR MsgQuit[128]
Definition: solitaire.cpp:19
VOID LoadSettings(VOID)
Definition: solitaire.cpp:54
#define LoadString
Definition: winuser.h:5685
HICON hIcon
Definition: winuser.h:3121
void MakePath(TCHAR *szDest, UINT nDestLen, const TCHAR *szExt)
Definition: solitaire.cpp:45

◆ CardBackDlgProc()

INT_PTR CALLBACK CardBackDlgProc ( HWND  hDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 505 of file solitaire.cpp.

Referenced by ShowDeckOptionsDlg().

509 {
510  static PCARDBACK pCardBacks = NULL;
511 
512  switch (uMsg)
513  {
514  case WM_INITDIALOG:
515  {
516  INT i, c;
517  SIZE_T size = sizeof(CARDBACK) * NUM_CARDBACKS;
518 
519  pCardBacks = (PCARDBACK)HeapAlloc(GetProcessHeap(),
520  0,
521  size);
522 
523  for (i = 0, c = CARDBACK_START; c <= CARDBACK_END; i++, c++)
524  {
525  pCardBacks[i].hSelf = GetDlgItem(hDlg, c);
526  pCardBacks[i].bSelected = FALSE;
527  pCardBacks[i].hdcNum = CARDBACK_RES_START + i;
528  pCardBacks[i].imgNum = i + 1;
529  pCardBacks[i].hOldProc = (WNDPROC)SetWindowLongPtr(pCardBacks[i].hSelf,
530  GWLP_WNDPROC,
532 
533  SetWindowLongPtr(pCardBacks[i].hSelf,
535  (LONG_PTR)&pCardBacks[i]);
536  }
537 
538  return TRUE;
539  }
540 
541  case WM_COMMAND:
542  if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
543  {
544  INT i, num = 0;
545  for (i = 0; i < NUM_CARDBACKS; i++)
546  {
547  if (pCardBacks[i].bSelected)
548  {
549  num = pCardBacks[i].imgNum;
550  }
551  }
552 
553  EndDialog(hDlg, LOWORD(wParam) == IDOK ? num : FALSE);
554  HeapFree(GetProcessHeap(), 0, pCardBacks);
555  return TRUE;
556  }
557 
558  if (HIWORD(wParam) == STN_CLICKED)
559  {
560  INT i;
561  RECT rc;
562  for (i = 0; i < NUM_CARDBACKS; i++)
563  {
564  if (pCardBacks[i].hSelf == (HWND)lParam)
565  {
566  pCardBacks[i].bSelected = TRUE;
567  }
568  else
569  pCardBacks[i].bSelected = FALSE;
570 
571  GetClientRect(pCardBacks[i].hSelf, &rc);
572  InvalidateRect(pCardBacks[i].hSelf, &rc, TRUE);
573  }
574 
575  break;
576  }
577  }
578 
579  return FALSE;
580 }
HWND hSelf
Definition: solitaire.cpp:36
INT imgNum
Definition: solitaire.cpp:39
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define CARDBACK_RES_START
Definition: solitaire.h:19
int32_t INT
Definition: typedefs.h:56
#define SetWindowLongPtr
Definition: treelist.c:70
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define GWLP_USERDATA
Definition: treelist.c:63
smooth NULL
Definition: ftsmooth.c:416
WNDPROC hOldProc
Definition: solitaire.cpp:37
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define STN_CLICKED
Definition: winuser.h:2055
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
struct _CardBack CARDBACK
#define CARDBACK_START
Definition: solitaire.h:16
GLuint GLuint num
Definition: glext.h:9618
LRESULT CALLBACK CardImageWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:427
BOOL bSelected
Definition: solitaire.cpp:40
#define NUM_CARDBACKS
Definition: solitaire.h:18
#define WM_COMMAND
Definition: winuser.h:1716
#define GWLP_WNDPROC
Definition: treelist.c:66
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2859
ULONG_PTR SIZE_T
Definition: typedefs.h:78
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define CARDBACK_END
Definition: solitaire.h:17
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define c
Definition: ke_i.h:80
#define HIWORD(l)
Definition: typedefs.h:246
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
struct _CardBack * PCARDBACK
INT hdcNum
Definition: solitaire.cpp:38

◆ CardImageWndProc()

LRESULT CALLBACK CardImageWndProc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 427 of file solitaire.cpp.

Referenced by CardBackDlgProc().

431 {
432  PCARDBACK pCardBack = (PCARDBACK)GetWindowLongPtr(hwnd,
433  GWLP_USERDATA);
434  static WNDPROC hOldProc = NULL;
435 
436  if (!hOldProc && pCardBack)
437  hOldProc = pCardBack->hOldProc;
438 
439  switch (msg)
440  {
441  case WM_PAINT:
442  {
443  HDC hdc;
444  PAINTSTRUCT ps;
445  HPEN hPen, hOldPen;
446  HBRUSH hBrush, hOldBrush;
447  RECT rc;
448 
449  hdc = BeginPaint(hwnd, &ps);
450 
451  if (pCardBack->bSelected)
452  {
453  hPen = CreatePen(PS_SOLID, 2, RGB(0,0,0));
454  }
455  else
456  {
458  hPen = CreatePen(PS_SOLID, 2, Face);
459  }
460 
461  GetClientRect(hwnd, &rc);
462  hBrush = (HBRUSH)GetStockObject(NULL_BRUSH);
463  hOldPen = (HPEN)SelectObject(hdc, hPen);
464  hOldBrush = (HBRUSH)SelectObject(hdc, hBrush);
465 
466  Rectangle(hdc,
467  rc.left+1,
468  rc.top+1,
469  rc.right,
470  rc.bottom);
471 
472  StretchBlt(hdc,
473  2,
474  2,
478  pCardBack->hdcNum * __cardwidth,
479  0,
480  __cardwidth,
481  __cardheight,
482  SRCCOPY);
483 
484  SelectObject(hdc, hOldPen);
485  SelectObject(hdc, hOldBrush);
486 
487  EndPaint(hwnd, &ps);
488 
489  break;
490  }
491 
492  case WM_LBUTTONDOWN:
493  pCardBack->bSelected = pCardBack->bSelected ? FALSE : TRUE;
494  break;
495  }
496 
497  return CallWindowProc(hOldProc,
498  hwnd,
499  msg,
500  wParam,
501  lParam);
502 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define CallWindowProc
Definition: winuser.h:5601
#define HDC
Definition: msvc.h:22
#define TRUE
Definition: types.h:120
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
#define NULL_BRUSH
Definition: wingdi.h:899
LONG top
Definition: windef.h:297
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
LONG left
Definition: windef.h:296
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
LONG right
Definition: windef.h:298
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI StretchBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
WPARAM wParam
Definition: combotst.c:138
HDC __hdcCardBitmaps
Definition: cardlib.cpp:18
#define PS_SOLID
Definition: wingdi.h:584
#define CARDBACK_OPTIONS_HEIGHT
Definition: solitaire.h:21
#define COLOR_3DFACE
Definition: winuser.h:919
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define GWLP_USERDATA
Definition: treelist.c:63
HDC hdc
Definition: msvc.h:53
UINT msg
Definition: msvc.h:92
smooth NULL
Definition: ftsmooth.c:416
WNDPROC hOldProc
Definition: solitaire.cpp:37
#define RGB(r, g, b)
Definition: wingdi.h:2917
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL bSelected
Definition: solitaire.cpp:40
#define WM_PAINT
Definition: winuser.h:1602
int __cardwidth
Definition: cardlib.cpp:25
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2859
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
int __cardheight
Definition: cardlib.cpp:26
LONG bottom
Definition: windef.h:299
#define GetWindowLongPtr
Definition: treelist.c:73
#define CARDBACK_OPTIONS_WIDTH
Definition: solitaire.h:20
LPARAM lParam
Definition: combotst.c:139
#define SRCCOPY
Definition: wingdi.h:331
struct _CardBack * PCARDBACK
INT hdcNum
Definition: solitaire.cpp:38

◆ GetScoreMode()

int GetScoreMode ( void  )

Definition at line 128 of file solitaire.cpp.

Referenced by _tWinMain(), DeckClickProc(), NewGame(), OptionsDlgProc(), RowStackClickProc(), RowStackDropProc(), ShowGameOptionsDlg(), SuitStackAddProc(), SuitStackDropProc(), UpdateStatusBar(), and WndProc().

129 {
131  {
132  return SCORE_NONE;
133  }
134 
135  if (dwOptions & OPTION_SCORE_STD)
136  {
137  return SCORE_STD;
138  }
139 
140  if (dwOptions & OPTION_SCORE_VEGAS)
141  {
142  return SCORE_VEGAS;
143  }
144 
145  return 0;
146 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define OPTION_SCORE_VEGAS
Definition: solitaire.h:15
#define SCORE_NONE
Definition: solitaire.h:44
#define OPTION_SCORE_STD
Definition: solitaire.h:14
#define SCORE_STD
Definition: solitaire.h:45
#define SCORE_VEGAS
Definition: solitaire.h:46

◆ LoadSettings()

VOID LoadSettings ( VOID  )

Definition at line 54 of file solitaire.cpp.

Referenced by _tWinMain().

55 {
56  DWORD dwDisposition;
57  DWORD dwSize;
58  DWORD dwBack;
59  HKEY hKey;
60 
62  _T("Software\\ReactOS\\Solitaire"),
63  0,
64  NULL,
66  KEY_READ,
67  NULL,
68  &hKey,
69  &dwDisposition))
70  return;
71 
72  dwSize = sizeof(DWORD);
73  RegQueryValueEx(hKey,
74  _T("Options"),
75  NULL,
76  NULL,
77  (LPBYTE)&dwOptions,
78  &dwSize);
79 
80  dwSize = sizeof(DWORD);
81  RegQueryValueEx(hKey,
82  _T("Back"),
83  NULL,
84  NULL,
85  (LPBYTE)&dwBack,
86  &dwSize);
87  SolWnd.SetBackCardIdx(dwBack);
88 
89  RegCloseKey(hKey);
90 }
#define RegQueryValueEx
Definition: winreg.h:524
DWORD dwOptions
Definition: solitaire.cpp:23
#define KEY_READ
Definition: nt_native.h:1023
#define DWORD
Definition: msvc.h:34
#define HKEY_CURRENT_USER
Definition: winreg.h:11
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define _T(x)
Definition: vfdio.h:22
unsigned long DWORD
Definition: ntddk_ex.h:95
void SetBackCardIdx(UINT uBackIdx)
Definition: cardwindow.cpp:728
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define RegCreateKeyEx
Definition: winreg.h:501
CardWindow SolWnd
Definition: solitaire.cpp:32

◆ MakePath()

void MakePath ( TCHAR szDest,
UINT  nDestLen,
const TCHAR szExt 
)

Definition at line 45 of file solitaire.cpp.

Referenced by _tWinMain().

46 {
47  TCHAR *ptr;
48 
49  ptr = szDest + GetModuleFileName(GetModuleHandle(0), szDest, nDestLen) - 1;
50  while(*ptr-- != '.');
51  lstrcpy(ptr + 1, szExt);
52 }
static PVOID ptr
Definition: dispmode.c:27
char TCHAR
Definition: xmlstorage.h:189
#define GetModuleFileName
Definition: winbase.h:3645
#define GetModuleHandle
Definition: winbase.h:3641
#define lstrcpy
Definition: winbase.h:3688

◆ OptionsDlgProc()

INT_PTR CALLBACK OptionsDlgProc ( HWND  hDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 273 of file solitaire.cpp.

Referenced by MainDlgProc(), and ShowGameOptionsDlg().

274 {
275  HWND hCtrl;
276 
277  switch (uMsg)
278  {
279  case WM_INITDIALOG:
280  // For now, the Help dialog item is disabled because of lacking of HTML Help support
282 
285 
286  CheckDlgButton(hDlg,
289 
290  CheckDlgButton(hDlg,
293 
294  CheckDlgButton(hDlg,
297 
298  hCtrl = GetDlgItem(hDlg, IDC_OPT_KEEPSCORE);
299 
300  if (GetScoreMode() == SCORE_NONE)
301  {
303  EnableWindow(hCtrl, FALSE);
304  }
305  else if (GetScoreMode() == SCORE_STD)
306  {
308  EnableWindow(hCtrl, FALSE);
309  }
310  else if (GetScoreMode() == SCORE_VEGAS)
311  {
313  EnableWindow(hCtrl, TRUE);
314  }
315  return TRUE;
316 
317  case WM_COMMAND:
318  switch(LOWORD(wParam))
319  {
320  case IDC_OPT_NOSCORE:
321  case IDC_OPT_STANDARD:
322  case IDC_OPT_VEGAS:
323  hCtrl = GetDlgItem(hDlg, IDC_OPT_KEEPSCORE);
324  if (wParam == IDC_OPT_VEGAS)
325  EnableWindow(hCtrl, TRUE);
326  else
327  EnableWindow(hCtrl, FALSE);
328  return TRUE;
329 
330  case IDOK:
334 
337  else
339 
342  else
344 
347  else
349 
351  {
354  }
355  else if (IsDlgButtonChecked(hDlg, IDC_OPT_VEGAS) == BST_CHECKED)
356  {
359  }
361  {
364  }
365 
366  UpdateStatusBar();
367 
368  EndDialog(hDlg, TRUE);
369  return TRUE;
370 
371  case IDCANCEL:
372  EndDialog(hDlg, FALSE);
373  return TRUE;
374  }
375  break;
376  }
377  return FALSE;
378 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define OPTION_SHOW_STATUS
Definition: solitaire.h:10
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define OPTION_KEEP_SCORE
Definition: solitaire.h:13
#define IDC_OPT_SHOWTIME
Definition: resource.h:21
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define MF_BYCOMMAND
Definition: winuser.h:202
#define IDC_OPT_STATUSBAR
Definition: resource.h:22
#define OPTION_SCORE_VEGAS
Definition: solitaire.h:15
#define IDC_OPT_NOSCORE
Definition: resource.h:25
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
int GetScoreMode(void)
Definition: solitaire.cpp:128
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define SCORE_NONE
Definition: solitaire.h:44
#define IDC_OPT_DRAWONE
Definition: resource.h:19
#define IDC_OPT_DRAWTHREE
Definition: resource.h:20
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define IDM_HELP_CONTENTS
Definition: resource.h:14
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_OPT_KEEPSCORE
Definition: resource.h:26
#define OPTION_THREE_CARDS
Definition: solitaire.h:11
#define WM_COMMAND
Definition: winuser.h:1716
#define BST_UNCHECKED
Definition: winuser.h:199
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define BST_CHECKED
Definition: winuser.h:197
#define IDC_OPT_STANDARD
Definition: resource.h:23
#define OPTION_SCORE_STD
Definition: solitaire.h:14
#define SCORE_STD
Definition: solitaire.h:45
#define OPTION_SHOW_TIME
Definition: solitaire.h:12
#define SCORE_VEGAS
Definition: solitaire.h:46
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
void UpdateStatusBar(void)
Definition: solitaire.cpp:148
#define MF_GRAYED
Definition: winuser.h:129
#define IDC_OPT_VEGAS
Definition: resource.h:24
#define IDCANCEL
Definition: winuser.h:825
HMENU WINAPI GetMenu(_In_ HWND)
#define WM_INITDIALOG
Definition: winuser.h:1715
#define LOWORD(l)
Definition: pedump.c:82

◆ SaveSettings()

VOID SaveSettings ( VOID  )

Definition at line 92 of file solitaire.cpp.

Referenced by _tWinMain().

93 {
94  DWORD dwDisposition;
95  DWORD dwBack;
96  HKEY hKey;
97 
99  _T("Software\\ReactOS\\Solitaire"),
100  0,
101  NULL,
103  KEY_WRITE,
104  NULL,
105  &hKey,
106  &dwDisposition))
107  return;
108 
109  RegSetValueEx(hKey,
110  _T("Options"),
111  0,
112  REG_DWORD,
113  (CONST BYTE *)&dwOptions,
114  sizeof(DWORD));
115 
116  dwBack = SolWnd.GetBackCardIdx();
117  RegSetValueEx(hKey,
118  _T("Back"),
119  0,
120  REG_DWORD,
121  (CONST BYTE *)&dwBack,
122  sizeof(DWORD));
123 
124  RegCloseKey(hKey);
125 }
DWORD dwOptions
Definition: solitaire.cpp:23
UINT GetBackCardIdx()
Definition: cardwindow.cpp:738
#define HKEY_CURRENT_USER
Definition: winreg.h:11
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
smooth NULL
Definition: ftsmooth.c:416
#define CONST
Definition: compiler.h:170
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
#define _T(x)
Definition: vfdio.h:22
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned char BYTE
Definition: ntddk_ex.h:96
#define REG_DWORD
Definition: sdbapi.c:539
#define RegSetValueEx
Definition: winreg.h:533
#define RegCreateKeyEx
Definition: winreg.h:501
CardWindow SolWnd
Definition: solitaire.cpp:32

◆ SetPlayTimer()

void SetPlayTimer ( void  )

Definition at line 170 of file solitaire.cpp.

Referenced by CanDrop(), DeckClickProc(), PileDblClickProc(), PileRemoveProc(), RowStackDblClickProc(), RowStackDragProc(), RowStackDropProc(), SuitStackAddProc(), and SuitStackDropProc().

171 {
173  {
174  if (!PlayTimer)
175  {
177  }
178  }
179 }
DWORD dwOptions
Definition: solitaire.cpp:23
HWND hwndMain
Definition: solitaire.cpp:12
UINT_PTR PlayTimer
Definition: solitaire.cpp:30
#define IDT_PLAYTIMER
Definition: solitaire.h:33
smooth NULL
Definition: ftsmooth.c:416
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define OPTION_SHOW_TIME
Definition: solitaire.h:12

◆ ShowDeckOptionsDlg()

VOID ShowDeckOptionsDlg ( HWND  hwnd)

Definition at line 583 of file solitaire.cpp.

Referenced by WndProc().

584 {
585  INT cardBack;
586 
587  if ((cardBack = DialogBox(hInstance,
589  hwnd,
590  CardBackDlgProc)))
591  {
592  SolWnd.SetBackCardIdx(CARDBACK_RES_START + (cardBack - 1));
593  SolWnd.Redraw();
594  }
595 }
#define IDD_CARDBACK
Definition: resource.h:27
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define CARDBACK_RES_START
Definition: solitaire.h:19
int32_t INT
Definition: typedefs.h:56
void Redraw(void)
Definition: cardwindow.cpp:553
#define DialogBox
Definition: winuser.h:5627
INT_PTR CALLBACK CardBackDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:505
HINSTANCE hInstance
Definition: solitaire.cpp:14
void SetBackCardIdx(UINT uBackIdx)
Definition: cardwindow.cpp:728
CardWindow SolWnd
Definition: solitaire.cpp:32

◆ ShowGameOptionsDlg()

VOID ShowGameOptionsDlg ( HWND  hwnd)

Definition at line 380 of file solitaire.cpp.

Referenced by WndProc().

381 {
382  DWORD dwOldOptions = dwOptions;
383  RECT rcMain, rcStatus;
384 
385  int iOldScoreMode = GetScoreMode();
386 
388  {
389  if (((dwOldOptions & OPTION_THREE_CARDS) != (dwOptions & OPTION_THREE_CARDS)) ||
390  ((dwOldOptions & OPTION_SHOW_TIME) != (dwOptions & OPTION_SHOW_TIME)) ||
391  (iOldScoreMode != GetScoreMode()))
392  NewGame();
393 
394  if ((dwOldOptions & OPTION_SHOW_STATUS) != (dwOptions & OPTION_SHOW_STATUS))
395  {
396  int nWidth, nHeight, nStatusHeight;
397 
398  GetClientRect(hwndMain, &rcMain);
399  nHeight = rcMain.bottom - rcMain.top;
400  nWidth = rcMain.right - rcMain.left;
401 
402  if (dwOptions & OPTION_SHOW_STATUS)
403  {
404  RECT rc;
405 
407  GetWindowRect(hwndStatus, &rcStatus);
408  nStatusHeight = rcStatus.bottom - rcStatus.top;
409  MoveWindow(SolWnd, 0, 0, nWidth, nHeight-nStatusHeight, TRUE);
410  MoveWindow(hwndStatus, 0, nHeight-nStatusHeight, nWidth, nHeight, TRUE);
411 
412  // Force the window to process WM_GETMINMAXINFO again
413  GetWindowRect(hwndMain, &rc);
414  SetWindowPos(hwndMain, NULL, 0, 0, rc.right - rc.left, rc.bottom - rc.top, SWP_NOMOVE | SWP_NOZORDER);
415  }
416  else
417  {
419  MoveWindow(SolWnd, 0, 0, nWidth, nHeight, TRUE);
420  }
421  }
422  }
423 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define OPTION_SHOW_STATUS
Definition: solitaire.h:10
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define TRUE
Definition: types.h:120
HWND hwndMain
Definition: solitaire.cpp:12
#define SW_HIDE
Definition: winuser.h:762
LONG top
Definition: windef.h:297
LONG left
Definition: windef.h:296
#define SWP_NOZORDER
Definition: winuser.h:1232
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LONG right
Definition: windef.h:298
#define IDD_OPTIONS
Definition: resource.h:18
void NewGame(void)
Definition: solgame.cpp:17
int GetScoreMode(void)
Definition: solitaire.cpp:128
#define DialogBox
Definition: winuser.h:5627
HWND hwndStatus
Definition: solitaire.cpp:13
HINSTANCE hInstance
Definition: solitaire.cpp:14
smooth NULL
Definition: ftsmooth.c:416
#define SW_SHOW
Definition: winuser.h:769
unsigned long DWORD
Definition: ntddk_ex.h:95
#define OPTION_THREE_CARDS
Definition: solitaire.h:11
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:273
#define OPTION_SHOW_TIME
Definition: solitaire.h:12
LONG bottom
Definition: windef.h:299
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
CardWindow SolWnd
Definition: solitaire.cpp:32

◆ UpdateStatusBar()

void UpdateStatusBar ( void  )

Definition at line 148 of file solitaire.cpp.

Referenced by _tWinMain(), OptionsDlgProc(), and WndProc().

149 {
150  TCHAR szStatusText[128];
151  TCHAR szTempText[64];
152 
153  ZeroMemory(szStatusText, sizeof(szStatusText));
154 
155  if (GetScoreMode() != SCORE_NONE)
156  {
157  _stprintf(szStatusText, szScore, lScore);
158  _tcscat(szStatusText, _T(" "));
159  }
160 
162  {
163  _stprintf(szTempText, szTime, dwTime);
164  _tcscat(szStatusText, szTempText);
165  }
166 
168 }
DWORD dwOptions
Definition: solitaire.cpp:23
TCHAR szTime[64]
Definition: solitaire.cpp:18
long lScore
Definition: solitaire.cpp:29
#define ZeroMemory
Definition: winbase.h:1635
CHAR * LPTSTR
Definition: xmlstorage.h:192
int GetScoreMode(void)
Definition: solitaire.cpp:128
#define SCORE_NONE
Definition: solitaire.h:44
LONG_PTR LPARAM
Definition: windef.h:208
HWND hwndStatus
Definition: solitaire.cpp:13
DWORD dwTime
Definition: solitaire.cpp:25
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
#define SB_SETTEXT
Definition: commctrl.h:1919
#define _stprintf
Definition: utility.h:124
TCHAR szScore[64]
Definition: solitaire.cpp:17
#define SendMessage
Definition: winuser.h:5709
_TCHAR * _tcscat(_TCHAR *s, const _TCHAR *append)
Definition: tcscat.h:8
#define OPTION_SHOW_TIME
Definition: solitaire.h:12
#define SBT_NOBORDERS
Definition: commctrl.h:1941

◆ WndProc()

LRESULT CALLBACK WndProc ( HWND  hwnd,
UINT  iMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 598 of file solitaire.cpp.

Referenced by _tWinMain(), CreateCallProc(), DispatchMessageA(), DispatchMessageW(), FlatButton::FlatButton(), IntCallMessageProc(), IntCreateClass(), IntSetClassWndProc(), IsCallProcHandle(), OwnerdrawnButton::OwnerdrawnButton(), StartMenuButton::StartMenuButton(), ShellBrowserChildT< MainFrameBase >::WndProc(), IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >::WndProc(), ResizeController< Dialog >::WndProc(), CtlColorParent< OwnerDrawParent< Dialog > >::WndProc(), OwnerDrawParent< Dialog >::WndProc(), OwnerdrawnButton::WndProc(), FlatButton::WndProc(), ColorStatic::WndProc(), ExplorerAboutDlg::WndProc(), TrayIconControllerTemplate< BASE >::WndProc(), EditController::WndProc(), and ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >::WndProc().

599 {
600  static int nWidth, nHeight, nStatusHeight;
601 
602  switch(iMsg)
603  {
604  case WM_CREATE:
605  {
606  int parts[] = { 150, -1 };
607  RECT rcStatus;
608 
609  // For now, the Help dialog item is disabled because of lacking of HTML Help support
611 
613 
614  //SendMessage(hwndStatus, SB_SIMPLE, (WPARAM)TRUE, 0);
615 
618 
619  SolWnd.Create(hwnd, 0, WS_CHILD | WS_VISIBLE, 0, 0, 100, 100);
620 
621  CreateSol();
622 
623  // The status bar height is fixed and needed later in WM_SIZE and WM_GETMINMAXINFO
624  // Force the window to process WM_GETMINMAXINFO again
625  GetWindowRect(hwndStatus, &rcStatus);
626  nStatusHeight = rcStatus.bottom - rcStatus.top;
627 
628  // Hide status bar if options say so
629  if (!(dwOptions & OPTION_SHOW_STATUS))
630  {
632  }
633 
634  SetWindowPos(hwnd, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOZORDER);
635 
636  NewGame();
637 
639 
640  return 0;
641  }
642 
643  case WM_DESTROY:
644  PostQuitMessage(0);
645  return 0;
646 
647  case WM_TIMER:
648  if (!fGameStarted)
649  {
651  PlayTimer = 0;
652  }
653  else if (dwOptions & OPTION_SHOW_TIME)
654  {
655  if (((dwTime + 1) % 10 == 0) && (GetScoreMode() == SCORE_STD))
656  {
657  lScore = lScore >= 2 ? lScore - 2 : 0;
658  }
659 
660  dwTime++;
661  }
662 
663  UpdateStatusBar();
664  return 0;
665 
666  case WM_SIZE:
667  nWidth = LOWORD(lParam);
668  nHeight = HIWORD(lParam);
669 
671  {
672  MoveWindow(SolWnd, 0, 0, nWidth, nHeight - nStatusHeight, TRUE);
673  MoveWindow(hwndStatus, 0, nHeight - nStatusHeight, nWidth, nStatusHeight, TRUE);
674  }
675  else
676  {
677  MoveWindow(SolWnd, 0, 0, nWidth, nHeight, TRUE);
678  }
679  //parts[0] = nWidth - 256;
680  //SendMessage(hwndStatus, SB_SETPARTS, 2, (LPARAM)parts);
681  return 0;
682 
683  case WM_GETMINMAXINFO:
684  {
685  MINMAXINFO *mmi;
686 
687  mmi = (MINMAXINFO *)lParam;
691  Y_BORDER +
692  __cardheight +
694  6 * yRowStackCardOffset +
695  __cardheight +
696  Y_BORDER +
697  (dwOptions & OPTION_SHOW_STATUS ? nStatusHeight : 0);
698  return 0;
699  }
700 
701  case WM_COMMAND:
702  switch(LOWORD(wParam))
703  {
704  case IDM_GAME_NEW:
705  //simulate a button click on the new button..
706  NewGame();
707  return 0;
708 
709  case IDM_GAME_DECK:
710  ShowDeckOptionsDlg(hwnd);
711  return 0;
712 
713  case IDM_GAME_OPTIONS:
714  ShowGameOptionsDlg(hwnd);
715  return 0;
716 
717  case IDM_HELP_CONTENTS:
718  WinHelp(hwnd, szHelpPath, HELP_CONTENTS, 0);//HELP_KEY, (DWORD)"How to play");
719  return 0;
720 
721  case IDM_HELP_ABOUT:
723  return 0;
724 
725  case IDM_GAME_EXIT:
726  PostMessage(hwnd, WM_CLOSE, 0, 0);
727  return 0;
728  }
729 
730  return 0;
731 
732  case WM_CLOSE:
733  if (fGameStarted == false)
734  {
735  DestroyWindow(hwnd);
736  return 0;
737  }
738  else
739  {
740  int ret;
741 
743  if (ret == IDYES)
744  {
745  WinHelp(hwnd, szHelpPath, HELP_QUIT, 0);
746  DestroyWindow(hwnd);
747  }
748  }
749  return 0;
750  }
751 
752  return DefWindowProc (hwnd, iMsg, wParam, lParam);
753 }
POINT ptMinTrackSize
Definition: winuser.h:3572
DWORD dwOptions
Definition: solitaire.cpp:23
#define OPTION_SHOW_STATUS
Definition: solitaire.h:10
#define Y_BORDER
Definition: solitaire.h:53
#define IDM_GAME_OPTIONS
Definition: resource.h:12
#define TRUE
Definition: types.h:120
#define HELP_CONTENTS
Definition: winuser.h:2359
#define MF_BYCOMMAND
Definition: winuser.h:202
long y
Definition: polytest.cpp:48
#define IDYES
Definition: winuser.h:829
long x
Definition: polytest.cpp:48
HWND hwndMain
Definition: solitaire.cpp:12
#define X_BORDER
Definition: solitaire.h:49
long lScore
Definition: solitaire.cpp:29
#define SW_HIDE
Definition: winuser.h:762
BOOL Create(HWND hwndParent, DWORD dwExStyle, DWORD dwStyle, int x, int y, int width, int height)
Definition: cardwindow.cpp:109
#define HELP_QUIT
Definition: winuser.h:2368
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
LONG top
Definition: windef.h:297
#define IDM_GAME_DECK
Definition: resource.h:11
int yRowStackCardOffset
Definition: solcreate.cpp:12
#define IDM_HELP_ABOUT
Definition: resource.h:375
TCHAR MsgAbout[128]
Definition: solitaire.cpp:20
#define WS_CHILD
Definition: pedump.c:617
UINT_PTR PlayTimer
Definition: solitaire.cpp:30
#define SWP_NOZORDER
Definition: winuser.h:1232
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
void CreateSol()
Definition: solcreate.cpp:14
#define Y_ROWSTACK_BORDER
Definition: solitaire.h:55
BOOL WINAPI DestroyWindow(_In_ HWND)
WPARAM wParam
Definition: combotst.c:138
void NewGame(void)
Definition: solgame.cpp:17
int GetScoreMode(void)
Definition: solitaire.cpp:128
#define IDT_PLAYTIMER
Definition: solitaire.h:33
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MB_YESNO
Definition: winuser.h:811
LONG_PTR LPARAM
Definition: windef.h:208
#define CreateStatusWindow
Definition: commctrl.h:1903
HWND hwndStatus
Definition: solitaire.cpp:13
TCHAR szHelpPath[MAX_PATH]
Definition: solitaire.cpp:9
#define X_ROWSTACK_BORDER
Definition: solitaire.h:51
smooth NULL
Definition: ftsmooth.c:416
#define MB_ICONQUESTION
Definition: winuser.h:783
#define DefWindowProc
Definition: ros2win.h:31
#define WM_DESTROY
Definition: winuser.h:1591
#define PostMessage
Definition: winuser.h:5698
DWORD dwTime
Definition: solitaire.cpp:25
#define CCS_BOTTOM
Definition: commctrl.h:2214
#define NUM_ROW_STACKS
Definition: solitaire.h:38
#define _T(x)
Definition: vfdio.h:22
VOID ShowDeckOptionsDlg(HWND hwnd)
Definition: solitaire.cpp:583
#define IDM_HELP_CONTENTS
Definition: resource.h:14
#define SM_CYCAPTION
Definition: winuser.h:953
#define SBARS_SIZEGRIP
Definition: commctrl.h:1893
#define WM_SIZE
Definition: winuser.h:1593
#define WM_TIMER
Definition: winuser.h:1718
#define WM_CLOSE
Definition: winuser.h:1603
int WINAPI GetSystemMetrics(_In_ int)
#define MB_ICONINFORMATION
Definition: winuser.h:796
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
int ret
#define SB_SETTEXT
Definition: commctrl.h:1919
#define MessageBox
Definition: winuser.h:5688
#define WM_COMMAND
Definition: winuser.h:1716
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
int __cardwidth
Definition: cardlib.cpp:25
VOID ShowGameOptionsDlg(HWND hwnd)
Definition: solitaire.cpp:380
TCHAR szAppName[128]
Definition: solitaire.cpp:16
#define IDM_GAME_EXIT
Definition: resource.h:13
#define IDM_GAME_NEW
Definition: resource.h:10
bool fGameStarted
Definition: solgame.cpp:14
#define MB_OK
Definition: winuser.h:784
#define SB_SETPARTS
Definition: commctrl.h:1924
#define SendMessage
Definition: winuser.h:5709
int __cardheight
Definition: cardlib.cpp:26
#define WM_CREATE
Definition: winuser.h:1590
DWORD dwAppStartTime
Definition: solitaire.cpp:11
#define SCORE_STD
Definition: solitaire.h:45
#define OPTION_SHOW_TIME
Definition: solitaire.h:12
#define HIWORD(l)
Definition: typedefs.h:246
LONG bottom
Definition: windef.h:299
#define SWP_NOMOVE
Definition: winuser.h:1229
#define SM_CYMENU
Definition: winuser.h:966
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
void UpdateStatusBar(void)
Definition: solitaire.cpp:148
#define MF_GRAYED
Definition: winuser.h:129
#define WS_VISIBLE
Definition: pedump.c:620
HMENU WINAPI GetMenu(_In_ HWND)
TCHAR MsgQuit[128]
Definition: solitaire.cpp:19
LPARAM lParam
Definition: combotst.c:139
#define WM_GETMINMAXINFO
Definition: winuser.h:1622
#define SBT_NOBORDERS
Definition: commctrl.h:1941
#define LOWORD(l)
Definition: pedump.c:82
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
CardWindow SolWnd
Definition: solitaire.cpp:32
#define WinHelp
Definition: winuser.h:5730

Variable Documentation

◆ dwAppStartTime

DWORD dwAppStartTime

Definition at line 11 of file solitaire.cpp.

Referenced by WndProc().

◆ dwOptions

◆ dwPrevMode

DWORD dwPrevMode

Definition at line 28 of file solitaire.cpp.

Referenced by _tWinMain(), and NewGame().

◆ dwTime

◆ dwWasteCount

DWORD dwWasteCount

Definition at line 26 of file solitaire.cpp.

Referenced by DeckClickProc(), and NewGame().

◆ dwWasteTreshold

DWORD dwWasteTreshold

Definition at line 27 of file solitaire.cpp.

Referenced by DeckClickProc(), and NewGame().

◆ hInstance

HINSTANCE hInstance

Definition at line 14 of file solitaire.cpp.

◆ hwndMain

◆ hwndStatus

◆ lScore

◆ MsgAbout

TCHAR MsgAbout[128]

Definition at line 20 of file solitaire.cpp.

Referenced by _tWinMain(), and WndProc().

◆ MsgDeal

TCHAR MsgDeal[128]

Definition at line 22 of file solitaire.cpp.

Referenced by _tWinMain().

◆ MsgQuit

TCHAR MsgQuit[128]

Definition at line 19 of file solitaire.cpp.

Referenced by _tWinMain(), and WndProc().

◆ MsgWin

TCHAR MsgWin[128]

Definition at line 21 of file solitaire.cpp.

Referenced by _tWinMain().

◆ PlayTimer

UINT_PTR PlayTimer = 0

Definition at line 30 of file solitaire.cpp.

Referenced by SetPlayTimer(), SuitStackAddProc(), and WndProc().

◆ SolWnd

CardWindow SolWnd

Definition at line 32 of file solitaire.cpp.

Referenced by CreateSol(), DeckClickProc(), NewGame(), and SuitStackAddProc().

◆ szAppName

◆ szHelpPath

TCHAR szHelpPath[MAX_PATH]

Definition at line 9 of file solitaire.cpp.

Referenced by _tWinMain(), and WndProc().

◆ szScore

TCHAR szScore[64]

Definition at line 17 of file solitaire.cpp.

Referenced by _tWinMain(), and UpdateStatusBar().

◆ szTime