ReactOS  0.4.15-dev-2536-g90b3a9c
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)
 
void SetUndoMenuState (bool enable)
 
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
 
HMENU hGameMenu
 
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 197 of file solitaire.cpp.

198 {
199  HWND hwnd;
200  MSG msg;
201  WNDCLASS wndclass;
203  HACCEL hAccelTable;
204 
205  hInstance = hInst;
206 
207  // Load application title
208  LoadString(hInst, IDS_SOL_NAME, szAppName, sizeof(szAppName) / sizeof(szAppName[0]));
209  // Load MsgBox() texts here to avoid loading them many times later
210  LoadString(hInst, IDS_SOL_ABOUT, MsgAbout, sizeof(MsgAbout) / sizeof(MsgAbout[0]));
211  LoadString(hInst, IDS_SOL_QUIT, MsgQuit, sizeof(MsgQuit) / sizeof(MsgQuit[0]));
212  LoadString(hInst, IDS_SOL_WIN, MsgWin, sizeof(MsgWin) / sizeof(MsgWin[0]));
213  LoadString(hInst, IDS_SOL_DEAL, MsgDeal, sizeof(MsgDeal) / sizeof(MsgDeal[0]));
214 
215  LoadString(hInst, IDS_SOL_SCORE, szScore, sizeof(szScore) / sizeof(TCHAR));
216  LoadString(hInst, IDS_SOL_TIME, szTime, sizeof(szTime) / sizeof(TCHAR));
217 
218  //Window class for the main application parent window
219  wndclass.style = 0;//CS_HREDRAW | CS_VREDRAW;
220  wndclass.lpfnWndProc = WndProc;
221  wndclass.cbClsExtra = 0;
222  wndclass.cbWndExtra = 0;
223  wndclass.hInstance = hInst;
225  wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
226  wndclass.hbrBackground = (HBRUSH)NULL;
228  wndclass.lpszClassName = szAppName;
229 
230  RegisterClass(&wndclass);
231 
232  ice.dwSize = sizeof(ice);
233  ice.dwICC = ICC_BAR_CLASSES;
234  InitCommonControlsEx(&ice);
235 
236  srand((unsigned)GetTickCount());//timeGetTime());
237 
238 // InitCardLib();
239 
240  LoadSettings();
241 
243 
244  //Construct the path to our help file
245  MakePath(szHelpPath, MAX_PATH, _T(".hlp"));
246 
247  hwnd = CreateWindow(szAppName, // window class name
248  szAppName, // window caption
250  ,//|WS_CLIPCHILDREN, // window style
251  CW_USEDEFAULT, // initial x position
252  CW_USEDEFAULT, // initial y position
253  0, // The real size will be computed in WndProc through WM_GETMINMAXINFO
254  0, // The real size will be computed in WndProc through WM_GETMINMAXINFO
255  NULL, // parent window handle
256  NULL, // use window class menu
257  hInst, // program instance handle
258  NULL); // creation parameters
259  if (hwnd == NULL)
260  return 1;
261 
262  hwndMain = hwnd;
263 
265 
266  UpdateStatusBar();
267 
268  ShowWindow(hwnd, iCmdShow);
270 
272 
273  while(GetMessage(&msg, NULL,0,0))
274  {
275  if(!TranslateAccelerator(hwnd, hAccelTable, &msg))
276  {
279  }
280  }
281 
282  SaveSettings();
283 
284  return msg.wParam;
285 }
#define IDS_SOL_ABOUT
Definition: resource.h:44
#define TranslateAccelerator
Definition: winuser.h:5835
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define DispatchMessage
Definition: winuser.h:5740
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define IDS_SOL_QUIT
Definition: resource.h:45
#define IDR_ACCELERATOR1
Definition: resource.h:7
#define CreateWindow
Definition: winuser.h:5729
TCHAR szTime[64]
Definition: solitaire.cpp:19
HWND hwndMain
Definition: solitaire.cpp:12
TCHAR MsgWin[128]
Definition: solitaire.cpp:22
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
HMENU hGameMenu
Definition: solitaire.cpp:15
#define IDR_MENU1
Definition: resource.h:6
BOOL WINAPI UpdateWindow(_In_ HWND)
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
void __cdecl srand(_In_ unsigned int _Seed)
int cbClsExtra
Definition: winuser.h:3140
LPCSTR lpszMenuName
Definition: winuser.h:3146
VOID SaveSettings(VOID)
Definition: solitaire.cpp:93
TCHAR MsgAbout[128]
Definition: solitaire.cpp:21
HBRUSH hbrBackground
Definition: winuser.h:3145
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define IDS_SOL_DEAL
Definition: resource.h:47
int GetScoreMode(void)
Definition: solitaire.cpp:129
int cbWndExtra
Definition: winuser.h:3141
#define LoadAccelerators
Definition: winuser.h:5785
HCURSOR hCursor
Definition: winuser.h:3144
TCHAR szHelpPath[MAX_PATH]
Definition: solitaire.cpp:9
#define CW_USEDEFAULT
Definition: winuser.h:225
HINSTANCE hInstance
Definition: solitaire.cpp:14
#define IDS_SOL_NAME
Definition: resource.h:43
#define IDS_SOL_WIN
Definition: resource.h:46
#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:48
DWORD dwPrevMode
Definition: solitaire.cpp:29
#define MAX_PATH
Definition: compat.h:34
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
#define IDS_SOL_TIME
Definition: resource.h:49
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
LPCSTR lpszClassName
Definition: winuser.h:3147
#define LoadCursor
Definition: winuser.h:5787
TCHAR szAppName[128]
Definition: solitaire.cpp:17
UINT style
Definition: winuser.h:3138
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:613
HINSTANCE hInst
Definition: dxdiag.c:13
HINSTANCE hInstance
Definition: winuser.h:3142
#define NULL
Definition: types.h:112
TCHAR szScore[64]
Definition: solitaire.cpp:18
#define GetMessage
Definition: winuser.h:5765
WNDPROC lpfnWndProc
Definition: winuser.h:3139
#define msg(x)
Definition: auth_time.c:54
#define IDC_ARROW
Definition: winuser.h:682
TCHAR MsgDeal[128]
Definition: solitaire.cpp:23
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define RegisterClass
Definition: winuser.h:5811
void UpdateStatusBar(void)
Definition: solitaire.cpp:149
#define LoadIcon
Definition: winuser.h:5788
HMENU WINAPI GetMenu(_In_ HWND)
TCHAR MsgQuit[128]
Definition: solitaire.cpp:20
VOID LoadSettings(VOID)
Definition: solitaire.cpp:55
#define LoadString
Definition: winuser.h:5794
HICON hIcon
Definition: winuser.h:3143
void MakePath(TCHAR *szDest, UINT nDestLen, const TCHAR *szExt)
Definition: solitaire.cpp:46

