ReactOS  0.4.12-dev-712-ge6be187
solitaire.cpp
Go to the documentation of this file.
1 #include "solitaire.h"
2 
3 #include <winreg.h>
4 #include <commctrl.h>
5 #include <tchar.h>
6 
7 #include "resource.h"
8 
10 
15 
24 
29 long lScore;
31 
33 
34 typedef struct _CardBack
35 {
42 
44 
45 void MakePath(TCHAR *szDest, UINT nDestLen, const TCHAR *szExt)
46 {
47  TCHAR *ptr;
48 
49  ptr = szDest + GetModuleFileName(GetModuleHandle(0), szDest, nDestLen) - 1;
50  while(*ptr-- != '.');
51  lstrcpy(ptr + 1, szExt);
52 }
53 
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 }
91 
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 }
126 
127 // Returns 0 for no points, 1 for Standard and 2 for Vegas
128 int GetScoreMode(void)
129 {
131  {
132  return SCORE_NONE;
133  }
134 
136  {
137  return SCORE_STD;
138  }
139 
141  {
142  return SCORE_VEGAS;
143  }
144 
145  return 0;
146 }
147 
148 void UpdateStatusBar(void)
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 }
169 
170 void SetPlayTimer(void)
171 {
173  {
174  if (!PlayTimer)
175  {
177  }
178  }
179 }
180 
181 //
182 // Main entry point
183 //
184 int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int iCmdShow)
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;
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);
255 
257 
258  while(GetMessage(&msg, NULL,0,0))
259  {
260  if(!TranslateAccelerator(hwnd, hAccelTable, &msg))
261  {
264  }
265  }
266 
267  SaveSettings();
268 
269  return msg.wParam;
270 }
271 
272 
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 }
379 
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 
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 }
424 
425 
428  UINT msg,
429  WPARAM wParam,
430  LPARAM lParam)
431 {
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 }
503 
504 
506  UINT uMsg,
507  WPARAM wParam,
508  LPARAM lParam)
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 }
581 
582 
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 }
596 
597 //-----------------------------------------------------------------------------
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:
711  return 0;
712 
713  case IDM_GAME_OPTIONS:
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  {
736  return 0;
737  }
738  else
739  {
740  int ret;
741 
743  if (ret == IDYES)
744  {
747  }
748  }
749  return 0;
750  }
751 
752  return DefWindowProc (hwnd, iMsg, wParam, lParam);
753 }
754 
755 
756 
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define RegQueryValueEx
Definition: winreg.h:524
POINT ptMinTrackSize
Definition: winuser.h:3572
#define CallWindowProc
Definition: winuser.h:5601
DWORD dwOptions
Definition: solitaire.cpp:23
#define OPTION_SHOW_STATUS
Definition: solitaire.h:10
#define IDS_SOL_ABOUT
Definition: resource.h:43
#define HDC
Definition: msvc.h:22
HWND hSelf
Definition: solitaire.cpp:36
UINT GetBackCardIdx()
Definition: cardwindow.cpp:738
#define IDD_CARDBACK
Definition: resource.h:27
#define TranslateAccelerator
Definition: winuser.h:5726
#define Y_BORDER
Definition: solitaire.h:53
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDM_GAME_OPTIONS
Definition: resource.h:12
#define MAKEINTRESOURCE
Definition: winuser.h:591
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 DispatchMessage
Definition: winuser.h:5631
BOOL WINAPI TranslateMessage(_In_ const MSG *)
INT imgNum
Definition: solitaire.cpp:39
#define TRUE
Definition: types.h:120
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
#define IDOK
Definition: winuser.h:824
#define HELP_CONTENTS
Definition: winuser.h:2359
#define MF_BYCOMMAND
Definition: winuser.h:202
#define IDS_SOL_QUIT
Definition: resource.h:44
#define IDR_ACCELERATOR1
Definition: resource.h:7
long y
Definition: polytest.cpp:48
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
#define CreateWindow
Definition: winuser.h:5620
#define IDYES
Definition: winuser.h:829
TCHAR szTime[64]
Definition: solitaire.cpp:18
long x
Definition: polytest.cpp:48
HWND hwndMain
Definition: solitaire.cpp:12
TCHAR MsgWin[128]
Definition: solitaire.cpp:21
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
#define X_BORDER
Definition: solitaire.h:49
long lScore
Definition: solitaire.cpp:29
#define KEY_READ
Definition: nt_native.h:1023
#define SW_HIDE
Definition: winuser.h:762
#define IDC_OPT_STATUSBAR
Definition: resource.h:22
#define DWORD
Definition: msvc.h:34
BOOL Create(HWND hwndParent, DWORD dwExStyle, DWORD dwStyle, int x, int y, int width, int height)
Definition: cardwindow.cpp:109
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define NULL_BRUSH
Definition: wingdi.h:900
#define HELP_QUIT
Definition: winuser.h:2368
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define IDR_MENU1
Definition: resource.h:6
#define CALLBACK
Definition: compat.h:27
BOOL WINAPI UpdateWindow(_In_ HWND)
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
void __cdecl srand(_In_ unsigned int _Seed)
LONG top
Definition: windef.h:292
#define IDM_GAME_DECK
Definition: resource.h:11
#define OPTION_SCORE_VEGAS
Definition: solitaire.h:15
#define IDC_OPT_NOSCORE
Definition: resource.h:25
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
int cbClsExtra
Definition: winuser.h:3118
#define ZeroMemory
Definition: winbase.h:1635
int yRowStackCardOffset
Definition: solcreate.cpp:12
LPCSTR lpszMenuName
Definition: winuser.h:3124
VOID SaveSettings(VOID)
Definition: solitaire.cpp:92
#define IDM_HELP_ABOUT
Definition: resource.h:375
TCHAR MsgAbout[128]
Definition: solitaire.cpp:20
HBRUSH hbrBackground
Definition: winuser.h:3123
#define WS_CHILD
Definition: pedump.c:617
#define CARDBACK_RES_START
Definition: solitaire.h:19
UINT_PTR PlayTimer
Definition: solitaire.cpp:30
LONG left
Definition: windef.h:291
#define SWP_NOZORDER
Definition: winuser.h:1232
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
void CreateSol()
Definition: solcreate.cpp:14
int32_t INT_PTR
Definition: typedefs.h:62
#define Y_ROWSTACK_BORDER
Definition: solitaire.h:55
LONG right
Definition: windef.h:293
BOOL WINAPI DestroyWindow(_In_ HWND)
#define IDD_OPTIONS
Definition: resource.h:18
int32_t INT
Definition: typedefs.h:56
#define SetWindowLongPtr
Definition: treelist.c:70
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)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
HDC __hdcCardBitmaps
Definition: cardlib.cpp:18
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define IDS_SOL_DEAL
Definition: resource.h:46
UINT_PTR WPARAM
Definition: windef.h:207
void NewGame(void)
Definition: solgame.cpp:17
void Redraw(void)
Definition: cardwindow.cpp:553
int GetScoreMode(void)
Definition: solitaire.cpp:128
#define DialogBox
Definition: winuser.h:5627
#define PS_SOLID
Definition: wingdi.h:585
int cbWndExtra
Definition: winuser.h:3119
#define LoadAccelerators
Definition: winuser.h:5676
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
#define IDT_PLAYTIMER
Definition: solitaire.h:33
#define CARDBACK_OPTIONS_HEIGHT
Definition: solitaire.h:21
#define COLOR_3DFACE
Definition: winuser.h:919
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
#define MB_YESNO
Definition: winuser.h:811
#define SCORE_NONE
Definition: solitaire.h:44
#define IDC_OPT_DRAWONE
Definition: resource.h:19
LONG_PTR LPARAM
Definition: windef.h:208
#define CreateStatusWindow
Definition: commctrl.h:1905
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
INT_PTR CALLBACK CardBackDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:505
HWND hwndStatus
Definition: solitaire.cpp:13
static PVOID ptr
Definition: dispmode.c:27
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
#define GWLP_USERDATA
Definition: treelist.c:63
HDC hdc
Definition: msvc.h:53
#define X_ROWSTACK_BORDER
Definition: solitaire.h:51
UINT msg
Definition: msvc.h:92
smooth NULL
Definition: ftsmooth.c:416
#define MB_ICONQUESTION
Definition: winuser.h:783
#define IDS_SOL_NAME
Definition: resource.h:42
#define IDS_SOL_WIN
Definition: resource.h:45
#define IDC_OPT_DRAWTHREE
Definition: resource.h:20
int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int iCmdShow)
Definition: solitaire.cpp:184
WNDPROC hOldProc
Definition: solitaire.cpp:37
#define SW_SHOW
Definition: winuser.h:769
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define IDI_SOLITAIRE
Definition: resource.h:4
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#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:2216
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
char TCHAR
Definition: xmlstorage.h:189
#define NUM_ROW_STACKS
Definition: solitaire.h:38
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
#define _T(x)
Definition: vfdio.h:22
VOID ShowDeckOptionsDlg(HWND hwnd)
Definition: solitaire.cpp:583
#define IDM_HELP_CONTENTS
Definition: resource.h:14
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
#define SM_CYCAPTION
Definition: winuser.h:953
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define STN_CLICKED
Definition: winuser.h:2055
#define IDS_SOL_SCORE
Definition: resource.h:47
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define SBARS_SIZEGRIP
Definition: commctrl.h:1895
#define WM_SIZE
Definition: winuser.h:1593
void SetPlayTimer(void)
Definition: solitaire.cpp:170
DWORD dwPrevMode
Definition: solitaire.cpp:28
#define WM_TIMER
Definition: winuser.h:1718
#define WM_CLOSE
Definition: winuser.h:1603
#define RGB(r, g, b)
Definition: wingdi.h:2918
#define MAX_PATH
Definition: compat.h:26
const GLubyte * c
Definition: glext.h:8905
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
struct _CardBack CARDBACK
int WINAPI GetSystemMetrics(_In_ int)
#define CARDBACK_START
Definition: solitaire.h:16
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint num
Definition: glext.h:9618
LRESULT CALLBACK CardImageWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:427
#define IDC_OPT_KEEPSCORE
Definition: resource.h:26
#define GetModuleFileName
Definition: winbase.h:3645
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define OPTION_THREE_CARDS
Definition: solitaire.h:11
BOOL bSelected
Definition: solitaire.cpp:40
#define WM_PAINT
Definition: winuser.h:1602
#define MB_ICONINFORMATION
Definition: winuser.h:796
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
int ret
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
#define SB_SETTEXT
Definition: commctrl.h:1921
#define IDS_SOL_TIME
Definition: resource.h:48
unsigned char BYTE
Definition: mem.h:68
#define MessageBox
Definition: winuser.h:5688
#define NUM_CARDBACKS
Definition: solitaire.h:18
#define WM_COMMAND
Definition: winuser.h:1716
LPCSTR lpszClassName
Definition: winuser.h:3125
#define BST_UNCHECKED
Definition: winuser.h:199
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define WINAPI
Definition: msvc.h:20
#define LoadCursor
Definition: winuser.h:5678
int __cardwidth
Definition: cardlib.cpp:25
#define GWLP_WNDPROC
Definition: treelist.c:66
VOID ShowGameOptionsDlg(HWND hwnd)
Definition: solitaire.cpp:380
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
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
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2859
void SetBackCardIdx(UINT uBackIdx)
Definition: cardwindow.cpp:728
#define _stprintf
Definition: utility.h:124
#define IDM_GAME_EXIT
Definition: resource.h:13
ULONG_PTR SIZE_T
Definition: typedefs.h:78
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define CARDBACK_END
Definition: solitaire.h:17
#define IDM_GAME_NEW
Definition: resource.h:10
HINSTANCE hInst
Definition: dxdiag.c:13
#define GetModuleHandle
Definition: winbase.h:3641
bool fGameStarted
Definition: solgame.cpp:14
HINSTANCE hInstance
Definition: winuser.h:3120
#define lstrcpy
Definition: winbase.h:3688
INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:273
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define MB_OK
Definition: winuser.h:784
TCHAR szScore[64]
Definition: solitaire.cpp:17
#define GetMessage
Definition: winuser.h:5656
#define SB_SETPARTS
Definition: commctrl.h:1926
#define BST_CHECKED
Definition: winuser.h:197
#define IDC_OPT_STANDARD
Definition: resource.h:23
WNDPROC lpfnWndProc
Definition: winuser.h:3117
#define msg(x)
Definition: auth_time.c:54
#define IDC_ARROW
Definition: winuser.h:682
DWORD dwWasteCount
Definition: solitaire.cpp:26
#define OPTION_SCORE_STD
Definition: solitaire.h:14
#define SendMessage
Definition: winuser.h:5709
_TCHAR * _tcscat(_TCHAR *s, const _TCHAR *append)
Definition: tcscat.h:8
int __cardheight
Definition: cardlib.cpp:26
#define WM_CREATE
Definition: winuser.h:1590
DWORD dwAppStartTime
Definition: solitaire.cpp:11
TCHAR MsgDeal[128]
Definition: solitaire.cpp:22
#define SCORE_STD
Definition: solitaire.h:45
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define OPTION_SHOW_TIME
Definition: solitaire.h:12
#define c
Definition: ke_i.h:80
#define HIWORD(l)
Definition: typedefs.h:246
LONG bottom
Definition: windef.h:294
#define SCORE_VEGAS
Definition: solitaire.h:46
#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)
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define RegisterClass
Definition: winuser.h:5702
void UpdateStatusBar(void)
Definition: solitaire.cpp:148
#define LoadIcon
Definition: winuser.h:5679
#define GetWindowLongPtr
Definition: treelist.c:73
#define MF_GRAYED
Definition: winuser.h:129
#define IDC_OPT_VEGAS
Definition: resource.h:24
#define IDCANCEL
Definition: winuser.h:825
LONG_PTR LRESULT
Definition: windef.h:209
#define CARDBACK_OPTIONS_WIDTH
Definition: solitaire.h:20
#define WS_VISIBLE
Definition: pedump.c:620
#define REG_DWORD
Definition: sdbapi.c:539
HMENU WINAPI GetMenu(_In_ HWND)
TCHAR MsgQuit[128]
Definition: solitaire.cpp:19
DWORD dwWasteTreshold
Definition: solitaire.cpp:27
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define WM_GETMINMAXINFO
Definition: winuser.h:1622
#define SBT_NOBORDERS
Definition: commctrl.h:1943
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define CONST
Definition: pedump.c:81
VOID LoadSettings(VOID)
Definition: solitaire.cpp:54
#define SRCCOPY
Definition: wingdi.h:332
#define RegSetValueEx
Definition: winreg.h:533
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define LoadString
Definition: winuser.h:5685
#define RegCreateKeyEx
Definition: winreg.h:501
HICON hIcon
Definition: winuser.h:3121
CardWindow SolWnd
Definition: solitaire.cpp:32
struct _CardBack * PCARDBACK
INT hdcNum
Definition: solitaire.cpp:38
void MakePath(TCHAR *szDest, UINT nDestLen, const TCHAR *szExt)
Definition: solitaire.cpp:45
#define WinHelp
Definition: winuser.h:5730