ReactOS 0.4.15-dev-5875-g7c755d9
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
16
25
30long lScore;
32
34
35typedef struct _CardBack
36{
43
45
46void MakePath(TCHAR *szDest, UINT nDestLen, const TCHAR *szExt)
47{
48 TCHAR *ptr;
49
50 ptr = szDest + GetModuleFileName(GetModuleHandle(0), szDest, nDestLen) - 1;
51 while(*ptr-- != '.');
52 lstrcpy(ptr + 1, szExt);
53}
54
56{
57 DWORD dwDisposition;
59 DWORD dwBack;
60 HKEY hKey;
61
63 _T("Software\\ReactOS\\Solitaire"),
64 0,
65 NULL,
68 NULL,
69 &hKey,
70 &dwDisposition))
71 return;
72
73 dwSize = sizeof(DWORD);
75 _T("Options"),
76 NULL,
77 NULL,
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}
92
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
126}
127
128// Returns 0 for no points, 1 for Standard and 2 for Vegas
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}
148
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}
170
171void SetPlayTimer(void)
172{
174 {
175 if (!PlayTimer)
176 {
178 }
179 }
180}
181
183{
184 if (enable)
185 {
187 }
188 else
189 {
191 }
192}
193
194//
195// Main entry point
196//
197int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int iCmdShow)
198{
199 HWND hwnd;
200 MSG msg;
201 WNDCLASS wndclass;
203 HACCEL hAccelTable;
204
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);
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
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}
286
287
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:
346 dwOptions &= ~OPTION_THREE_CARDS;
349
352 else
353 dwOptions &= ~OPTION_SHOW_STATUS;
354
357 else
358 dwOptions &= ~OPTION_SHOW_TIME;
359
362 else
363 dwOptions &= ~OPTION_KEEP_SCORE;
364
366 {
368 dwOptions &= ~OPTION_SCORE_VEGAS;
369 }
371 {
373 dwOptions &= ~OPTION_SCORE_STD;
374 }
376 {
379 }
380
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}
394
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
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}
439
440
443 UINT msg,
446{
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
482 rc.left+1,
483 rc.top+1,
484 rc.right,
485 rc.bottom);
486
488 2,
489 2,
493 pCardBack->hdcNum * __cardwidth,
494 0,
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}
518
519
521 UINT uMsg,
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,
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}
596
597
599{
600 INT cardBack;
601
602 if ((cardBack = DialogBox(hInstance,
604 hwnd,
606 {
607 SolWnd.SetBackCardIdx(CARDBACK_RES_START + (cardBack - 1));
608 SolWnd.Redraw();
609 }
610}
611
612//-----------------------------------------------------------------------------
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
645 {
647 }
648
650
651 NewGame();
652
654
655 return 0;
656 }
657
658 case WM_DESTROY:
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
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 +
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
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}
773
774
#define msg(x)
Definition: auth_time.c:54
#define IDM_HELP_ABOUT
Definition: resource.h:385
void SaveSettings(void)
Definition: settings.c:115
void LoadSettings(void)
Definition: settings.c:53
#define IDR_MENU1
Definition: resource.h:6
#define IDC_OPT_VEGAS
Definition: resource.h:25
#define IDD_CARDBACK
Definition: resource.h:28
#define IDC_OPT_STATUSBAR
Definition: resource.h:23
#define IDM_HELP_CONTENTS
Definition: resource.h:15
#define IDD_OPTIONS
Definition: resource.h:19
#define IDS_SOL_TIME
Definition: resource.h:49
#define IDC_OPT_STANDARD
Definition: resource.h:24
#define IDM_GAME_NEW
Definition: resource.h:10
#define IDS_SOL_DEAL
Definition: resource.h:47
#define IDC_OPT_DRAWONE
Definition: resource.h:20
#define IDC_OPT_DRAWTHREE
Definition: resource.h:21
#define IDM_GAME_DECK
Definition: resource.h:12
#define IDC_OPT_SHOWTIME
Definition: resource.h:22
#define IDM_GAME_EXIT
Definition: resource.h:14
#define IDM_GAME_OPTIONS
Definition: resource.h:13
#define IDS_SOL_SCORE
Definition: resource.h:48
#define IDC_OPT_KEEPSCORE
Definition: resource.h:27
#define IDC_OPT_NOSCORE
Definition: resource.h:26
#define IDS_SOL_ABOUT
Definition: resource.h:44
#define IDS_SOL_WIN
Definition: resource.h:46
#define IDS_SOL_QUIT
Definition: resource.h:45
#define IDS_SOL_NAME
Definition: resource.h:43
#define IDR_ACCELERATOR1
Definition: resource.h:7
#define IDI_SOLITAIRE
Definition: resource.h:4
#define IDM_GAME_UNDO
Definition: resource.h:11
#define RegCloseKey(hKey)
Definition: registry.h:47
int __cardwidth
Definition: cardlib.cpp:25
int __cardheight
Definition: cardlib.cpp:26
HDC __hdcCardBitmaps
Definition: cardlib.cpp:18
BOOL Create(HWND hwndParent, DWORD dwExStyle, DWORD dwStyle, int x, int y, int width, int height)
Definition: cardwindow.cpp:109
UINT GetBackCardIdx()
Definition: cardwindow.cpp:738
void SetBackCardIdx(UINT uBackIdx)
Definition: cardwindow.cpp:728
void Redraw(void)
Definition: cardwindow.cpp:553
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
#define RGB(r, g, b)
Definition: precomp.h:62
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
GLsizeiptr size
Definition: glext.h:5919
const GLubyte * c
Definition: glext.h:8905
GLboolean enable
Definition: glext.h:11120
GLuint GLuint num
Definition: glext.h:9618
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
void __cdecl srand(_In_ unsigned int _Seed)
#define _tcscat
Definition: tchar.h:622
#define _tWinMain
Definition: tchar.h:498
#define c
Definition: ke_i.h:80
#define _stprintf
Definition: utility.h:124
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
static PVOID ptr
Definition: dispmode.c:27
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
static const D3D_BLOB_PART parts[]
Definition: blob.c:76
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
#define KEY_READ
Definition: nt_native.h:1023
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
#define DWORD
Definition: nt_native.h:44
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define CONST
Definition: pedump.c:81
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_VISIBLE
Definition: pedump.c:620
#define CreateStatusWindow
Definition: commctrl.h:1933
#define SBT_NOBORDERS
Definition: commctrl.h:1971
#define CCS_BOTTOM
Definition: commctrl.h:2244
#define SB_SETTEXT
Definition: commctrl.h:1949
#define SB_SETPARTS
Definition: commctrl.h:1954
#define SBARS_SIZEGRIP
Definition: commctrl.h:1923
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
#define DefWindowProc
Definition: ros2win.h:31
#define REG_DWORD
Definition: sdbapi.c:596
int yRowStackCardOffset
Definition: solcreate.cpp:10
void CreateSol()
Definition: solcreate.cpp:12
void NewGame(void)
Definition: solgame.cpp:18
bool fGameStarted
Definition: solgame.cpp:15
TCHAR szAppName[128]
Definition: solitaire.cpp:17
HMENU hGameMenu
Definition: solitaire.cpp:15
DWORD dwWasteCount
Definition: solitaire.cpp:27
TCHAR szHelpPath[MAX_PATH]
Definition: solitaire.cpp:9
TCHAR MsgDeal[128]
Definition: solitaire.cpp:23
TCHAR MsgAbout[128]
Definition: solitaire.cpp:21
TCHAR MsgWin[128]
Definition: solitaire.cpp:22
VOID ShowDeckOptionsDlg(HWND hwnd)
Definition: solitaire.cpp:598
DWORD dwWasteTreshold
Definition: solitaire.cpp:28
void SetPlayTimer(void)
Definition: solitaire.cpp:171
HWND hwndStatus
Definition: solitaire.cpp:13
INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:288
struct _CardBack CARDBACK
void MakePath(TCHAR *szDest, UINT nDestLen, const TCHAR *szExt)
Definition: solitaire.cpp:46
HINSTANCE hInstance
Definition: solitaire.cpp:14
HWND hwndMain
Definition: solitaire.cpp:12
DWORD dwOptions
Definition: solitaire.cpp:24
void UpdateStatusBar(void)
Definition: solitaire.cpp:149
TCHAR szScore[64]
Definition: solitaire.cpp:18
LRESULT CALLBACK CardImageWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:442
VOID ShowGameOptionsDlg(HWND hwnd)
Definition: solitaire.cpp:395
DWORD dwTime
Definition: solitaire.cpp:26
DWORD dwAppStartTime
Definition: solitaire.cpp:11
void SetUndoMenuState(bool enable)
Definition: solitaire.cpp:182
TCHAR szTime[64]
Definition: solitaire.cpp:19
DWORD dwPrevMode
Definition: solitaire.cpp:29
struct _CardBack * PCARDBACK
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:613
int GetScoreMode(void)
Definition: solitaire.cpp:129
INT_PTR CALLBACK CardBackDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:520
CardWindow SolWnd
Definition: solitaire.cpp:33
long lScore
Definition: solitaire.cpp:30
TCHAR MsgQuit[128]
Definition: solitaire.cpp:20
UINT_PTR PlayTimer
Definition: solitaire.cpp:31
#define CARDBACK_OPTIONS_HEIGHT
Definition: solitaire.h:21
#define IDT_PLAYTIMER
Definition: solitaire.h:33
#define OPTION_SHOW_STATUS
Definition: solitaire.h:10
#define CARDBACK_END
Definition: solitaire.h:17
#define NUM_CARDBACKS
Definition: solitaire.h:18
#define OPTION_THREE_CARDS
Definition: solitaire.h:11
#define CARDBACK_OPTIONS_WIDTH
Definition: solitaire.h:20
#define Y_BORDER
Definition: solitaire.h:53
#define OPTION_KEEP_SCORE
Definition: solitaire.h:13
#define SCORE_NONE
Definition: solitaire.h:44
#define NUM_ROW_STACKS
Definition: solitaire.h:38
#define X_BORDER
Definition: solitaire.h:49
#define X_ROWSTACK_BORDER
Definition: solitaire.h:51
#define OPTION_SHOW_TIME
Definition: solitaire.h:12
#define OPTION_SCORE_STD
Definition: solitaire.h:14
#define OPTION_SCORE_VEGAS
Definition: solitaire.h:15
void Undo(void)
Definition: solundo.cpp:53
#define SCORE_STD
Definition: solitaire.h:45
#define SCORE_VEGAS
Definition: solitaire.h:46
#define Y_ROWSTACK_BORDER
Definition: solitaire.h:55
#define CARDBACK_START
Definition: solitaire.h:16
#define CARDBACK_RES_START
Definition: solitaire.h:19
HWND hSelf
Definition: solitaire.cpp:37
BOOL bSelected
Definition: solitaire.cpp:41
INT imgNum
Definition: solitaire.cpp:40
WNDPROC hOldProc
Definition: solitaire.cpp:38
INT hdcNum
Definition: solitaire.cpp:39
HBRUSH hbrBackground
Definition: winuser.h:3160
HICON hIcon
Definition: winuser.h:3158
HINSTANCE hInstance
Definition: winuser.h:3157
HCURSOR hCursor
Definition: winuser.h:3159
int cbWndExtra
Definition: winuser.h:3156
UINT style
Definition: winuser.h:3153
LPCSTR lpszMenuName
Definition: winuser.h:3161
LPCSTR lpszClassName
Definition: winuser.h:3162
WNDPROC lpfnWndProc
Definition: winuser.h:3154
int cbClsExtra
Definition: winuser.h:3155
POINT ptMinTrackSize
Definition: winuser.h:3620
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
#define GWLP_WNDPROC
Definition: treelist.c:66
#define GWLP_USERDATA
Definition: treelist.c:63
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
int32_t INT_PTR
Definition: typedefs.h:64
unsigned char * LPBYTE
Definition: typedefs.h:53
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
#define _T(x)
Definition: vfdio.h:22
int ret
#define ZeroMemory
Definition: winbase.h:1670
#define GetModuleHandle
Definition: winbase.h:3698
#define lstrcpy
Definition: winbase.h:3745
#define GetModuleFileName
Definition: winbase.h:3702
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
HGDIOBJ WINAPI GetStockObject(_In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
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)
#define SRCCOPY
Definition: wingdi.h:333
#define NULL_BRUSH
Definition: wingdi.h:901
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
#define PS_SOLID
Definition: wingdi.h:586
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define RegSetValueEx
Definition: winreg.h:533
#define RegCreateKeyEx
Definition: winreg.h:501
#define RegQueryValueEx
Definition: winreg.h:524
#define WM_PAINT
Definition: winuser.h:1610
DWORD WINAPI GetSysColor(_In_ int)
#define SW_HIDE
Definition: winuser.h:762
#define WM_CLOSE
Definition: winuser.h:1611
#define MF_BYCOMMAND
Definition: winuser.h:202
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define WinHelp
Definition: winuser.h:5854
#define HELP_QUIT
Definition: winuser.h:2404
#define CallWindowProc
Definition: winuser.h:5725
#define IDCANCEL
Definition: winuser.h:825
#define BST_UNCHECKED
Definition: winuser.h:199
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1598
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SIZE
Definition: winuser.h:1601
#define HELP_CONTENTS
Definition: winuser.h:2395
#define SWP_NOMOVE
Definition: winuser.h:1234
#define WM_COMMAND
Definition: winuser.h:1730
#define IDC_ARROW
Definition: winuser.h:682
#define SM_CYMENU
Definition: winuser.h:970
#define WM_INITDIALOG
Definition: winuser.h:1729
#define WM_LBUTTONDOWN
Definition: winuser.h:1766
#define MB_YESNO
Definition: winuser.h:811
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:824
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define CreateWindow
Definition: winuser.h:5744
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define GetMessage
Definition: winuser.h:5780
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define WM_GETMINMAXINFO
Definition: winuser.h:1630
#define MF_ENABLED
Definition: winuser.h:128
#define WM_TIMER
Definition: winuser.h:1732
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define LoadIcon
Definition: winuser.h:5803
BOOL WINAPI UpdateWindow(_In_ HWND)
#define SendMessage
Definition: winuser.h:5833
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define LoadCursor
Definition: winuser.h:5802
#define MB_OK
Definition: winuser.h:784
#define PostMessage
Definition: winuser.h:5822
#define CW_USEDEFAULT
Definition: winuser.h:225
#define LoadString
Definition: winuser.h:5809
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define MB_ICONQUESTION
Definition: winuser.h:783
#define MessageBox
Definition: winuser.h:5812
#define MB_ICONINFORMATION
Definition: winuser.h:796
#define SW_SHOW
Definition: winuser.h:769
#define RegisterClass
Definition: winuser.h:5826
#define WM_DESTROY
Definition: winuser.h:1599
#define DispatchMessage
Definition: winuser.h:5755
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2896
#define IDYES
Definition: winuser.h:829
#define SWP_NOZORDER
Definition: winuser.h:1237
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define TranslateAccelerator
Definition: winuser.h:5850
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define SM_CYCAPTION
Definition: winuser.h:957
int WINAPI GetSystemMetrics(_In_ int)
#define STN_CLICKED
Definition: winuser.h:2084
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define LoadAccelerators
Definition: winuser.h:5800
#define BST_CHECKED
Definition: winuser.h:197
HMENU WINAPI GetMenu(_In_ HWND)
#define DialogBox
Definition: winuser.h:5751
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define MF_GRAYED
Definition: winuser.h:129
#define COLOR_3DFACE
Definition: winuser.h:923
char TCHAR
Definition: xmlstorage.h:189
CHAR * LPTSTR
Definition: xmlstorage.h:192
unsigned char BYTE
Definition: xxhash.c:193