◆ CardBackDlgProc()

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

Definition at line 520 of file solitaire.cpp.

524 {
525  static PCARDBACK pCardBacks = NULL;
526 
527  switch (uMsg)
528  {
529  case WM_INITDIALOG:
530  {
531  INT i, c;
532  SIZE_T size = sizeof(CARDBACK) * NUM_CARDBACKS;
533 
534  pCardBacks = (PCARDBACK)HeapAlloc(GetProcessHeap(),
535  0,
536  size);
537 
538  for (i = 0, c = CARDBACK_START; c <= CARDBACK_END; i++, c++)
539  {
540  pCardBacks[i].hSelf = GetDlgItem(hDlg, c);
541  pCardBacks[i].bSelected = FALSE;
542  pCardBacks[i].hdcNum = CARDBACK_RES_START + i;
543  pCardBacks[i].imgNum = i + 1;
544  pCardBacks[i].hOldProc = (WNDPROC)SetWindowLongPtr(pCardBacks[i].hSelf,
545  GWLP_WNDPROC,
547 
548  SetWindowLongPtr(pCardBacks[i].hSelf,
550  (LONG_PTR)&pCardBacks[i]);
551  }
552 
553  return TRUE;
554  }
555 
556  case WM_COMMAND:
557  if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
558  {
559  INT i, num = 0;
560  for (i = 0; i < NUM_CARDBACKS; i++)
561  {
562  if (pCardBacks[i].bSelected)
563  {
564  num = pCardBacks[i].imgNum;
565  }
566  }
567 
568  EndDialog(hDlg, LOWORD(wParam) == IDOK ? num : FALSE);
569  HeapFree(GetProcessHeap(), 0, pCardBacks);
570  return TRUE;
571  }
572 
573  if (HIWORD(wParam) == STN_CLICKED)
574  {
575  INT i;
576  RECT rc;
577  for (i = 0; i < NUM_CARDBACKS; i++)
578  {
579  if (pCardBacks[i].hSelf == (HWND)lParam)
580  {
581  pCardBacks[i].bSelected = TRUE;
582  }
583  else
584  pCardBacks[i].bSelected = FALSE;
585 
586  GetClientRect(pCardBacks[i].hSelf, &rc);
587  InvalidateRect(pCardBacks[i].hSelf, &rc, TRUE);
588  }
589 
590  break;
591  }
592  }
593 
594  return FALSE;
595 }
HWND hSelf
Definition: solitaire.cpp:37
INT imgNum
Definition: solitaire.cpp:40
#define IDOK
Definition: winuser.h:824
#define TRUE
Definition: types.h:120
#define CARDBACK_RES_START
Definition: solitaire.h:19
int32_t INT
Definition: typedefs.h:58
#define SetWindowLongPtr
Definition: treelist.c:70
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define FALSE
Definition: types.h:117
#define GWLP_USERDATA
Definition: treelist.c:63
WNDPROC hOldProc
Definition: solitaire.cpp:38
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define STN_CLICKED
Definition: winuser.h:2076
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
const GLubyte * c
Definition: glext.h:8905
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:442
BOOL bSelected
Definition: solitaire.cpp:41
#define NUM_CARDBACKS
Definition: solitaire.h:18
#define WM_COMMAND
Definition: winuser.h:1722
#define GWLP_WNDPROC
Definition: treelist.c:66
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
ULONG_PTR SIZE_T
Definition: typedefs.h:80
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define CARDBACK_END
Definition: solitaire.h:17
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define NULL
Definition: types.h:112
#define c
Definition: ke_i.h:80
#define HIWORD(l)
Definition: typedefs.h:247
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:594
struct _CardBack * PCARDBACK
INT hdcNum
Definition: solitaire.cpp:39

Referenced by ShowDeckOptionsDlg().

◆ CardImageWndProc()

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

Definition at line 442 of file solitaire.cpp.

446 {
448  GWLP_USERDATA);
449  static WNDPROC hOldProc = NULL;
450 
451  if (!hOldProc && pCardBack)
452  hOldProc = pCardBack->hOldProc;
453 
454  switch (msg)
455  {
456  case WM_PAINT:
457  {
458  HDC hdc;
459  PAINTSTRUCT ps;
460  HPEN hPen, hOldPen;
461  HBRUSH hBrush, hOldBrush;
462  RECT rc;
463 
464  hdc = BeginPaint(hwnd, &ps);
465 
466  if (pCardBack->bSelected)
467  {
468  hPen = CreatePen(PS_SOLID, 2, RGB(0,0,0));
469  }
470  else
471  {
473  hPen = CreatePen(PS_SOLID, 2, Face);
474  }
475 
476  GetClientRect(hwnd, &rc);
477  hBrush = (HBRUSH)GetStockObject(NULL_BRUSH);
478  hOldPen = (HPEN)SelectObject(hdc, hPen);
479  hOldBrush = (HBRUSH)SelectObject(hdc, hBrush);
480 
481  Rectangle(hdc,
482  rc.left+1,
483  rc.top+1,
484  rc.right,
485  rc.bottom);
486 
487  StretchBlt(hdc,
488  2,
489  2,
493  pCardBack->hdcNum * __cardwidth,
494  0,
495  __cardwidth,
496  __cardheight,
497  SRCCOPY);
498 
499  SelectObject(hdc, hOldPen);
500  SelectObject(hdc, hOldBrush);
501 
502  EndPaint(hwnd, &ps);
503 
504  break;
505  }
506 
507  case WM_LBUTTONDOWN:
508  pCardBack->bSelected = pCardBack->bSelected ? FALSE : TRUE;
509  break;
510  }
511 
512  return CallWindowProc(hOldProc,
513  hwnd,
514  msg,
515  wParam,
516  lParam);
517 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define CallWindowProc
Definition: winuser.h:5710
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
#define RGB(r, g, b)
Definition: precomp.h:62
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
#define TRUE
Definition: types.h:120
#define NULL_BRUSH
Definition: wingdi.h:900
static HDC
Definition: imagelist.c:92
LONG top
Definition: windef.h:307
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
LONG left
Definition: windef.h:306
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
LONG right
Definition: windef.h:308
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:585
#define CARDBACK_OPTIONS_HEIGHT
Definition: solitaire.h:21
#define COLOR_3DFACE
Definition: winuser.h:919
#define FALSE
Definition: types.h:117
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define GWLP_USERDATA
Definition: treelist.c:63
WNDPROC hOldProc
Definition: solitaire.cpp:38
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL bSelected
Definition: solitaire.cpp:41
#define WM_PAINT
Definition: winuser.h:1602
HDC hdc
Definition: main.c:9
int __cardwidth
Definition: cardlib.cpp:25
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define NULL
Definition: types.h:112
#define msg(x)
Definition: auth_time.c:54
int __cardheight
Definition: cardlib.cpp:26
LONG bottom
Definition: windef.h:309
#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:332
struct _CardBack * PCARDBACK
INT hdcNum
Definition: solitaire.cpp:39

Referenced by CardBackDlgProc().

◆ GetScoreMode()

int GetScoreMode ( void  )

Definition at line 129 of file solitaire.cpp.

130 {
132  {
133  return SCORE_NONE;
134  }
135 
137  {
138  return SCORE_STD;
139  }
140 
142  {
143  return SCORE_VEGAS;
144  }
145 
146  return 0;
147 }
DWORD dwOptions
Definition: solitaire.cpp:24
#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

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

◆ LoadSettings()

VOID LoadSettings ( VOID  )

Definition at line 55 of file solitaire.cpp.

56 {
57  DWORD dwDisposition;
58  DWORD dwSize;
59  DWORD dwBack;
60  HKEY hKey;
61 
63  _T("Software\\ReactOS\\Solitaire"),
64  0,
65  NULL,
67  KEY_READ,
68  NULL,
69  &hKey,
70  &dwDisposition))
71  return;
72 
73  dwSize = sizeof(DWORD);
75  _T("Options"),
76  NULL,
77  NULL,
78  (LPBYTE)&dwOptions,
79  &dwSize);
80 
81  dwSize = sizeof(DWORD);
83  _T("Back"),
84  NULL,
85  NULL,
86  (LPBYTE)&dwBack,
87  &dwSize);
88  SolWnd.SetBackCardIdx(dwBack);
89 
91 }
#define RegQueryValueEx
Definition: winreg.h:524
DWORD dwOptions
Definition: solitaire.cpp:24
#define KEY_READ
Definition: nt_native.h:1023
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define DWORD
Definition: nt_native.h:44
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
#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
FxAutoRegKey hKey
#define NULL
Definition: types.h:112
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define RegCreateKeyEx
Definition: winreg.h:501
CardWindow SolWnd
Definition: solitaire.cpp:33

