ReactOS 0.4.15-dev-7788-g1ad9096
solitaire.cpp
Go to the documentation of this file.
1#include "solitaire.h"
2
3#include <winreg.h>
4#include <commctrl.h>
5#include <shellapi.h>
6#include <tchar.h>
7
8#include "resource.h"
9
11
17
26
31long lScore;
33
35
36typedef struct _CardBack
37{
44
46
47void MakePath(TCHAR *szDest, UINT nDestLen, const TCHAR *szExt)
48{
49 TCHAR *ptr;
50
51 ptr = szDest + GetModuleFileName(GetModuleHandle(0), szDest, nDestLen) - 1;
52 while(*ptr-- != '.');
53 lstrcpy(ptr + 1, szExt);
54}
55
57{
58 DWORD dwDisposition;
60 DWORD dwBack;
61 HKEY hKey;
62
64 _T("Software\\ReactOS\\Solitaire"),
65 0,
66 NULL,
69 NULL,
70 &hKey,
71 &dwDisposition))
72 return;
73
74 dwSize = sizeof(DWORD);
76 _T("Options"),
77 NULL,
78 NULL,
80 &dwSize);
81
82 dwSize = sizeof(DWORD);
84 _T("Back"),
85 NULL,
86 NULL,
87 (LPBYTE)&dwBack,
88 &dwSize);
89 SolWnd.SetBackCardIdx(dwBack);
90
92}
93
95{
96 DWORD dwDisposition;
97 DWORD dwBack;
98 HKEY hKey;
99
101 _T("Software\\ReactOS\\Solitaire"),
102 0,
103 NULL,
105 KEY_WRITE,
106 NULL,
107 &hKey,
108 &dwDisposition))
109 return;
110
112 _T("Options"),
113 0,
114 REG_DWORD,
115 (CONST BYTE *)&dwOptions,
116 sizeof(DWORD));
117
118 dwBack = SolWnd.GetBackCardIdx();
120 _T("Back"),
121 0,
122 REG_DWORD,
123 (CONST BYTE *)&dwBack,
124 sizeof(DWORD));
125
127}
128
129// Returns 0 for no points, 1 for Standard and 2 for Vegas
131{
133 {
134 return SCORE_NONE;
135 }
136
138 {
139 return SCORE_STD;
140 }
141
143 {
144 return SCORE_VEGAS;
145 }
146
147 return 0;
148}
149
151{
152 TCHAR szStatusText[128];
153 TCHAR szTempText[64];
154
155 ZeroMemory(szStatusText, sizeof(szStatusText));
156
157 if (GetScoreMode() != SCORE_NONE)
158 {
159 _stprintf(szStatusText, szScore, lScore);
160 _tcscat(szStatusText, _T(" "));
161 }
162
164 {
165 _stprintf(szTempText, szTime, dwTime);
166 _tcscat(szStatusText, szTempText);
167 }
168
170}
171
172void SetPlayTimer(void)
173{
175 {
176 if (!PlayTimer)
177 {
179 }
180 }
181}
182
184{
185 if (enable)
186 {
188 }
189 else
190 {
192 }
193}
194
195//
196// Main entry point
197//
198int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int iCmdShow)
199{
200 HWND hwnd;
201 MSG msg;
202 WNDCLASS wndclass;
204 HACCEL hAccelTable;
205
207
208 // Load application title
209 LoadString(hInst, IDS_SOL_NAME, szAppName, sizeof(szAppName) / sizeof(szAppName[0]));
210 // Load MsgBox() texts here to avoid loading them many times later
211 LoadString(hInst, IDS_SOL_ABOUT, MsgAbout, sizeof(MsgAbout) / sizeof(MsgAbout[0]));
212 LoadString(hInst, IDS_SOL_QUIT, MsgQuit, sizeof(MsgQuit) / sizeof(MsgQuit[0]));
213 LoadString(hInst, IDS_SOL_WIN, MsgWin, sizeof(MsgWin) / sizeof(MsgWin[0]));
214 LoadString(hInst, IDS_SOL_DEAL, MsgDeal, sizeof(MsgDeal) / sizeof(MsgDeal[0]));
215
216 LoadString(hInst, IDS_SOL_SCORE, szScore, sizeof(szScore) / sizeof(TCHAR));
217 LoadString(hInst, IDS_SOL_TIME, szTime, sizeof(szTime) / sizeof(TCHAR));
218
219 //Window class for the main application parent window
220 wndclass.style = 0;//CS_HREDRAW | CS_VREDRAW;
221 wndclass.lpfnWndProc = WndProc;
222 wndclass.cbClsExtra = 0;
223 wndclass.cbWndExtra = 0;
224 wndclass.hInstance = hInst;
226 wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
227 wndclass.hbrBackground = (HBRUSH)NULL;
229 wndclass.lpszClassName = szAppName;
230
231 RegisterClass(&wndclass);
232
233 ice.dwSize = sizeof(ice);
236
237 srand((unsigned)GetTickCount());//timeGetTime());
238
239// InitCardLib();
240
241 LoadSettings();
242
244
245 //Construct the path to our help file
246 MakePath(szHelpPath, MAX_PATH, _T(".hlp"));
247
248 hwnd = CreateWindow(szAppName, // window class name
249 szAppName, // window caption
251 ,//|WS_CLIPCHILDREN, // window style
252 CW_USEDEFAULT, // initial x position
253 CW_USEDEFAULT, // initial y position
254 0, // The real size will be computed in WndProc through WM_GETMINMAXINFO
255 0, // The real size will be computed in WndProc through WM_GETMINMAXINFO
256 NULL, // parent window handle
257 NULL, // use window class menu
258 hInst, // program instance handle
259 NULL); // creation parameters
260 if (hwnd == NULL)
261 return 1;
262
263 hwndMain = hwnd;
264
266
268
269 ShowWindow(hwnd, iCmdShow);
271
273
274 while(GetMessage(&msg, NULL,0,0))
275 {
276 if(!TranslateAccelerator(hwnd, hAccelTable, &msg))
277 {
280 }
281 }
282
283 SaveSettings();
284
285 return msg.wParam;
286}
287
288
290{
291 HWND hCtrl;
292
293 switch (uMsg)
294 {
295 case WM_INITDIALOG:
296 // For now, the Help dialog item is disabled because of lacking of HTML Help support
298
301
302 CheckDlgButton(hDlg,
305
306 CheckDlgButton(hDlg,
309
310 CheckDlgButton(hDlg,
313
314 hCtrl = GetDlgItem(hDlg, IDC_OPT_KEEPSCORE);
315
316 if (GetScoreMode() == SCORE_NONE)
317 {
319 EnableWindow(hCtrl, FALSE);
320 }
321 else if (GetScoreMode() == SCORE_STD)
322 {
324 EnableWindow(hCtrl, FALSE);
325 }
326 else if (GetScoreMode() == SCORE_VEGAS)
327 {
329 EnableWindow(hCtrl, TRUE);
330 }
331 return TRUE;
332
333 case WM_COMMAND:
334 switch(LOWORD(wParam))
335 {
336 case IDC_OPT_NOSCORE:
337 case IDC_OPT_STANDARD:
338 case IDC_OPT_VEGAS:
339 hCtrl = GetDlgItem(hDlg, IDC_OPT_KEEPSCORE);
340 if (wParam == IDC_OPT_VEGAS)
341 EnableWindow(hCtrl, TRUE);
342 else
343 EnableWindow(hCtrl, FALSE);
344 return TRUE;
345
346 case IDOK:
347 dwOptions &= ~OPTION_THREE_CARDS;
350
353 else
354 dwOptions &= ~OPTION_SHOW_STATUS;
355
358 else
359 dwOptions &= ~OPTION_SHOW_TIME;
360
363 else
364 dwOptions &= ~OPTION_KEEP_SCORE;
365
367 {
369 dwOptions &= ~OPTION_SCORE_VEGAS;
370 }
372 {
374 dwOptions &= ~OPTION_SCORE_STD;
375 }
377 {
380 }
381
383
384 EndDialog(hDlg, TRUE);
385 return TRUE;
386
387 case IDCANCEL:
388 EndDialog(hDlg, FALSE);
389 return TRUE;
390 }
391 break;
392 }
393 return FALSE;
394}
395
397{
398 DWORD dwOldOptions = dwOptions;
399 RECT rcMain, rcStatus;
400
401 int iOldScoreMode = GetScoreMode();
402
404 {
405 if (((dwOldOptions & OPTION_THREE_CARDS) != (dwOptions & OPTION_THREE_CARDS)) ||
406 ((dwOldOptions & OPTION_SHOW_TIME) != (dwOptions & OPTION_SHOW_TIME)) ||
407 (iOldScoreMode != GetScoreMode()))
408 NewGame();
409
410 if ((dwOldOptions & OPTION_SHOW_STATUS) != (dwOptions & OPTION_SHOW_STATUS))
411 {
412 int nWidth, nHeight, nStatusHeight;
413
414 GetClientRect(hwndMain, &rcMain);
415 nHeight = rcMain.bottom - rcMain.top;
416 nWidth = rcMain.right - rcMain.left;
417
419 {
420 RECT rc;
421
423 GetWindowRect(hwndStatus, &rcStatus);
424 nStatusHeight = rcStatus.bottom - rcStatus.top;
425 MoveWindow(SolWnd, 0, 0, nWidth, nHeight-nStatusHeight, TRUE);
426 MoveWindow(hwndStatus, 0, nHeight-nStatusHeight, nWidth, nHeight, TRUE);
427
428 // Force the window to process WM_GETMINMAXINFO again
430 SetWindowPos(hwndMain, NULL, 0, 0, rc.right - rc.left, rc.bottom - rc.top, SWP_NOMOVE | SWP_NOZORDER);
431 }
432 else
433 {
435 MoveWindow(SolWnd, 0, 0, nWidth, nHeight, TRUE);
436 }
437 }
438 }
439}
440
441
444 UINT msg,
447{
450 static WNDPROC hOldProc = NULL;
451
452 if (!hOldProc && pCardBack)
453 hOldProc = pCardBack->hOldProc;
454
455 switch (msg)
456 {
457 case WM_PAINT:
458 {
459 HDC hdc;
460 PAINTSTRUCT ps;
461 HPEN hPen, hOldPen;
462 HBRUSH hBrush, hOldBrush;
463 RECT rc;
464
465 hdc = BeginPaint(hwnd, &ps);
466
467 if (pCardBack->bSelected)
468 {
469 hPen = CreatePen(PS_SOLID, 2, RGB(0,0,0));
470 }
471 else
472 {
474 hPen = CreatePen(PS_SOLID, 2, Face);
475 }
476
477 GetClientRect(hwnd, &rc);
478 hBrush = (HBRUSH)GetStockObject(NULL_BRUSH);
479 hOldPen = (HPEN)SelectObject(hdc, hPen);
480 hOldBrush = (HBRUSH)SelectObject(hdc, hBrush);
481
483 rc.left+1,
484 rc.top+1,
485 rc.right,
486 rc.bottom);
487
489 2,
490 2,
494 pCardBack->hdcNum * __cardwidth,
495 0,
498 SRCCOPY);
499
500 SelectObject(hdc, hOldPen);
501 SelectObject(hdc, hOldBrush);
502
503 EndPaint(hwnd, &ps);
504
505 break;
506 }
507
508 case WM_LBUTTONDOWN:
509 pCardBack->bSelected = pCardBack->bSelected ? FALSE : TRUE;
510 break;
511 }
512
513 return CallWindowProc(hOldProc,
514 hwnd,
515 msg,
516 wParam,
517 lParam);
518}
519
520
522 UINT uMsg,
525{
526 static PCARDBACK pCardBacks = NULL;
527
528 switch (uMsg)
529 {
530 case WM_INITDIALOG:
531 {
532 INT i, c;
533 SIZE_T size = sizeof(CARDBACK) * NUM_CARDBACKS;
534
535 pCardBacks = (PCARDBACK)HeapAlloc(GetProcessHeap(),
536 0,
537 size);
538
539 for (i = 0, c = CARDBACK_START; c <= CARDBACK_END; i++, c++)
540 {
541 pCardBacks[i].hSelf = GetDlgItem(hDlg, c);
542 pCardBacks[i].bSelected = FALSE;
543 pCardBacks[i].hdcNum = CARDBACK_RES_START + i;
544 pCardBacks[i].imgNum = i + 1;
545 pCardBacks[i].hOldProc = (WNDPROC)SetWindowLongPtr(pCardBacks[i].hSelf,
548
549 SetWindowLongPtr(pCardBacks[i].hSelf,
551 (LONG_PTR)&pCardBacks[i]);
552 }
553
554 return TRUE;
555 }
556
557 case WM_COMMAND:
558 if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
559 {
560 INT i, num = 0;
561 for (i = 0; i < NUM_CARDBACKS; i++)
562 {
563 if (pCardBacks[i].bSelected)
564 {
565 num = pCardBacks[i].imgNum;
566 }
567 }
568
569 EndDialog(hDlg, LOWORD(wParam) == IDOK ? num : FALSE);
570 HeapFree(GetProcessHeap(), 0, pCardBacks);
571 return TRUE;
572 }
573
574 if (HIWORD(wParam) == STN_CLICKED)
575 {
576 INT i;
577 RECT rc;
578 for (i = 0; i < NUM_CARDBACKS; i++)
579 {
580 if (pCardBacks[i].hSelf == (HWND)lParam)
581 {
582 pCardBacks[i].bSelected = TRUE;
583 }
584 else
585 pCardBacks[i].bSelected = FALSE;
586
587 GetClientRect(pCardBacks[i].hSelf, &rc);
588 InvalidateRect(pCardBacks[i].hSelf, &rc, TRUE);
589 }
590
591 break;
592 }
593 }
594
595 return FALSE;
596}
597
598
600{
601 INT cardBack;
602
603 if ((cardBack = DialogBox(hInstance,
605 hwnd,
607 {
608 SolWnd.SetBackCardIdx(CARDBACK_RES_START + (cardBack - 1));
609 SolWnd.Redraw();
610 }
611}
612
613//-----------------------------------------------------------------------------
615{
616 static int nWidth, nHeight, nStatusHeight;
617
618 switch(iMsg)
619 {
620 case WM_CREATE:
621 {
622 int parts[] = { 150, -1 };
623 RECT rcStatus;
624
625 // For now, the Help dialog item is disabled because of lacking of HTML Help support
627
629
630 //SendMessage(hwndStatus, SB_SIMPLE, (WPARAM)TRUE, 0);
631
634
635 SolWnd.Create(hwnd, 0, WS_CHILD | WS_VISIBLE, 0, 0, 100, 100);
636
637 CreateSol();
638
639 // The status bar height is fixed and needed later in WM_SIZE and WM_GETMINMAXINFO
640 // Force the window to process WM_GETMINMAXINFO again
641 GetWindowRect(hwndStatus, &rcStatus);
642 nStatusHeight = rcStatus.bottom - rcStatus.top;
643
644 // Hide status bar if options say so
646 {
648 }
649
651
652 NewGame();
653
655
656 return 0;
657 }
658
659 case WM_DESTROY:
661 return 0;
662
663 case WM_TIMER:
664 if (!fGameStarted)
665 {
667 PlayTimer = 0;
668 }
669 else if (dwOptions & OPTION_SHOW_TIME)
670 {
671 if (((dwTime + 1) % 10 == 0) && (GetScoreMode() == SCORE_STD))
672 {
673 lScore = lScore >= 2 ? lScore - 2 : 0;
674 }
675
676 dwTime++;
677 }
678
680 return 0;
681
682 case WM_SIZE:
683 nWidth = LOWORD(lParam);
684 nHeight = HIWORD(lParam);
685
687 {
688 MoveWindow(SolWnd, 0, 0, nWidth, nHeight - nStatusHeight, TRUE);
689 MoveWindow(hwndStatus, 0, nHeight - nStatusHeight, nWidth, nStatusHeight, TRUE);
690 }
691 else
692 {
693 MoveWindow(SolWnd, 0, 0, nWidth, nHeight, TRUE);
694 }
695 //parts[0] = nWidth - 256;
696 //SendMessage(hwndStatus, SB_SETPARTS, 2, (LPARAM)parts);
697 return 0;
698
699 case WM_GETMINMAXINFO:
700 {
701 MINMAXINFO *mmi;
702
703 mmi = (MINMAXINFO *)lParam;
707 Y_BORDER +
712 Y_BORDER +
713 (dwOptions & OPTION_SHOW_STATUS ? nStatusHeight : 0);
714 return 0;
715 }
716
717 case WM_COMMAND:
718 switch(LOWORD(wParam))
719 {
720 case IDM_GAME_NEW:
721 //simulate a button click on the new button..
722 NewGame();
723 return 0;
724
725 case IDM_GAME_UNDO:
726 Undo();
727 return 0;
728
729 case IDM_GAME_DECK:
731 return 0;
732
733 case IDM_GAME_OPTIONS:
735 return 0;
736
738 WinHelp(hwnd, szHelpPath, HELP_CONTENTS, 0);//HELP_KEY, (DWORD)"How to play");
739 return 0;
740
741 case IDM_HELP_ABOUT:
744 return 0;
745
746 case IDM_GAME_EXIT:
747 PostMessage(hwnd, WM_CLOSE, 0, 0);
748 return 0;
749 }
750
751 return 0;
752
753 case WM_CLOSE:
754 if (fGameStarted == false)
755 {
757 return 0;
758 }
759 else
760 {
761 int ret;
762
764 if (ret == IDYES)
765 {
768 }
769 }
770 return 0;
771 }
772
773 return DefWindowProc (hwnd, iMsg, wParam, lParam);
774}
775
776
#define msg(x)
Definition: auth_time.c:54
#define IDM_HELP_ABOUT
Definition: resource.h:387
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:49
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:63
__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
#define ShellAbout
Definition: shellapi.h:689
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:18
HMENU hGameMenu
Definition: solitaire.cpp:16
DWORD dwWasteCount
Definition: solitaire.cpp:28
TCHAR szHelpPath[MAX_PATH]
Definition: solitaire.cpp:10
TCHAR MsgDeal[128]
Definition: solitaire.cpp:24
TCHAR MsgAbout[128]
Definition: solitaire.cpp:22
TCHAR MsgWin[128]
Definition: solitaire.cpp:23
VOID ShowDeckOptionsDlg(HWND hwnd)
Definition: solitaire.cpp:599
DWORD dwWasteTreshold
Definition: solitaire.cpp:29
void SetPlayTimer(void)
Definition: solitaire.cpp:172
HWND hwndStatus
Definition: solitaire.cpp:14
INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:289
struct _CardBack CARDBACK
void MakePath(TCHAR *szDest, UINT nDestLen, const TCHAR *szExt)
Definition: solitaire.cpp:47
HINSTANCE hInstance
Definition: solitaire.cpp:15
HWND hwndMain
Definition: solitaire.cpp:13
DWORD dwOptions
Definition: solitaire.cpp:25
void UpdateStatusBar(void)
Definition: solitaire.cpp:150
TCHAR szScore[64]
Definition: solitaire.cpp:19
LRESULT CALLBACK CardImageWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:443
VOID ShowGameOptionsDlg(HWND hwnd)
Definition: solitaire.cpp:396
DWORD dwTime
Definition: solitaire.cpp:27
DWORD dwAppStartTime
Definition: solitaire.cpp:12
void SetUndoMenuState(bool enable)
Definition: solitaire.cpp:183
TCHAR szTime[64]
Definition: solitaire.cpp:20
DWORD dwPrevMode
Definition: solitaire.cpp:30
struct _CardBack * PCARDBACK
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:614
int GetScoreMode(void)
Definition: solitaire.cpp:130
INT_PTR CALLBACK CardBackDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:521
CardWindow SolWnd
Definition: solitaire.cpp:34
long lScore
Definition: solitaire.cpp:31
TCHAR MsgQuit[128]
Definition: solitaire.cpp:21
UINT_PTR PlayTimer
Definition: solitaire.cpp:32
#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:38
BOOL bSelected
Definition: solitaire.cpp:42
INT imgNum
Definition: solitaire.cpp:41
WNDPROC hOldProc
Definition: solitaire.cpp:39
INT hdcNum
Definition: solitaire.cpp:40
HBRUSH hbrBackground
Definition: winuser.h:3170
HICON hIcon
Definition: winuser.h:3168
HINSTANCE hInstance
Definition: winuser.h:3167
HCURSOR hCursor
Definition: winuser.h:3169
int cbWndExtra
Definition: winuser.h:3166
UINT style
Definition: winuser.h:3163
LPCSTR lpszMenuName
Definition: winuser.h:3171
LPCSTR lpszClassName
Definition: winuser.h:3172
WNDPROC lpfnWndProc
Definition: winuser.h:3164
int cbClsExtra
Definition: winuser.h:3165
POINT ptMinTrackSize
Definition: winuser.h:3630
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:1712
#define GetModuleHandle
Definition: winbase.h:3762
#define lstrcpy
Definition: winbase.h:3809
#define GetModuleFileName
Definition: winbase.h:3766
_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:1620
DWORD WINAPI GetSysColor(_In_ int)
#define SW_HIDE
Definition: winuser.h:768
#define WM_CLOSE
Definition: winuser.h:1621
#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:5864
#define HELP_QUIT
Definition: winuser.h:2414
#define CallWindowProc
Definition: winuser.h:5735
#define IDCANCEL
Definition: winuser.h:831
#define BST_UNCHECKED
Definition: winuser.h:199
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1608
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:1611
#define HELP_CONTENTS
Definition: winuser.h:2405
#define SWP_NOMOVE
Definition: winuser.h:1244
#define WM_COMMAND
Definition: winuser.h:1740
#define IDC_ARROW
Definition: winuser.h:687
#define SM_CYMENU
Definition: winuser.h:976
#define WM_INITDIALOG
Definition: winuser.h:1739
#define WM_LBUTTONDOWN
Definition: winuser.h:1776
#define MB_YESNO
Definition: winuser.h:817
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:830
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define CreateWindow
Definition: winuser.h:5754
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define GetMessage
Definition: winuser.h:5790
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define WM_GETMINMAXINFO
Definition: winuser.h:1640
#define MF_ENABLED
Definition: winuser.h:128
#define WM_TIMER
Definition: winuser.h:1742
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define LoadIcon
Definition: winuser.h:5813
BOOL WINAPI UpdateWindow(_In_ HWND)
#define SendMessage
Definition: winuser.h:5843
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define LoadCursor
Definition: winuser.h:5812
#define PostMessage
Definition: winuser.h:5832
#define CW_USEDEFAULT
Definition: winuser.h:225
#define LoadString
Definition: winuser.h:5819
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define MB_ICONQUESTION
Definition: winuser.h:789
#define MessageBox
Definition: winuser.h:5822
#define SW_SHOW
Definition: winuser.h:775
#define RegisterClass
Definition: winuser.h:5836
#define WM_DESTROY
Definition: winuser.h:1609
#define DispatchMessage
Definition: winuser.h:5765
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2906
#define IDYES
Definition: winuser.h:835
#define SWP_NOZORDER
Definition: winuser.h:1247
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define TranslateAccelerator
Definition: winuser.h:5860
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:963
int WINAPI GetSystemMetrics(_In_ int)
#define STN_CLICKED
Definition: winuser.h:2094
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define LoadAccelerators
Definition: winuser.h:5810
#define BST_CHECKED
Definition: winuser.h:197
HMENU WINAPI GetMenu(_In_ HWND)
#define DialogBox
Definition: winuser.h:5761
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define MF_GRAYED
Definition: winuser.h:129
#define COLOR_3DFACE
Definition: winuser.h:929
char TCHAR
Definition: xmlstorage.h:189
CHAR * LPTSTR
Definition: xmlstorage.h:192
unsigned char BYTE
Definition: xxhash.c:193