Referenced by _tWinMain().

◆ MakePath()

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

Definition at line 46 of file solitaire.cpp.

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

Referenced by _tWinMain().

◆ OptionsDlgProc()

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

Definition at line 288 of file solitaire.cpp.

289 {
290  HWND hCtrl;
291 
292  switch (uMsg)
293  {
294  case WM_INITDIALOG:
295  // For now, the Help dialog item is disabled because of lacking of HTML Help support
297 
300 
301  CheckDlgButton(hDlg,
304 
305  CheckDlgButton(hDlg,
308 
309  CheckDlgButton(hDlg,
312 
313  hCtrl = GetDlgItem(hDlg, IDC_OPT_KEEPSCORE);
314 
315  if (GetScoreMode() == SCORE_NONE)
316  {
318  EnableWindow(hCtrl, FALSE);
319  }
320  else if (GetScoreMode() == SCORE_STD)
321  {
323  EnableWindow(hCtrl, FALSE);
324  }
325  else if (GetScoreMode() == SCORE_VEGAS)
326  {
328  EnableWindow(hCtrl, TRUE);
329  }
330  return TRUE;
331 
332  case WM_COMMAND:
333  switch(LOWORD(wParam))
334  {
335  case IDC_OPT_NOSCORE:
336  case IDC_OPT_STANDARD:
337  case IDC_OPT_VEGAS:
338  hCtrl = GetDlgItem(hDlg, IDC_OPT_KEEPSCORE);
339  if (wParam == IDC_OPT_VEGAS)
340  EnableWindow(hCtrl, TRUE);
341  else
342  EnableWindow(hCtrl, FALSE);
343  return TRUE;
344 
345  case IDOK:
349 
352  else
354 
357  else
359 
362  else
364 
366  {
369  }
370  else if (IsDlgButtonChecked(hDlg, IDC_OPT_VEGAS) == BST_CHECKED)
371  {
374  }
376  {
379  }
380 
381  UpdateStatusBar();
382 
383  EndDialog(hDlg, TRUE);
384  return TRUE;
385 
386  case IDCANCEL:
387  EndDialog(hDlg, FALSE);
388  return TRUE;
389  }
390  break;
391  }
392  return FALSE;
393 }
DWORD dwOptions
Definition: solitaire.cpp:24
#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:22
#define IDOK
Definition: winuser.h:824
#define MF_BYCOMMAND
Definition: winuser.h:202
#define TRUE
Definition: types.h:120
#define IDC_OPT_STATUSBAR
Definition: resource.h:23
#define OPTION_SCORE_VEGAS
Definition: solitaire.h:15
#define IDC_OPT_NOSCORE
Definition: resource.h:26
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
int GetScoreMode(void)
Definition: solitaire.cpp:129
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define FALSE
Definition: types.h:117
#define SCORE_NONE
Definition: solitaire.h:44
#define IDC_OPT_DRAWONE
Definition: resource.h:20
#define IDC_OPT_DRAWTHREE
Definition: resource.h:21
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define IDM_HELP_CONTENTS
Definition: resource.h:15
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_OPT_KEEPSCORE
Definition: resource.h:27
#define OPTION_THREE_CARDS
Definition: solitaire.h:11
#define WM_COMMAND
Definition: winuser.h:1722
#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:24
#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:149
#define MF_GRAYED
Definition: winuser.h:129
#define IDC_OPT_VEGAS
Definition: resource.h:25
#define IDCANCEL
Definition: winuser.h:825
HMENU WINAPI GetMenu(_In_ HWND)
#define WM_INITDIALOG
Definition: winuser.h:1721
#define LOWORD(l)
Definition: pedump.c:82

Referenced by MainDlgProc(), and ShowGameOptionsDlg().

◆ SaveSettings()

VOID SaveSettings ( VOID  )

Definition at line 93 of file solitaire.cpp.

94 {
95  DWORD dwDisposition;
96  DWORD dwBack;
97  HKEY hKey;
98 
100  _T("Software\\ReactOS\\Solitaire"),
101  0,
102  NULL,
104  KEY_WRITE,
105  NULL,
106  &hKey,
107  &dwDisposition))
108  return;
109 
111  _T("Options"),
112  0,
113  REG_DWORD,
114  (CONST BYTE *)&dwOptions,
115  sizeof(DWORD));
116 
117  dwBack = SolWnd.GetBackCardIdx();
119  _T("Back"),
120  0,
121  REG_DWORD,
122  (CONST BYTE *)&dwBack,
123  sizeof(DWORD));
124 
125  RegCloseKey(hKey);
126 }
DWORD dwOptions
Definition: solitaire.cpp:24
UINT GetBackCardIdx()
Definition: cardwindow.cpp:738
#define HKEY_CURRENT_USER
Definition: winreg.h:11
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#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: xxhash.c:193
FxAutoRegKey hKey
#define NULL
Definition: types.h:112
#define REG_DWORD
Definition: sdbapi.c:596
#define CONST
Definition: pedump.c:81
#define RegSetValueEx
Definition: winreg.h:533
#define RegCreateKeyEx
Definition: winreg.h:501
CardWindow SolWnd
Definition: solitaire.cpp:33

Referenced by _tWinMain().

◆ SetPlayTimer()

void SetPlayTimer ( void  )

Definition at line 171 of file solitaire.cpp.

172 {
174  {
175  if (!PlayTimer)
176  {
178  }
179  }
180 }
DWORD dwOptions
Definition: solitaire.cpp:24
HWND hwndMain
Definition: solitaire.cpp:12
UINT_PTR PlayTimer
Definition: solitaire.cpp:31
#define IDT_PLAYTIMER
Definition: solitaire.h:33
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define NULL
Definition: types.h:112
#define OPTION_SHOW_TIME
Definition: solitaire.h:12

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

◆ SetUndoMenuState()

void SetUndoMenuState ( bool  enable)

Definition at line 182 of file solitaire.cpp.

183 {
184  if (enable)
185  {
187  }
188  else
189  {
191  }
192 }
#define MF_BYCOMMAND
Definition: winuser.h:202
HMENU hGameMenu
Definition: solitaire.cpp:15
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MF_ENABLED
Definition: winuser.h:128
GLboolean enable
Definition: glext.h:11120
#define MF_GRAYED
Definition: winuser.h:129
#define IDM_GAME_UNDO
Definition: resource.h:11

Referenced by ClearUndo(), and SetUndo().

◆ ShowDeckOptionsDlg()

VOID ShowDeckOptionsDlg ( HWND  hwnd)

Definition at line 598 of file solitaire.cpp.

599 {
600  INT cardBack;
601 
602  if ((cardBack = DialogBox(hInstance,
604  hwnd,
605  CardBackDlgProc)))
606  {
607  SolWnd.SetBackCardIdx(CARDBACK_RES_START + (cardBack - 1));
608  SolWnd.Redraw();
609  }
610 }
#define IDD_CARDBACK
Definition: resource.h:28
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define CARDBACK_RES_START
Definition: solitaire.h:19
int32_t INT
Definition: typedefs.h:58
void Redraw(void)
Definition: cardwindow.cpp:553
#define DialogBox
Definition: winuser.h:5736
INT_PTR CALLBACK CardBackDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:520
HINSTANCE hInstance
Definition: solitaire.cpp:14
void SetBackCardIdx(UINT uBackIdx)
Definition: cardwindow.cpp:728
CardWindow SolWnd
Definition: solitaire.cpp:33

Referenced by WndProc().

◆ ShowGameOptionsDlg()

VOID ShowGameOptionsDlg ( HWND  hwnd)

Definition at line 395 of file solitaire.cpp.

396 {
397  DWORD dwOldOptions = dwOptions;
398  RECT rcMain, rcStatus;
399 
400  int iOldScoreMode = GetScoreMode();
401 
403  {
404  if (((dwOldOptions & OPTION_THREE_CARDS) != (dwOptions & OPTION_THREE_CARDS)) ||
405  ((dwOldOptions & OPTION_SHOW_TIME) != (dwOptions & OPTION_SHOW_TIME)) ||
406  (iOldScoreMode != GetScoreMode()))
407  NewGame();
408 
409  if ((dwOldOptions & OPTION_SHOW_STATUS) != (dwOptions & OPTION_SHOW_STATUS))
410  {
411  int nWidth, nHeight, nStatusHeight;
412 
413  GetClientRect(hwndMain, &rcMain);
414  nHeight = rcMain.bottom - rcMain.top;
415  nWidth = rcMain.right - rcMain.left;
416 
418  {
419  RECT rc;
420 
422  GetWindowRect(hwndStatus, &rcStatus);
423  nStatusHeight = rcStatus.bottom - rcStatus.top;
424  MoveWindow(SolWnd, 0, 0, nWidth, nHeight-nStatusHeight, TRUE);
425  MoveWindow(hwndStatus, 0, nHeight-nStatusHeight, nWidth, nHeight, TRUE);
426 
427  // Force the window to process WM_GETMINMAXINFO again
428  GetWindowRect(hwndMain, &rc);
429  SetWindowPos(hwndMain, NULL, 0, 0, rc.right - rc.left, rc.bottom - rc.top, SWP_NOMOVE | SWP_NOZORDER);
430  }
431  else
432  {
434  MoveWindow(SolWnd, 0, 0, nWidth, nHeight, TRUE);
435  }
436  }
437  }
438 }
DWORD dwOptions
Definition: solitaire.cpp:24
#define OPTION_SHOW_STATUS
Definition: solitaire.h:10
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MAKEINTRESOURCE
Definition: winuser.h:591
HWND hwndMain
Definition: solitaire.cpp:12
#define TRUE
Definition: types.h:120
#define SW_HIDE
Definition: winuser.h:762
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define SWP_NOZORDER
Definition: winuser.h:1232
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LONG right
Definition: windef.h:308
#define IDD_OPTIONS
Definition: resource.h:19
void NewGame(void)
Definition: solgame.cpp:18
int GetScoreMode(void)
Definition: solitaire.cpp:129
#define DialogBox
Definition: winuser.h:5736
HWND hwndStatus
Definition: solitaire.cpp:13
HINSTANCE hInstance
Definition: solitaire.cpp:14
#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:288
#define NULL
Definition: types.h:112
#define OPTION_SHOW_TIME
Definition: solitaire.h:12
LONG bottom
Definition: windef.h:309
#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:33

Referenced by WndProc().

◆ UpdateStatusBar()

void UpdateStatusBar ( void  )

Definition at line 149 of file solitaire.cpp.

150 {
151  TCHAR szStatusText[128];
152  TCHAR szTempText[64];
153 
154  ZeroMemory(szStatusText, sizeof(szStatusText));
155 
156  if (GetScoreMode() != SCORE_NONE)
157  {
158  _stprintf(szStatusText, szScore, lScore);
159  _tcscat(szStatusText, _T(" "));
160  }
161 
163  {
164  _stprintf(szTempText, szTime, dwTime);
165  _tcscat(szStatusText, szTempText);
166  }
167 
169 }
DWORD dwOptions
Definition: solitaire.cpp:24
TCHAR szTime[64]
Definition: solitaire.cpp:19
long lScore
Definition: solitaire.cpp:30
#define ZeroMemory
Definition: winbase.h:1664
CHAR * LPTSTR
Definition: xmlstorage.h:192
int GetScoreMode(void)
Definition: solitaire.cpp:129
#define SCORE_NONE
Definition: solitaire.h:44
HWND hwndStatus
Definition: solitaire.cpp:13
LONG_PTR LPARAM
Definition: windef.h:208
DWORD dwTime
Definition: solitaire.cpp:26
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
#define SB_SETTEXT
Definition: commctrl.h:1949
#define _stprintf
Definition: utility.h:124
TCHAR szScore[64]
Definition: solitaire.cpp:18
#define SendMessage
Definition: winuser.h:5818
_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:1971

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

◆ WndProc()

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

Definition at line 613 of file solitaire.cpp.

614 {
615  static int nWidth, nHeight, nStatusHeight;
616 
617  switch(iMsg)
618  {
619  case WM_CREATE:
620  {
621  int parts[] = { 150, -1 };
622  RECT rcStatus;
623 
624  // For now, the Help dialog item is disabled because of lacking of HTML Help support
626 
628 
629  //SendMessage(hwndStatus, SB_SIMPLE, (WPARAM)TRUE, 0);
630 
633 
634  SolWnd.Create(hwnd, 0, WS_CHILD | WS_VISIBLE, 0, 0, 100, 100);
635 
636  CreateSol();
637 
638  // The status bar height is fixed and needed later in WM_SIZE and WM_GETMINMAXINFO
639  // Force the window to process WM_GETMINMAXINFO again
640  GetWindowRect(hwndStatus, &rcStatus);
641  nStatusHeight = rcStatus.bottom - rcStatus.top;
642 
643  // Hide status bar if options say so
644  if (!(dwOptions & OPTION_SHOW_STATUS))
645  {
647  }
648 
649  SetWindowPos(hwnd, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOZORDER);
650 
651  NewGame();
652 
654 
655  return 0;
656  }
657 
658  case WM_DESTROY:
659  PostQuitMessage(0);
660  return 0;
661 
662  case WM_TIMER:
663  if (!fGameStarted)
664  {
666  PlayTimer = 0;
667  }
668  else if (dwOptions & OPTION_SHOW_TIME)
669  {
670  if (((dwTime + 1) % 10 == 0) && (GetScoreMode() == SCORE_STD))
671  {
672  lScore = lScore >= 2 ? lScore - 2 : 0;
673  }
674 
675  dwTime++;
676  }
677 
678  UpdateStatusBar();
679  return 0;
680 
681  case WM_SIZE:
682  nWidth = LOWORD(lParam);
683  nHeight = HIWORD(lParam);
684 
686  {
687  MoveWindow(SolWnd, 0, 0, nWidth, nHeight - nStatusHeight, TRUE);
688  MoveWindow(hwndStatus, 0, nHeight - nStatusHeight, nWidth, nStatusHeight, TRUE);
689  }
690  else
691  {
692  MoveWindow(SolWnd, 0, 0, nWidth, nHeight, TRUE);
693  }
694  //parts[0] = nWidth - 256;
695  //SendMessage(hwndStatus, SB_SETPARTS, 2, (LPARAM)parts);
696  return 0;
697 
698  case WM_GETMINMAXINFO:
699  {
700  MINMAXINFO *mmi;
701 
702  mmi = (MINMAXINFO *)lParam;
706  Y_BORDER +
707  __cardheight +
709  6 * yRowStackCardOffset +
710  __cardheight +
711  Y_BORDER +
712  (dwOptions & OPTION_SHOW_STATUS ? nStatusHeight : 0);
713  return 0;
714  }
715 
716  case WM_COMMAND:
717  switch(LOWORD(wParam))
718  {
719  case IDM_GAME_NEW:
720  //simulate a button click on the new button..
721  NewGame();
722  return 0;
723 
724  case IDM_GAME_UNDO:
725  Undo();
726  return 0;
727 
728  case IDM_GAME_DECK:
730  return 0;
731 
732  case IDM_GAME_OPTIONS:
734  return 0;
735 
736  case IDM_HELP_CONTENTS:
737  WinHelp(hwnd, szHelpPath, HELP_CONTENTS, 0);//HELP_KEY, (DWORD)"How to play");
738  return 0;
739 
740  case IDM_HELP_ABOUT:
742  return 0;
743 
744  case IDM_GAME_EXIT:
745  PostMessage(hwnd, WM_CLOSE, 0, 0);
746  return 0;
747  }
748 
749  return 0;
750 
751  case WM_CLOSE:
752  if (fGameStarted == false)
753  {
755  return 0;
756  }
757  else
758  {
759  int ret;
760 
762  if (ret == IDYES)
763  {
766  }
767  }
768  return 0;
769  }
770 
771  return DefWindowProc (hwnd, iMsg, wParam, lParam);
772 }
POINT ptMinTrackSize
Definition: winuser.h:3605
DWORD dwOptions
Definition: solitaire.cpp:24
#define OPTION_SHOW_STATUS
Definition: solitaire.h:10
#define Y_BORDER
Definition: solitaire.h:53
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDM_GAME_OPTIONS
Definition: resource.h:13
#define HELP_CONTENTS
Definition: winuser.h:2380
#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:30
#define TRUE
Definition: types.h:120
#define SW_HIDE
Definition: winuser.h:762
static const D3D_BLOB_PART parts[]
Definition: blob.c:76
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:2389
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
LONG top
Definition: windef.h:307
#define IDM_GAME_DECK
Definition: resource.h:12
int yRowStackCardOffset
Definition: solcreate.cpp:10
#define IDM_HELP_ABOUT
Definition: resource.h:385
TCHAR MsgAbout[128]
Definition: solitaire.cpp:21
#define WS_CHILD
Definition: pedump.c:617
UINT_PTR PlayTimer
Definition: solitaire.cpp:31
#define SWP_NOZORDER
Definition: winuser.h:1232
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
void CreateSol()
Definition: solcreate.cpp:12
#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:18
int GetScoreMode(void)
Definition: solitaire.cpp:129
#define IDT_PLAYTIMER
Definition: solitaire.h:33
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MB_YESNO
Definition: winuser.h:811
#define CreateStatusWindow
Definition: commctrl.h:1933
HWND hwndStatus
Definition: solitaire.cpp:13
TCHAR szHelpPath[MAX_PATH]
Definition: solitaire.cpp:9
#define X_ROWSTACK_BORDER
Definition: solitaire.h:51
#define MB_ICONQUESTION
Definition: winuser.h:783
LONG_PTR LPARAM
Definition: windef.h:208
#define DefWindowProc
Definition: ros2win.h:31
#define WM_DESTROY
Definition: winuser.h:1591
#define PostMessage
Definition: winuser.h:5807
DWORD dwTime
Definition: solitaire.cpp:26
#define CCS_BOTTOM
Definition: commctrl.h:2244
#define NUM_ROW_STACKS
Definition: solitaire.h:38
#define _T(x)
Definition: vfdio.h:22
VOID ShowDeckOptionsDlg(HWND hwnd)
Definition: solitaire.cpp:598
#define IDM_HELP_CONTENTS
Definition: resource.h:15
#define SM_CYCAPTION
Definition: winuser.h:953
#define SBARS_SIZEGRIP
Definition: commctrl.h:1923
#define WM_SIZE
Definition: winuser.h:1593
#define WM_TIMER
Definition: winuser.h:1724
#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:1949
#define MessageBox
Definition: winuser.h:5797
#define WM_COMMAND
Definition: winuser.h:1722
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:395
TCHAR szAppName[128]
Definition: solitaire.cpp:17
#define IDM_GAME_EXIT
Definition: resource.h:14
#define IDM_GAME_NEW
Definition: resource.h:10
bool fGameStarted
Definition: solgame.cpp:15
void Undo(void)
Definition: solundo.cpp:53
#define NULL
Definition: types.h:112
#define MB_OK
Definition: winuser.h:784
#define SB_SETPARTS
Definition: commctrl.h:1954
#define SendMessage
Definition: winuser.h:5818
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:247
LONG bottom
Definition: windef.h:309
#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:149
#define MF_GRAYED
Definition: winuser.h:129
#define IDM_GAME_UNDO
Definition: resource.h:11
#define WS_VISIBLE
Definition: pedump.c:620
HMENU WINAPI GetMenu(_In_ HWND)
TCHAR MsgQuit[128]
Definition: solitaire.cpp:20
LPARAM lParam
Definition: combotst.c:139
#define WM_GETMINMAXINFO
Definition: winuser.h:1622
#define SBT_NOBORDERS
Definition: commctrl.h:1971
#define LOWORD(l)
Definition: pedump.c:82
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
CardWindow SolWnd
Definition: solitaire.cpp:33
#define WinHelp
Definition: winuser.h:5839

Referenced by _tWinMain(), CreateCallProc(), DispatchMessageA(), DispatchMessageW(), IntCallMessageProc(), IntCallWindowProcA(), IntCallWindowProcW(), IntCreateClass(), IntSetClassWndProc(), UserSearchForCallProc(), ShellBrowserChildT< MainFrameBase >::WndProc(), IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >::WndProc(), ResizeController< Dialog >::WndProc(), CtlColorParent< OwnerDrawParent< Dialog > >::WndProc(), OwnerDrawParent< Dialog >::WndProc(), TrayIconControllerTemplate< BASE >::WndProc(), and ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >::WndProc().

Variable Documentation

◆ dwAppStartTime

DWORD dwAppStartTime

Definition at line 11 of file solitaire.cpp.

Referenced by WndProc().

◆ dwOptions

Definition at line 24 of file solitaire.cpp.

Referenced by AboutProtocol_Abort(), AboutProtocol_LockRequest(), AboutProtocol_Terminate(), BindProtocol_Abort(), BindProtocol_LockRequest(), BindProtocol_Terminate(), ATL::CRegKey::Create(), CreateHKCRKey(), CreateNestedKey(), DeckClickProc(), DuplicateConsoleHandle(), DuplicateHandle(), FileProtocol_Abort(), FileProtocol_LockRequest(), FileProtocol_Terminate(), FilterConnectCommunicationPort(), FixIfOneCardLeft(), FtpProtocol_Abort(), FtpProtocol_LockRequest(), FtpProtocol_Terminate(), GetScoreMode(), GopherProtocol_Abort(), GopherProtocol_LockRequest(), GopherProtocol_Terminate(), GUIDisplayStatusMessage(), HitTestThemeBackground(), HttpProtocol_Abort(), HttpProtocol_LockRequest(), HttpProtocol_Terminate(), ITSProtocol_Abort(), ITSProtocol_LockRequest(), ITSProtocol_Terminate(), IUnknown_AddOptions(), LoadSettings(), MimeFilterProtocol_Abort(), MimeFilterProtocol_LockRequest(), MimeFilterProtocol_Terminate(), MimeHtmlProtocol_Abort(), MimeHtmlProtocol_LockRequest(), MimeHtmlProtocol_Terminate(), MimeProtocol_LockRequest(), MimeProtocol_Terminate(), MkProtocol_Abort(), MkProtocol_LockRequest(), MkProtocol_Terminate(), MsiAdvertiseProductExA(), MsiAdvertiseProductExW(), MsiGetFileHashA(), MsiGetFileHashW(), MsiOpenPackageExA(), MsiOpenPackageExW(), MsiSourceListAddMediaDiskA(), MsiSourceListAddMediaDiskW(), MsiSourceListAddSourceExA(), MsiSourceListAddSourceExW(), MsiSourceListClearAllExA(), MsiSourceListClearAllExW(), MsiSourceListClearSourceA(), MsiSourceListClearSourceW(), MsiSourceListEnumMediaDisksA(), MsiSourceListEnumMediaDisksW(), MsiSourceListEnumSourcesA(), MsiSourceListEnumSourcesW(), MsiSourceListGetInfoA(), MsiSourceListGetInfoW(), MsiSourceListSetInfoA(), MsiSourceListSetInfoW(), NewGame(), OpenSourceKey(), OptionsDlgProc(), PileRemoveProc(), Protocol_Abort(), Protocol_Terminate(), ProtocolEmul_LockRequest(), ProtocolEmul_Terminate(), ProtocolHandler_Abort(), ProtocolHandler_LockRequest(), ProtocolHandler_Terminate(), RefreshPolicyEx(), RegCreateKeyExA(), RegCreateKeyExW(), RegOpenUserClassesRoot(), ResProtocol_Abort(), ResProtocol_LockRequest(), ResProtocol_Terminate(), SaveSettings(), SetPlayTimer(), SHMapHandle(), ShowGameOptionsDlg(), SuitStackAddProc(), test_CopyBindInfo(), test_pack_INTERNET_AUTH_NOTIFY_DATA(), test_pack_RemBINDINFO(), TUIDisplayStatusMessage(), UpdateStatusBar(), WlxDisplayStatusMessage(), and WndProc().

◆ dwPrevMode

DWORD dwPrevMode

Definition at line 29 of file solitaire.cpp.

Referenced by _tWinMain(), and NewGame().

◆ dwTime

◆ dwWasteCount

DWORD dwWasteCount

Definition at line 27 of file solitaire.cpp.

Referenced by DeckClickProc(), and NewGame().

◆ dwWasteTreshold

DWORD dwWasteTreshold

Definition at line 28 of file solitaire.cpp.

Referenced by DeckClickProc(), and NewGame().

◆ hGameMenu

HMENU hGameMenu

Definition at line 15 of file solitaire.cpp.

Referenced by _tWinMain(), and SetUndoMenuState().

◆ hInstance

HINSTANCE hInstance

Definition at line 14 of file solitaire.cpp.

Referenced by _tWinMain(), ShowDeckOptionsDlg(), and ShowGameOptionsDlg().

◆ hwndMain

◆ hwndStatus

◆ lScore

◆ MsgAbout

TCHAR MsgAbout[128]

Definition at line 21 of file solitaire.cpp.

Referenced by _tWinMain(), and WndProc().

◆ MsgDeal

TCHAR MsgDeal[128]

Definition at line 23 of file solitaire.cpp.

Referenced by _tWinMain().

◆ MsgQuit

TCHAR MsgQuit[128]

Definition at line 20 of file solitaire.cpp.

Referenced by _tWinMain(), and WndProc().

◆ MsgWin

TCHAR MsgWin[128]

Definition at line 22 of file solitaire.cpp.

Referenced by _tWinMain().

◆ PlayTimer

UINT_PTR PlayTimer = 0

Definition at line 31 of file solitaire.cpp.

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

◆ SolWnd

◆ 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 18 of file solitaire.cpp.

Referenced by _tWinMain(), and UpdateStatusBar().

◆ szTime