ReactOS 0.4.16-dev-109-gf4cb10f
main.c File Reference
#include "main.h"
#include <winbase.h>
#include <winreg.h>
#include <wingdi.h>
#include <time.h>
#include <stdlib.h>
#include <shellapi.h>
#include <wine/debug.h>
Include dependency graph for main.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (winemine)
 
void CheckLevel (BOARD *p_board)
 
static void LoadBoard (BOARD *p_board)
 
static void InitBoard (BOARD *p_board)
 
static void SaveBoard (BOARD *p_board)
 
static void DestroyBoard (BOARD *p_board)
 
static void SetDifficulty (BOARD *p_board, DIFFICULTY difficulty)
 
static void ShiftBetween (LONG *x, LONG *y, LONG a, LONG b)
 
static void MoveOnScreen (RECT *rect)
 
static void CreateBoard (BOARD *p_board)
 
static void PlaceMines (BOARD *p_board, int selected_col, int selected_row)
 
static void DrawMine (HDC hdc, HDC hMemDC, BOARD *p_board, unsigned col, unsigned row, BOOL IsPressed)
 
static void DrawMines (HDC hdc, HDC hMemDC, BOARD *p_board)
 
static void DrawLeds (HDC hdc, HDC hMemDC, BOARD *p_board, int number, int x, int y)
 
static void DrawFace (HDC hdc, HDC hMemDC, BOARD *p_board)
 
static void DrawBoard (HDC hdc, HDC hMemDC, PAINTSTRUCT *ps, BOARD *p_board)
 
static void AddFlag (BOARD *p_board, unsigned col, unsigned row)
 
static void UnpressBox (BOARD *p_board, unsigned col, unsigned row)
 
static void UnpressBoxes (BOARD *p_board, unsigned col, unsigned row)
 
static void PressBox (BOARD *p_board, unsigned col, unsigned row)
 
static void PressBoxes (BOARD *p_board, unsigned col, unsigned row)
 
static void CompleteBox (BOARD *p_board, unsigned col, unsigned row)
 
static void CompleteBoxes (BOARD *p_board, unsigned col, unsigned row)
 
static void TestMines (BOARD *p_board, POINT pt, int msg)
 
static void TestFace (BOARD *p_board, POINT pt, int msg)
 
static void TestBoard (HWND hWnd, BOARD *p_board, int x, int y, int msg)
 
static LRESULT WINAPI MainProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
int WINAPI wWinMain (HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cmdshow)
 

Variables

static const DWORD wnd_style = WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX
 
static const WCHAR registry_key []
 
static const WCHAR xposW [] = {'X','p','o','s',0}
 
static const WCHAR yposW [] = {'Y','p','o','s',0}
 
static const WCHAR heightW [] = {'H','e','i','g','h','t',0}
 
static const WCHAR widthW [] = {'W','i','d','t','h',0}
 
static const WCHAR minesW [] = {'M','i','n','e','s',0}
 
static const WCHAR difficultyW [] = {'D','i','f','f','i','c','u','l','t','y',0}
 
static const WCHAR markW [] = {'M','a','r','k',0}
 
static const WCHAR nameW [] = {'N','a','m','e','%','u',0}
 
static const WCHAR timeW [] = {'T','i','m','e','%','u',0}
 

Function Documentation

◆ AddFlag()

static void AddFlag ( BOARD p_board,
unsigned  col,
unsigned  row 
)
static

Definition at line 574 of file main.c.

575{
576 if( p_board->box[col][row].FlagType != COMPLETE ) {
577 switch( p_board->box[col][row].FlagType ) {
578 case FLAG:
579 if( p_board->IsMarkQ ) {
580 p_board->box[col][row].FlagType = QUESTION;
581#ifdef __REACTOS__
582 PlaySoundEffect(p_board, IDW_QUESTION);
583#endif
584 }
585 else
586 p_board->box[col][row].FlagType = NORMAL;
587 p_board->num_flags--;
588 break;
589
590 case QUESTION:
591 p_board->box[col][row].FlagType = NORMAL;
592 break;
593
594 default:
595 p_board->box[col][row].FlagType = FLAG;
596 p_board->num_flags++;
597#ifdef __REACTOS__
598 PlaySoundEffect(p_board, IDW_FLAG);
599#endif
600 }
601 }
602}
#define NORMAL
Definition: main.h:128
#define QUESTION
Definition: main.h:129
#define COMPLETE
Definition: main.h:131
#define FLAG
Definition: main.h:130
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
unsigned num_flags
Definition: main.h:93
BOOL IsMarkQ
Definition: main.h:73

Referenced by TestMines().

◆ CheckLevel()

void CheckLevel ( BOARD p_board)

Definition at line 52 of file main.c.

53{
54 if( p_board->rows < BEGINNER_ROWS )
55 p_board->rows = BEGINNER_ROWS;
56
57 if( p_board->rows > MAX_ROWS )
58 p_board->rows = MAX_ROWS;
59
60 if( p_board->cols < BEGINNER_COLS )
61 p_board->cols = BEGINNER_COLS;
62
63 if( p_board->cols > MAX_COLS )
64 p_board->cols = MAX_COLS;
65
66 if( p_board->mines < BEGINNER_MINES )
67 p_board->mines = BEGINNER_MINES;
68
69 if( p_board->mines > ( p_board->cols - 1 ) * ( p_board->rows - 1 ) )
70 p_board->mines = ( p_board->cols - 1 ) * ( p_board->rows - 1 );
71}
#define BEGINNER_ROWS
Definition: main.h:32
#define BEGINNER_COLS
Definition: main.h:31
#define BEGINNER_MINES
Definition: main.h:30
#define MAX_COLS
Definition: main.h:42
#define MAX_ROWS
Definition: map.c:19
unsigned cols
Definition: main.h:99
unsigned mines
Definition: main.h:100
unsigned rows
Definition: main.h:98

Referenced by CustomDlgProc(), and InitBoard().

◆ CompleteBox()

static void CompleteBox ( BOARD p_board,
unsigned  col,
unsigned  row 
)
static

Definition at line 682 of file main.c.

684{
685 int i, j;
686
687 if( p_board->box[col][row].FlagType != COMPLETE &&
688 p_board->box[col][row].FlagType != FLAG &&
689 col > 0 && col < p_board->cols + 1 &&
690 row > 0 && row < p_board->rows + 1 ) {
691 p_board->box[col][row].FlagType = COMPLETE;
692
693 if( p_board->box[col][row].IsMine ) {
694 p_board->face_bmp = DEAD_BMP;
695 p_board->status = GAMEOVER;
696#ifdef __REACTOS__
697 PlaySoundEffect(p_board, IDW_EXPLODE);
698#endif
699 }
700 else if( p_board->status != GAMEOVER ) {
701 p_board->boxes_left--;
702#ifdef __REACTOS__
703 if (is_first_box)
704 PlaySoundEffect(p_board, IDW_BOX);
705#endif
706 }
707
708 if( p_board->box[col][row].NumMines == 0 )
709 {
710 for( i = -1; i <= 1; i++ )
711 for( j = -1; j <= 1; j++ )
712#ifdef __REACTOS__
713 CompleteBox( p_board, col + i, row + j, FALSE );
714#else
715 CompleteBox( p_board, col + i, row + j );
716#endif
717 }
718 }
719}
static void CompleteBox(BOARD *p_board, unsigned col, unsigned row)
Definition: main.c:682
@ GAMEOVER
Definition: main.h:61
@ DEAD_BMP
Definition: main.h:59
#define FALSE
Definition: types.h:117
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
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 GLint GLint j
Definition: glfuncs.h:250
GAME_STATUS status
Definition: main.h:118
unsigned boxes_left
Definition: main.h:94
FACE_BMP face_bmp
Definition: main.h:117

Referenced by CompleteBox(), CompleteBoxes(), and TestMines().

◆ CompleteBoxes()

static void CompleteBoxes ( BOARD p_board,
unsigned  col,
unsigned  row 
)
static

Definition at line 722 of file main.c.

723{
724 unsigned numFlags = 0;
725 int i, j;
726
727 if( p_board->box[col][row].FlagType == COMPLETE ) {
728 for( i = -1; i <= 1; i++ )
729 for( j = -1; j <= 1; j++ ) {
730 if( p_board->box[col+i][row+j].FlagType == FLAG )
731 numFlags++;
732 }
733
734 if( numFlags == p_board->box[col][row].NumMines ) {
735 for( i = -1; i <= 1; i++ )
736 for( j = -1; j <= 1; j++ ) {
737 if( p_board->box[col+i][row+j].FlagType != FLAG )
738#ifdef __REACTOS__
739 CompleteBox( p_board, col+i, row+j, FALSE );
740#else
741 CompleteBox( p_board, col+i, row+j );
742#endif
743 }
744 }
745 }
746}

Referenced by TestMines().

◆ CreateBoard()

static void CreateBoard ( BOARD p_board)
static

Definition at line 276 of file main.c.

277{
278 int left, top, bottom, right;
279 unsigned col, row;
280 RECT wnd_rect;
281
282 p_board->mb = MB_NONE;
283 p_board->boxes_left = p_board->cols * p_board->rows - p_board->mines;
284 p_board->num_flags = 0;
285
286 /* Create the boxes...
287 * We actually create them with an empty border,
288 * so special care doesn't have to be taken on the edges
289 */
290 for( col = 0; col <= p_board->cols + 1; col++ )
291 for( row = 0; row <= p_board->rows + 1; row++ ) {
292 p_board->box[col][row].IsPressed = FALSE;
293 p_board->box[col][row].IsMine = FALSE;
294 p_board->box[col][row].FlagType = NORMAL;
295 p_board->box[col][row].NumMines = 0;
296 }
297
298 p_board->width = p_board->cols * MINE_WIDTH + BOARD_WMARGIN * 2;
299
300 p_board->height = p_board->rows * MINE_HEIGHT + LED_HEIGHT
301 + BOARD_HMARGIN * 3;
302
303 /* setting the mines rectangle boundary */
306 right = left + p_board->cols * MINE_WIDTH;
307 bottom = top + p_board->rows * MINE_HEIGHT;
308 SetRect( &p_board->mines_rect, left, top, right, bottom );
309
310 /* setting the face rectangle boundary */
311 left = p_board->width / 2 - FACE_WIDTH / 2;
315 SetRect( &p_board->face_rect, left, top, right, bottom );
316
317 /* setting the timer rectangle boundary */
320 right = left + LED_WIDTH * 3;
322 SetRect( &p_board->timer_rect, left, top, right, bottom );
323
324 /* setting the counter rectangle boundary */
325 left = p_board->width - BOARD_WMARGIN - LED_WIDTH * 3;
327 right = p_board->width - BOARD_WMARGIN;
329 SetRect( &p_board->counter_rect, left, top, right, bottom );
330
331 p_board->status = WAITING;
332 p_board->face_bmp = SMILE_BMP;
333 p_board->time = 0;
334
335 SetRect(&wnd_rect, p_board->pos.x, p_board->pos.y, p_board->pos.x + p_board->width,
336 p_board->pos.y + p_board->height);
337 AdjustWindowRect(&wnd_rect, wnd_style, TRUE);
338
339 /* Make sure the window is completely on the screen */
340 MoveOnScreen(&wnd_rect);
341 MoveWindow( p_board->hWnd, wnd_rect.left, wnd_rect.top,
342 wnd_rect.right - wnd_rect.left,
343 wnd_rect.bottom - wnd_rect.top,
344 TRUE );
345 RedrawWindow( p_board->hWnd, NULL, 0,
347}
static void MoveOnScreen(RECT *rect)
Definition: main.c:260
static const DWORD wnd_style
Definition: main.c:37
#define BOARD_HMARGIN
Definition: main.h:47
#define FACE_WIDTH
Definition: main.h:54
@ WAITING
Definition: main.h:61
#define MINE_WIDTH
Definition: main.h:50
@ SMILE_BMP
Definition: main.h:59
#define LED_WIDTH
Definition: main.h:52
#define MB_NONE
Definition: main.h:108
#define MINE_HEIGHT
Definition: main.h:51
#define LED_HEIGHT
Definition: main.h:53
#define BOARD_WMARGIN
Definition: main.h:46
#define FACE_HEIGHT
Definition: main.h:55
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLdouble GLdouble right
Definition: glext.h:10859
GLint left
Definition: glext.h:7726
GLint GLint bottom
Definition: glext.h:7726
HWND hWnd
Definition: main.h:79
unsigned mb
Definition: main.h:115
unsigned width
Definition: main.h:88
RECT timer_rect
Definition: main.h:85
RECT mines_rect
Definition: main.h:83
unsigned height
Definition: main.h:89
RECT counter_rect
Definition: main.h:86
unsigned time
Definition: main.h:92
RECT face_rect
Definition: main.h:84
POINT pos
Definition: main.h:90
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
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
#define RDW_UPDATENOW
Definition: winuser.h:1223
#define RDW_ERASE
Definition: winuser.h:1214
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define RDW_INVALIDATE
Definition: winuser.h:1217
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

Referenced by MainProc(), and TestFace().

◆ DestroyBoard()

static void DestroyBoard ( BOARD p_board)
static

Definition at line 202 of file main.c.

203{
204 DeleteObject( p_board->hFacesBMP );
205 DeleteObject( p_board->hLedsBMP );
206 DeleteObject( p_board->hMinesBMP );
207}
pKey DeleteObject()
HBITMAP hMinesBMP
Definition: main.h:80
HBITMAP hLedsBMP
Definition: main.h:82
HBITMAP hFacesBMP
Definition: main.h:81

Referenced by MainProc().

◆ DrawBoard()

static void DrawBoard ( HDC  hdc,
HDC  hMemDC,
PAINTSTRUCT ps,
BOARD p_board 
)
static

Definition at line 543 of file main.c.

544{
545 RECT tmp_rect;
546
547 if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->counter_rect ) )
548 DrawLeds( hdc, hMemDC, p_board, p_board->mines - p_board->num_flags,
549 p_board->counter_rect.left,
550 p_board->counter_rect.top );
551
552 if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->timer_rect ) )
553 DrawLeds( hdc, hMemDC, p_board, p_board->time,
554 p_board->timer_rect.left,
555 p_board->timer_rect.top );
556
557 if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->face_rect ) )
558 DrawFace( hdc, hMemDC, p_board );
559
560 if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->mines_rect ) )
561 DrawMines( hdc, hMemDC, p_board );
562}
static void DrawMines(HDC hdc, HDC hMemDC, BOARD *p_board)
Definition: main.c:469
static void DrawLeds(HDC hdc, HDC hMemDC, BOARD *p_board, int number, int x, int y)
Definition: main.c:483
static void DrawFace(HDC hdc, HDC hMemDC, BOARD *p_board)
Definition: main.c:526
HDC hdc
Definition: main.c:9
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)

Referenced by MainProc().

◆ DrawFace()

static void DrawFace ( HDC  hdc,
HDC  hMemDC,
BOARD p_board 
)
static

Definition at line 526 of file main.c.

527{
528 HGDIOBJ hOldObj;
529
530 hOldObj = SelectObject (hMemDC, p_board->hFacesBMP);
531
532 BitBlt( hdc,
533 p_board->face_rect.left,
534 p_board->face_rect.top,
537 hMemDC, 0, p_board->face_bmp * FACE_HEIGHT, SRCCOPY);
538
539 SelectObject( hMemDC, hOldObj );
540}
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:57
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define SRCCOPY
Definition: wingdi.h:333

Referenced by DrawBoard().

◆ DrawLeds()

static void DrawLeds ( HDC  hdc,
HDC  hMemDC,
BOARD p_board,
int  number,
int  x,
int  y 
)
static

Definition at line 483 of file main.c.

484{
485 HGDIOBJ hOldObj;
486 unsigned led[3], i;
487 int count;
488
489 count = number;
490 if( count < 1000 ) {
491 if( count >= 0 ) {
492 led[0] = count / 100 ;
493 count -= led[0] * 100;
494 }
495 else {
496 led[0] = 10; /* negative sign */
497 count = -count;
498 }
499 led[1] = count / 10;
500 count -= led[1] * 10;
501 led[2] = count;
502 }
503 else {
504 for( i = 0; i < 3; i++ )
505 led[i] = 10;
506 }
507
508 hOldObj = SelectObject (hMemDC, p_board->hLedsBMP);
509
510 for( i = 0; i < 3; i++ ) {
511 BitBlt( hdc,
512 i * LED_WIDTH + x,
513 y,
514 LED_WIDTH,
516 hMemDC,
517 0,
518 led[i] * LED_HEIGHT,
519 SRCCOPY);
520 }
521
522 SelectObject( hMemDC, hOldObj );
523}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint GLuint GLsizei count
Definition: gl.h:1545
static unsigned int number
Definition: dsound.c:1479

Referenced by DrawBoard().

◆ DrawMine()

static void DrawMine ( HDC  hdc,
HDC  hMemDC,
BOARD p_board,
unsigned  col,
unsigned  row,
BOOL  IsPressed 
)
static

Definition at line 392 of file main.c.

393{
395
396 if( col == 0 || col > p_board->cols || row == 0 || row > p_board->rows )
397 return;
398
399 if( p_board->status == GAMEOVER ) {
400 if( p_board->box[col][row].IsMine ) {
401 switch( p_board->box[col][row].FlagType ) {
402 case FLAG:
404 break;
405 case COMPLETE:
407 break;
408 case QUESTION:
409 /* fall through */
410 case NORMAL:
412 }
413 } else {
414 switch( p_board->box[col][row].FlagType ) {
415 case QUESTION:
417 break;
418 case FLAG:
420 break;
421 case NORMAL:
422 offset = BOX_BMP;
423 break;
424 case COMPLETE:
425 /* Do nothing */
426 break;
427 default:
428 WINE_TRACE("Unknown FlagType during game over in DrawMine\n");
429 break;
430 }
431 }
432 } else { /* WAITING or PLAYING */
433 switch( p_board->box[col][row].FlagType ) {
434 case QUESTION:
435 if( !IsPressed )
437 else
439 break;
440 case FLAG:
442 break;
443 case NORMAL:
444 if( !IsPressed )
445 offset = BOX_BMP;
446 else
448 break;
449 case COMPLETE:
450 /* Do nothing */
451 break;
452 default:
453 WINE_TRACE("Unknown FlagType while playing in DrawMine\n");
454 break;
455 }
456 }
457
458 if( p_board->box[col][row].FlagType == COMPLETE
459 && !p_board->box[col][row].IsMine )
460 offset = (MINEBMP_OFFSET) p_board->box[col][row].NumMines;
461
462 BitBlt( hdc,
463 (col - 1) * MINE_WIDTH + p_board->mines_rect.left,
464 (row - 1) * MINE_HEIGHT + p_board->mines_rect.top,
466 hMemDC, 0, offset * MINE_HEIGHT, SRCCOPY );
467}
MINEBMP_OFFSET
Definition: main.h:63
@ MPRESS_BMP
Definition: main.h:64
@ QUESTION_BMP
Definition: main.h:65
@ BOX_BMP
Definition: main.h:65
@ MINE_BMP
Definition: main.h:66
@ WRONG_BMP
Definition: main.h:66
@ EXPLODE_BMP
Definition: main.h:65
@ QPRESS_BMP
Definition: main.h:66
@ FLAG_BMP
Definition: main.h:65
GLintptr offset
Definition: glext.h:5920
#define WINE_TRACE
Definition: debug.h:354

Referenced by DrawMines(), PressBox(), and UnpressBox().

◆ DrawMines()

static void DrawMines ( HDC  hdc,
HDC  hMemDC,
BOARD p_board 
)
static

Definition at line 469 of file main.c.

470{
471 HGDIOBJ hOldObj;
472 unsigned col, row;
473 hOldObj = SelectObject (hMemDC, p_board->hMinesBMP);
474
475 for( row = 1; row <= p_board->rows; row++ ) {
476 for( col = 1; col <= p_board->cols; col++ ) {
477 DrawMine( hdc, hMemDC, p_board, col, row, FALSE );
478 }
479 }
480 SelectObject( hMemDC, hOldObj );
481}
static void DrawMine(HDC hdc, HDC hMemDC, BOARD *p_board, unsigned col, unsigned row, BOOL IsPressed)
Definition: main.c:392

Referenced by DrawBoard().

◆ InitBoard()

static void InitBoard ( BOARD p_board)
static

Definition at line 140 of file main.c.

141{
142 HMENU hMenu;
143
144 p_board->hMinesBMP = LoadBitmapW( p_board->hInst, MAKEINTRESOURCEW(IDI_MINES));
145 p_board->hFacesBMP = LoadBitmapW( p_board->hInst, MAKEINTRESOURCEW(IDI_FACES));
146 p_board->hLedsBMP = LoadBitmapW( p_board->hInst, MAKEINTRESOURCEW(IDI_LEDS));
147
148 LoadBoard( p_board );
149
150 hMenu = GetMenu( p_board->hWnd );
151 CheckMenuItem( hMenu, IDM_BEGINNER + (unsigned) p_board->difficulty,
152 MF_CHECKED );
153 if( p_board->IsMarkQ )
155 else
157#ifdef __REACTOS__
158 CheckMenuItem(hMenu, IDM_SOUND, p_board->IsSoundEnabled ? MF_CHECKED : MF_UNCHECKED);
159#endif
160 CheckLevel( p_board );
161}
static void LoadBoard(BOARD *p_board)
Definition: main.c:73
void CheckLevel(BOARD *p_board)
Definition: main.c:52
#define IDI_LEDS
Definition: resource.h:62
#define IDM_MARKQ
Definition: resource.h:34
#define IDI_MINES
Definition: resource.h:63
#define IDI_FACES
Definition: resource.h:61
#define IDM_BEGINNER
Definition: resource.h:30
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
DIFFICULTY difficulty
Definition: main.h:103
HINSTANCE hInst
Definition: main.h:78
#define MF_CHECKED
Definition: winuser.h:132
#define MF_UNCHECKED
Definition: winuser.h:204
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2215
HMENU WINAPI GetMenu(_In_ HWND)

Referenced by MainProc().

◆ LoadBoard()

static void LoadBoard ( BOARD p_board)
static

Definition at line 73 of file main.c.

74{
75 DWORD size;
76 DWORD type;
77 HKEY hkey;
79 WCHAR key_name[8];
80 unsigned i;
81
83
84 size = sizeof( p_board->pos.x );
85 if( RegQueryValueExW( hkey, xposW, NULL, &type, (BYTE*) &p_board->pos.x, &size ) )
86 p_board->pos.x = 0;
87
88 size = sizeof( p_board->pos.y );
89 if( RegQueryValueExW( hkey, yposW, NULL, &type, (BYTE*) &p_board->pos.y, &size ) )
90 p_board->pos.y = 0;
91
92 size = sizeof( p_board->rows );
93 if( RegQueryValueExW( hkey, heightW, NULL, &type, (BYTE*) &p_board->rows, &size ) )
94 p_board->rows = BEGINNER_ROWS;
95
96 size = sizeof( p_board->cols );
97 if( RegQueryValueExW( hkey, widthW, NULL, &type, (BYTE*) &p_board->cols, &size ) )
98 p_board->cols = BEGINNER_COLS;
99
100 size = sizeof( p_board->mines );
101 if( RegQueryValueExW( hkey, minesW, NULL, &type, (BYTE*) &p_board->mines, &size ) )
102 p_board->mines = BEGINNER_MINES;
103
104 size = sizeof( p_board->difficulty );
105 if( RegQueryValueExW( hkey, difficultyW, NULL, &type, (BYTE*) &p_board->difficulty, &size ) )
106 p_board->difficulty = BEGINNER;
107
108 size = sizeof( p_board->IsMarkQ );
109 if( RegQueryValueExW( hkey, markW, NULL, &type, (BYTE*) &p_board->IsMarkQ, &size ) )
110 p_board->IsMarkQ = TRUE;
111
112#ifdef __REACTOS__
113 /* WinXP SP3: Enabled when value >= 3, disabled when value < 3 */
114 size = sizeof(p_board->IsSoundEnabled);
115 if (RegQueryValueExW(hkey, L"Sound", NULL, &type, (BYTE*)&p_board->IsSoundEnabled, &size) == ERROR_SUCCESS)
116 p_board->IsSoundEnabled = (p_board->IsSoundEnabled >= 3 ? TRUE : FALSE);
117 else
118 p_board->IsSoundEnabled = FALSE;
119#endif
120
121 for( i = 0; i < 3; i++ ) {
122 wsprintfW( key_name, nameW, i+1 );
123 size = sizeof( data );
124 if( RegQueryValueExW( hkey, key_name, NULL, &type,
125 (LPBYTE) data, &size ) == ERROR_SUCCESS )
126 lstrcpynW( p_board->best_name[i], data, sizeof(p_board->best_name[i])/sizeof(WCHAR) );
127 else
128 LoadStringW( p_board->hInst, IDS_NOBODY, p_board->best_name[i], MAX_PLAYER_NAME_SIZE+1 );
129 }
130
131 for( i = 0; i < 3; i++ ) {
132 wsprintfW( key_name, timeW, i+1 );
133 size = sizeof( p_board->best_time[i] );
134 if( RegQueryValueExW( hkey, key_name, NULL, &type, (BYTE*) &p_board->best_time[i], &size ) )
135 p_board->best_time[i] = 999;
136 }
137 RegCloseKey( hkey );
138}
static const WCHAR minesW[]
Definition: main.c:46
static const WCHAR widthW[]
Definition: main.c:45
static const WCHAR nameW[]
Definition: main.c:49
static const WCHAR difficultyW[]
Definition: main.c:47
static const WCHAR xposW[]
Definition: main.c:42
static const WCHAR yposW[]
Definition: main.c:43
static const WCHAR heightW[]
Definition: main.c:44
static const WCHAR markW[]
Definition: main.c:48
static const WCHAR timeW[]
Definition: main.c:50
#define MAX_PLAYER_NAME_SIZE
Definition: main.h:57
@ BEGINNER
Definition: main.h:69
#define IDS_NOBODY
Definition: resource.h:53
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
#define lstrcpynW
Definition: compat.h:738
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define L(x)
Definition: ntvdm.h:50
DWORD best_time[3]
Definition: main.h:102
WCHAR best_name[3][MAX_PLAYER_NAME_SIZE+1]
Definition: main.h:101
unsigned char * LPBYTE
Definition: typedefs.h:53
#define HKEY_CURRENT_USER
Definition: winreg.h:11
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char BYTE
Definition: xxhash.c:193

Referenced by InitBoard().

◆ MainProc()

static LRESULT WINAPI MainProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 897 of file main.c.

898{
899 HDC hdc;
900 PAINTSTRUCT ps;
901 HMENU hMenu;
902 static BOARD board;
903
904 switch( msg ) {
905 case WM_CREATE:
906 board.hInst = ((LPCREATESTRUCTW) lParam)->hInstance;
907 board.hWnd = hWnd;
908 InitBoard( &board );
909 CreateBoard( &board );
910 return 0;
911
912 case WM_PAINT:
913 {
914 HDC hMemDC;
915
916 WINE_TRACE("WM_PAINT\n");
917 hdc = BeginPaint( hWnd, &ps );
918 hMemDC = CreateCompatibleDC( hdc );
919
920 DrawBoard( hdc, hMemDC, &ps, &board );
921
922 DeleteDC( hMemDC );
923 EndPaint( hWnd, &ps );
924
925 return 0;
926 }
927
928 case WM_MOVE:
929 WINE_TRACE("WM_MOVE\n");
930 board.pos.x = (short)LOWORD(lParam);
931 board.pos.y = (short)HIWORD(lParam);
932 return 0;
933
934 case WM_DESTROY:
935 SaveBoard( &board );
936 DestroyBoard( &board );
937 PostQuitMessage( 0 );
938 return 0;
939
940 case WM_TIMER:
941 if( board.status == PLAYING ) {
942 board.time++;
943 RedrawWindow( hWnd, &board.timer_rect, 0,
945 }
946 return 0;
947
948 case WM_LBUTTONDOWN:
949 WINE_TRACE("WM_LBUTTONDOWN\n");
950 if( wParam & ( MK_RBUTTON | MK_SHIFT ) )
952 TestBoard( hWnd, &board, (short)LOWORD(lParam), (short)HIWORD(lParam), msg );
953 SetCapture( hWnd );
954 return 0;
955
956 case WM_LBUTTONUP:
957 WINE_TRACE("WM_LBUTTONUP\n");
958 if( wParam & ( MK_RBUTTON | MK_SHIFT ) )
960 TestBoard( hWnd, &board, (short)LOWORD(lParam), (short)HIWORD(lParam), msg );
962 return 0;
963
964 case WM_RBUTTONDOWN:
965 WINE_TRACE("WM_RBUTTONDOWN\n");
966 if( wParam & MK_LBUTTON ) {
967 board.press.x = 0;
968 board.press.y = 0;
970 }
971 TestBoard( hWnd, &board, (short)LOWORD(lParam), (short)HIWORD(lParam), msg );
972 return 0;
973
974 case WM_RBUTTONUP:
975 WINE_TRACE("WM_RBUTTONUP\n");
976 if( wParam & MK_LBUTTON )
978 TestBoard( hWnd, &board, (short)LOWORD(lParam), (short)HIWORD(lParam), msg );
979 return 0;
980
981 case WM_MBUTTONDOWN:
982 WINE_TRACE("WM_MBUTTONDOWN\n");
983 TestBoard( hWnd, &board, (short)LOWORD(lParam), (short)HIWORD(lParam), msg );
984 return 0;
985
986 case WM_MBUTTONUP:
987 WINE_TRACE("WM_MBUTTONUP\n");
988 TestBoard( hWnd, &board, (short)LOWORD(lParam), (short)HIWORD(lParam), msg );
989 return 0;
990
991 case WM_MOUSEMOVE:
992 {
993 if( ( wParam & MK_MBUTTON ) ||
994 ( ( wParam & MK_LBUTTON ) && ( wParam & MK_RBUTTON ) ) ) {
996 }
997 else if( wParam & MK_LBUTTON ) {
999 }
1000 else {
1001 return 0;
1002 }
1003
1004 TestBoard( hWnd, &board, (short)LOWORD(lParam), (short)HIWORD(lParam), msg );
1005
1006 return 0;
1007 }
1008
1009 case WM_COMMAND:
1010 switch(LOWORD(wParam)) {
1011 case IDM_NEW:
1012 CreateBoard( &board );
1013 return 0;
1014
1015 case IDM_MARKQ:
1016 hMenu = GetMenu( hWnd );
1017 board.IsMarkQ = !board.IsMarkQ;
1018 if( board.IsMarkQ )
1020 else
1022 return 0;
1023
1024#ifdef __REACTOS__
1025 case IDM_SOUND:
1026 hMenu = GetMenu(hWnd);
1027 board.IsSoundEnabled = !board.IsSoundEnabled;
1028 CheckMenuItem(hMenu, IDM_SOUND, board.IsSoundEnabled ? MF_CHECKED : MF_UNCHECKED);
1029 return 0;
1030#endif
1031
1032 case IDM_BEGINNER:
1033 SetDifficulty( &board, BEGINNER );
1034 CreateBoard( &board );
1035 return 0;
1036
1037 case IDM_ADVANCED:
1038 SetDifficulty( &board, ADVANCED );
1039 CreateBoard( &board );
1040 return 0;
1041
1042 case IDM_EXPERT:
1043 SetDifficulty( &board, EXPERT );
1044 CreateBoard( &board );
1045 return 0;
1046
1047 case IDM_CUSTOM:
1048 SetDifficulty( &board, CUSTOM );
1049 CreateBoard( &board );
1050 return 0;
1051
1052 case IDM_EXIT:
1053 SendMessageW( hWnd, WM_CLOSE, 0, 0);
1054 return 0;
1055
1056 case IDM_TIMES:
1058 TimesDlgProc, (LPARAM) &board);
1059 return 0;
1060
1061 case IDM_ABOUT:
1062 {
1063 WCHAR appname[256], other[256];
1064 LoadStringW( board.hInst, IDS_APPNAME, appname, sizeof(appname)/sizeof(WCHAR) );
1065 LoadStringW( board.hInst, IDS_ABOUT, other, sizeof(other)/sizeof(WCHAR) );
1066 ShellAboutW( hWnd, appname, other,
1068 return 0;
1069 }
1070 default:
1071 WINE_TRACE("Unknown WM_COMMAND command message received\n");
1072 break;
1073 }
1074 }
1075 return DefWindowProcW( hWnd, msg, wParam, lParam );
1076}
#define msg(x)
Definition: auth_time.c:54
#define IDS_ABOUT
Definition: resource.h:29
HWND hWnd
Definition: settings.c:17
INT_PTR CALLBACK TimesDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:83
static void SetDifficulty(BOARD *p_board, DIFFICULTY difficulty)
Definition: main.c:209
static void TestBoard(HWND hWnd, BOARD *p_board, int x, int y, int msg)
Definition: main.c:843
static void SaveBoard(BOARD *p_board)
Definition: main.c:163
static void DrawBoard(HDC hdc, HDC hMemDC, PAINTSTRUCT *ps, BOARD *p_board)
Definition: main.c:543
static void InitBoard(BOARD *p_board)
Definition: main.c:140
static void CreateBoard(BOARD *p_board)
Definition: main.c:276
static void DestroyBoard(BOARD *p_board)
Definition: main.c:202
@ PLAYING
Definition: main.h:61
@ ADVANCED
Definition: main.h:69
@ EXPERT
Definition: main.h:69
@ CUSTOM
Definition: main.h:69
#define IDM_ABOUT
Definition: resource.h:29
#define IDM_CUSTOM
Definition: resource.h:33
#define IDM_EXIT
Definition: resource.h:27
#define IDS_APPNAME
Definition: resource.h:52
#define IDM_ADVANCED
Definition: resource.h:31
#define IDM_TIMES
Definition: resource.h:28
#define IDI_WINEMINE
Definition: resource.h:60
#define IDM_EXPERT
Definition: resource.h:32
#define DLG_TIMES
Definition: resource.h:65
#define IDM_NEW
Definition: resource.h:26
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
static HDC
Definition: imagelist.c:88
int other
Definition: msacm.c:1376
#define LOWORD(l)
Definition: pedump.c:82
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
Definition: main.h:72
POINT press
Definition: main.h:105
#define HIWORD(l)
Definition: typedefs.h:247
LONG_PTR LPARAM
Definition: windef.h:208
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI DeleteDC(_In_ HDC)
#define WM_PAINT
Definition: winuser.h:1623
HWND WINAPI SetCapture(_In_ HWND hWnd)
#define MK_RBUTTON
Definition: winuser.h:2371
#define MK_SHIFT
Definition: winuser.h:2372
#define WM_CLOSE
Definition: winuser.h:1624
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IMAGE_ICON
Definition: winuser.h:212
#define WM_CREATE
Definition: winuser.h:1611
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_COMMAND
Definition: winuser.h:1743
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2255
#define WM_RBUTTONUP
Definition: winuser.h:1783
#define WM_MOUSEMOVE
Definition: winuser.h:1778
#define WM_LBUTTONDOWN
Definition: winuser.h:1779
#define WM_RBUTTONDOWN
Definition: winuser.h:1782
#define MK_MBUTTON
Definition: winuser.h:2374
#define WM_TIMER
Definition: winuser.h:1745
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define LR_SHARED
Definition: winuser.h:1103
#define WM_LBUTTONUP
Definition: winuser.h:1780
#define WM_MOVE
Definition: winuser.h:1613
#define MK_LBUTTON
Definition: winuser.h:2370
#define WM_DESTROY
Definition: winuser.h:1612
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define WM_MBUTTONUP
Definition: winuser.h:1786
struct tagCREATESTRUCTW * LPCREATESTRUCTW
#define WM_MBUTTONDOWN
Definition: winuser.h:1785
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)

Referenced by wWinMain().

◆ MoveOnScreen()

static void MoveOnScreen ( RECT rect)
static

Definition at line 260 of file main.c.

261{
262 HMONITOR hMonitor;
264
265 /* find the nearest monitor ... */
266 hMonitor = MonitorFromRect(rect, MONITOR_DEFAULTTONEAREST);
267
268 /* ... and move it into the work area (ie excluding task bar)*/
269 mi.cbSize = sizeof(mi);
270 GetMonitorInfoW(hMonitor, &mi);
271
272 ShiftBetween(&rect->left, &rect->right, mi.rcWork.left, mi.rcWork.right);
273 ShiftBetween(&rect->top, &rect->bottom, mi.rcWork.top, mi.rcWork.bottom);
274}
static void ShiftBetween(LONG *x, LONG *y, LONG a, LONG b)
Definition: main.c:248
HMONITOR WINAPI MonitorFromRect(LPCRECT, DWORD)
& rect
Definition: startmenu.cpp:1413
DWORD cbSize
Definition: winuser.h:3787
static MONITORINFO mi
Definition: win.c:7338
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)

Referenced by CreateBoard().

◆ PlaceMines()

static void PlaceMines ( BOARD p_board,
int  selected_col,
int  selected_row 
)
static

Definition at line 351 of file main.c.

352{
353 int i, j;
354 unsigned col, row;
355
356 srand( (unsigned) time( NULL ) );
357
358 /* Temporarily place a mine at the selected box until all the other
359 * mines are placed, this avoids checking in the mine creation loop. */
360 p_board->box[selected_col][selected_row].IsMine = TRUE;
361
362 /* create mines */
363 i = 0;
364 while( (unsigned) i < p_board->mines ) {
365 col = rand() % p_board->cols + 1;
366 row = rand() % p_board->rows + 1;
367
368 if( !p_board->box[col][row].IsMine ) {
369 i++;
370 p_board->box[col][row].IsMine = TRUE;
371 }
372 }
373
374 /* Remove temporarily placed mine for selected box */
375 p_board->box[selected_col][selected_row].IsMine = FALSE;
376
377 /*
378 * Now we label the remaining boxes with the
379 * number of mines surrounding them.
380 */
381 for( col = 1; col < p_board->cols + 1; col++ )
382 for( row = 1; row < p_board->rows + 1; row++ ) {
383 for( i = -1; i <= 1; i++ )
384 for( j = -1; j <= 1; j++ ) {
385 if( p_board->box[col + i][row + j].IsMine ) {
386 p_board->box[col][row].NumMines++ ;
387 }
388 }
389 }
390}
void __cdecl srand(_In_ unsigned int _Seed)
_Check_return_ int __cdecl rand(void)
Definition: rand.c:10
__u16 time
Definition: mkdosfs.c:8

Referenced by TestMines().

◆ PressBox()

static void PressBox ( BOARD p_board,
unsigned  col,
unsigned  row 
)
static

Definition at line 634 of file main.c.

635{
636 HDC hdc;
637 HGDIOBJ hOldObj;
638 HDC hMemDC;
639
640 hdc = GetDC( p_board->hWnd );
641 hMemDC = CreateCompatibleDC( hdc );
642 hOldObj = SelectObject (hMemDC, p_board->hMinesBMP);
643
644 DrawMine( hdc, hMemDC, p_board, col, row, TRUE );
645
646 SelectObject( hMemDC, hOldObj );
647 DeleteDC( hMemDC );
648 ReleaseDC( p_board->hWnd, hdc );
649}
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)

Referenced by PressBoxes(), and TestMines().

◆ PressBoxes()

static void PressBoxes ( BOARD p_board,
unsigned  col,
unsigned  row 
)
static

Definition at line 652 of file main.c.

653{
654 int i, j;
655
656 for( i = -1; i <= 1; i++ )
657 for( j = -1; j <= 1; j++ ) {
658 p_board->box[col + i][row + j].IsPressed = TRUE;
659 PressBox( p_board, col + i, row + j );
660 }
661
662 for( i = -1; i <= 1; i++ )
663 for( j = -1; j <= 1; j++ ) {
664 if( !p_board->box[p_board->press.x + i][p_board->press.y + j].IsPressed )
665 UnpressBox( p_board, p_board->press.x + i, p_board->press.y + j );
666 }
667
668 for( i = -1; i <= 1; i++ )
669 for( j = -1; j <= 1; j++ ) {
670 p_board->box[col + i][row + j].IsPressed = FALSE;
671 PressBox( p_board, col + i, row + j );
672 }
673
674 p_board->press.x = col;
675 p_board->press.y = row;
676}
static void PressBox(BOARD *p_board, unsigned col, unsigned row)
Definition: main.c:634
static void UnpressBox(BOARD *p_board, unsigned col, unsigned row)
Definition: main.c:605

Referenced by TestMines().

◆ SaveBoard()

static void SaveBoard ( BOARD p_board)
static

Definition at line 163 of file main.c.

164{
165 HKEY hkey;
166 unsigned i;
168 WCHAR key_name[8];
169
171 0, NULL,
173 &hkey, NULL ) != ERROR_SUCCESS)
174 return;
175
176 RegSetValueExW( hkey, xposW, 0, REG_DWORD, (LPBYTE) &p_board->pos.x, sizeof(p_board->pos.x) );
177 RegSetValueExW( hkey, yposW, 0, REG_DWORD, (LPBYTE) &p_board->pos.y, sizeof(p_board->pos.y) );
178 RegSetValueExW( hkey, difficultyW, 0, REG_DWORD, (LPBYTE) &p_board->difficulty, sizeof(p_board->difficulty) );
179 RegSetValueExW( hkey, heightW, 0, REG_DWORD, (LPBYTE) &p_board->rows, sizeof(p_board->rows) );
180 RegSetValueExW( hkey, widthW, 0, REG_DWORD, (LPBYTE) &p_board->cols, sizeof(p_board->cols) );
181 RegSetValueExW( hkey, minesW, 0, REG_DWORD, (LPBYTE) &p_board->mines, sizeof(p_board->mines) );
182 RegSetValueExW( hkey, markW, 0, REG_DWORD, (LPBYTE) &p_board->IsMarkQ, sizeof(p_board->IsMarkQ) );
183#ifdef __REACTOS__
184 /* WinXP SP3: Set to 3 when enabled, set to 0 when disabled */
185 p_board->IsSoundEnabled = (p_board->IsSoundEnabled ? 3 : 0);
186 RegSetValueExW(hkey, L"Sound", 0, REG_DWORD, (LPBYTE)&p_board->IsSoundEnabled, sizeof(p_board->IsSoundEnabled));
187#endif
188
189 for( i = 0; i < 3; i++ ) {
190 wsprintfW( key_name, nameW, i+1 );
191 lstrcpynW( data, p_board->best_name[i], sizeof(data)/sizeof(WCHAR) );
192 RegSetValueExW( hkey, key_name, 0, REG_SZ, (LPBYTE) data, (lstrlenW(data)+1) * sizeof(WCHAR) );
193 }
194
195 for( i = 0; i < 3; i++ ) {
196 wsprintfW( key_name, timeW, i+1 );
197 RegSetValueExW( hkey, key_name, 0, REG_DWORD, (LPBYTE) &p_board->best_time[i], sizeof(p_board->best_time[i]) );
198 }
199 RegCloseKey( hkey );
200}
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
#define lstrlenW
Definition: compat.h:750
#define REG_SZ
Definition: layer.c:22
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
#define REG_DWORD
Definition: sdbapi.c:596

Referenced by MainProc().

◆ SetDifficulty()

static void SetDifficulty ( BOARD p_board,
DIFFICULTY  difficulty 
)
static

Definition at line 209 of file main.c.

210{
211 HMENU hMenu;
212
213 if ( difficulty == CUSTOM )
214 if (DialogBoxParamW( p_board->hInst, MAKEINTRESOURCEW(DLG_CUSTOM), p_board->hWnd,
215 CustomDlgProc, (LPARAM) p_board) != 0)
216 return;
217
218 hMenu = GetMenu( p_board->hWnd );
219 CheckMenuItem( hMenu, IDM_BEGINNER + p_board->difficulty, MF_UNCHECKED );
220 p_board->difficulty = difficulty;
221 CheckMenuItem( hMenu, IDM_BEGINNER + difficulty, MF_CHECKED );
222
223 switch( difficulty ) {
224 case BEGINNER:
225 p_board->cols = BEGINNER_COLS;
226 p_board->rows = BEGINNER_ROWS;
227 p_board->mines = BEGINNER_MINES;
228 break;
229
230 case ADVANCED:
231 p_board->cols = ADVANCED_COLS;
232 p_board->rows = ADVANCED_ROWS;
233 p_board->mines = ADVANCED_MINES;
234 break;
235
236 case EXPERT:
237 p_board->cols = EXPERT_COLS;
238 p_board->rows = EXPERT_ROWS;
239
240 p_board->mines = EXPERT_MINES;
241 break;
242
243 case CUSTOM:
244 break;
245 }
246}
INT_PTR CALLBACK CustomDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:23
#define ADVANCED_MINES
Definition: main.h:34
#define ADVANCED_ROWS
Definition: main.h:36
#define ADVANCED_COLS
Definition: main.h:35
#define EXPERT_COLS
Definition: main.h:39
#define EXPERT_MINES
Definition: main.h:38
#define EXPERT_ROWS
Definition: main.h:40
#define DLG_CUSTOM
Definition: resource.h:67

Referenced by MainProc().

◆ ShiftBetween()

static void ShiftBetween ( LONG x,
LONG y,
LONG  a,
LONG  b 
)
static

Definition at line 248 of file main.c.

249{
250 if (*x < a) {
251 *y += a - *x;
252 *x = a;
253 }
254 else if (*y > b) {
255 *x -= *y - b;
256 *y = b;
257 }
258}
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define a
Definition: ke_i.h:78
#define b
Definition: ke_i.h:79

Referenced by MoveOnScreen().

◆ TestBoard()

static void TestBoard ( HWND  hWnd,
BOARD p_board,
int  x,
int  y,
int  msg 
)
static

Definition at line 843 of file main.c.

844{
845 POINT pt;
846 unsigned col,row;
847
848 pt.x = x;
849 pt.y = y;
850
851 if( PtInRect( &p_board->mines_rect, pt ) && p_board->status != GAMEOVER
852 && p_board->status != WON )
853 TestMines( p_board, pt, msg );
854 else {
855 UnpressBoxes( p_board,
856 p_board->press.x,
857 p_board->press.y );
858 p_board->press.x = 0;
859 p_board->press.y = 0;
860 }
861
862 if( p_board->boxes_left == 0 ) {
863#ifdef __REACTOS__
864 if (p_board->status != WON)
865 PlaySoundEffect(p_board, IDW_WIN);
866#endif
867 p_board->status = WON;
868
869 if (p_board->num_flags < p_board->mines) {
870 for( row = 1; row <= p_board->rows; row++ ) {
871 for( col = 1; col <= p_board->cols; col++ ) {
872 if (p_board->box[col][row].IsMine && p_board->box[col][row].FlagType != FLAG)
873 p_board->box[col][row].FlagType = FLAG;
874 }
875 }
876
877 p_board->num_flags = p_board->mines;
878
879 RedrawWindow( p_board->hWnd, NULL, 0,
881 }
882
883 if( p_board->difficulty != CUSTOM &&
884 p_board->time < p_board->best_time[p_board->difficulty] ) {
885 p_board->best_time[p_board->difficulty] = p_board->time;
886
888 CongratsDlgProc, (LPARAM) p_board);
890 TimesDlgProc, (LPARAM) p_board);
891 }
892 }
893 TestFace( p_board, pt, msg );
894}
INT_PTR CALLBACK CongratsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:55
static void TestMines(BOARD *p_board, POINT pt, int msg)
Definition: main.c:749
static void TestFace(BOARD *p_board, POINT pt, int msg)
Definition: main.c:818
static void UnpressBoxes(BOARD *p_board, unsigned col, unsigned row)
Definition: main.c:623
@ WON
Definition: main.h:61
#define DLG_CONGRATS
Definition: resource.h:66
#define pt(x, y)
Definition: drawing.c:79
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)

Referenced by MainProc().

◆ TestFace()

static void TestFace ( BOARD p_board,
POINT  pt,
int  msg 
)
static

Definition at line 818 of file main.c.

819{
820 if( p_board->status == PLAYING || p_board->status == WAITING ) {
821 if( msg == WM_LBUTTONDOWN || msg == WM_MBUTTONDOWN )
822 p_board->face_bmp = OOH_BMP;
823 else p_board->face_bmp = SMILE_BMP;
824 }
825 else if( p_board->status == GAMEOVER )
826 p_board->face_bmp = DEAD_BMP;
827 else if( p_board->status == WON )
828 p_board->face_bmp = COOL_BMP;
829
830 if( PtInRect( &p_board->face_rect, pt ) ) {
831 if( msg == WM_LBUTTONDOWN )
832 p_board->face_bmp = SPRESS_BMP;
833
834 if( msg == WM_LBUTTONUP )
835 CreateBoard( p_board );
836 }
837
838 RedrawWindow( p_board->hWnd, &p_board->face_rect, 0,
840}
@ SPRESS_BMP
Definition: main.h:59
@ OOH_BMP
Definition: main.h:59
@ COOL_BMP
Definition: main.h:59

Referenced by TestBoard().

◆ TestMines()

static void TestMines ( BOARD p_board,
POINT  pt,
int  msg 
)
static

Definition at line 749 of file main.c.

750{
751 BOOL draw = TRUE;
752 int col, row;
753
754 col = (pt.x - p_board->mines_rect.left) / MINE_WIDTH + 1;
755 row = (pt.y - p_board->mines_rect.top ) / MINE_HEIGHT + 1;
756
757 switch ( msg ) {
758 case WM_LBUTTONDOWN:
759 if( p_board->press.x != col || p_board->press.y != row ) {
760 UnpressBox( p_board,
761 p_board->press.x, p_board->press.y );
762 p_board->press.x = col;
763 p_board->press.y = row;
764 PressBox( p_board, col, row );
765 }
766 draw = FALSE;
767 break;
768
769 case WM_LBUTTONUP:
770 if( p_board->press.x != col || p_board->press.y != row )
771 UnpressBox( p_board,
772 p_board->press.x, p_board->press.y );
773 p_board->press.x = 0;
774 p_board->press.y = 0;
775 if( p_board->box[col][row].FlagType != FLAG
776 && p_board->status != PLAYING )
777 {
778 p_board->status = PLAYING;
779 PlaceMines( p_board, col, row );
780 }
781#ifdef __REACTOS__
782 CompleteBox( p_board, col, row, TRUE );
783#else
784 CompleteBox( p_board, col, row );
785#endif
786 break;
787
788 case WM_MBUTTONDOWN:
789 PressBoxes( p_board, col, row );
790 draw = FALSE;
791 break;
792
793 case WM_MBUTTONUP:
794 if( p_board->press.x != col || p_board->press.y != row )
795 UnpressBoxes( p_board,
796 p_board->press.x, p_board->press.y );
797 p_board->press.x = 0;
798 p_board->press.y = 0;
799 CompleteBoxes( p_board, col, row );
800 break;
801
802 case WM_RBUTTONDOWN:
803 AddFlag( p_board, col, row );
804 break;
805 default:
806 WINE_TRACE("Unknown message type received in TestMines\n");
807 break;
808 }
809
810 if( draw )
811 {
812 RedrawWindow( p_board->hWnd, NULL, 0,
814 }
815}
static void CompleteBoxes(BOARD *p_board, unsigned col, unsigned row)
Definition: main.c:722
static void PressBoxes(BOARD *p_board, unsigned col, unsigned row)
Definition: main.c:652
static void PlaceMines(BOARD *p_board, int selected_col, int selected_row)
Definition: main.c:351
static void AddFlag(BOARD *p_board, unsigned col, unsigned row)
Definition: main.c:574
unsigned int BOOL
Definition: ntddk_ex.h:94

Referenced by TestBoard().

◆ UnpressBox()

static void UnpressBox ( BOARD p_board,
unsigned  col,
unsigned  row 
)
static

Definition at line 605 of file main.c.

606{
607 HDC hdc;
608 HGDIOBJ hOldObj;
609 HDC hMemDC;
610
611 hdc = GetDC( p_board->hWnd );
612 hMemDC = CreateCompatibleDC( hdc );
613 hOldObj = SelectObject( hMemDC, p_board->hMinesBMP );
614
615 DrawMine( hdc, hMemDC, p_board, col, row, FALSE );
616
617 SelectObject( hMemDC, hOldObj );
618 DeleteDC( hMemDC );
619 ReleaseDC( p_board->hWnd, hdc );
620}

Referenced by PressBoxes(), TestMines(), and UnpressBoxes().

◆ UnpressBoxes()

static void UnpressBoxes ( BOARD p_board,
unsigned  col,
unsigned  row 
)
static

Definition at line 623 of file main.c.

624{
625 int i, j;
626
627 for( i = -1; i <= 1; i++ )
628 for( j = -1; j <= 1; j++ ) {
629 UnpressBox( p_board, col + i, row + j );
630 }
631}

Referenced by TestBoard(), and TestMines().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( winemine  )

◆ wWinMain()

int WINAPI wWinMain ( HINSTANCE  hInstance,
HINSTANCE  hPrevInstance,
LPWSTR  lpCmdLine,
int  nShowCmd 
)

This file has no copyright assigned and is placed in the Public Domain. This file is part of the w64 mingw-runtime package. No warranty is given; refer to the file DISCLAIMER.PD within this package.

Definition at line 1078 of file main.c.

1079{
1080 MSG msg;
1081 WNDCLASSEXW wc;
1082 HWND hWnd;
1083 HACCEL haccel;
1084 WCHAR appname[20];
1085
1086 LoadStringW( hInst, IDS_APPNAME, appname, sizeof(appname)/sizeof(WCHAR));
1087
1088 wc.cbSize = sizeof(wc);
1089 wc.style = 0;
1090 wc.lpfnWndProc = MainProc;
1091 wc.cbClsExtra = 0;
1092 wc.cbWndExtra = 0;
1093 wc.hInstance = hInst;
1095#ifndef __REACTOS__
1097#else
1099#endif
1100 wc.hbrBackground = GetSysColorBrush(COLOR_BTNFACE); //MOD for ROS
1102 wc.lpszClassName = appname;
1105
1106 if (!RegisterClassExW(&wc)) ExitProcess(1);
1107 hWnd = CreateWindowW( appname, appname,
1108 wnd_style,
1110 0, 0, hInst, NULL );
1111
1112 if (!hWnd) ExitProcess(1);
1113
1114 ShowWindow( hWnd, cmdshow );
1115 UpdateWindow( hWnd );
1116
1118 SetTimer( hWnd, ID_TIMER, 1000, NULL );
1119
1120 while( GetMessageW(&msg, 0, 0, 0) ) {
1121 if (!TranslateAcceleratorW( hWnd, haccel, &msg ))
1123
1125 }
1126 return msg.wParam;
1127}
static LRESULT WINAPI MainProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: main.c:897
#define IDM_WINEMINE
Definition: resource.h:58
#define ID_TIMER
Definition: resource.h:23
#define IDA_WINEMINE
Definition: resource.h:56
VOID WINAPI ExitProcess(IN UINT uExitCode)
Definition: proc.c:1487
HINSTANCE hInst
Definition: dxdiag.c:13
LPCWSTR lpszClassName
Definition: winuser.h:3229
LPCWSTR lpszMenuName
Definition: winuser.h:3228
HBRUSH hbrBackground
Definition: winuser.h:3227
WNDPROC lpfnWndProc
Definition: winuser.h:3221
UINT cbSize
Definition: winuser.h:3219
int cbWndExtra
Definition: winuser.h:3223
HCURSOR hCursor
Definition: winuser.h:3226
HICON hIconSm
Definition: winuser.h:3230
HINSTANCE hInstance
Definition: winuser.h:3224
UINT style
Definition: winuser.h:3220
int cbClsExtra
Definition: winuser.h:3222
HICON hIcon
Definition: winuser.h:3225
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define IDC_ARROW
Definition: winuser.h:687
#define SM_CYSMICON
Definition: winuser.h:1016
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2157
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define IDI_APPLICATION
Definition: winuser.h:704
#define SM_CXSMICON
Definition: winuser.h:1015
BOOL WINAPI UpdateWindow(_In_ HWND)
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4319
#define CW_USEDEFAULT
Definition: winuser.h:225
HACCEL WINAPI LoadAcceleratorsW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
int WINAPI TranslateAcceleratorW(_In_ HWND, _In_ HACCEL, _In_ LPMSG)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2127
int WINAPI GetSystemMetrics(_In_ int)
#define COLOR_BTNFACE
Definition: winuser.h:931
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Variable Documentation

◆ difficultyW

const WCHAR difficultyW[] = {'D','i','f','f','i','c','u','l','t','y',0}
static

Definition at line 47 of file main.c.

Referenced by LoadBoard(), and SaveBoard().

◆ heightW

const WCHAR heightW[] = {'H','e','i','g','h','t',0}
static

Definition at line 44 of file main.c.

Referenced by LoadBoard(), and SaveBoard().

◆ markW

const WCHAR markW[] = {'M','a','r','k',0}
static

Definition at line 48 of file main.c.

Referenced by LoadBoard(), and SaveBoard().

◆ minesW

const WCHAR minesW[] = {'M','i','n','e','s',0}
static

Definition at line 46 of file main.c.

Referenced by LoadBoard(), and SaveBoard().

◆ nameW

const WCHAR nameW[] = {'N','a','m','e','%','u',0}
static

Definition at line 49 of file main.c.

Referenced by _test_file_name(), AddMonitorA(), AddPortA(), AddPortExA(), AddPrinterDriverExA(), AddPrintProvidorA(), AtlAxCreateDialogA(), AtlAxDialogBoxA(), AvSetMmThreadCharacteristicsA(), ConfigurePortA(), create_classes_key(), create_database_suminfo(), create_database_wordcount(), create_file_test(), create_listview_controlW(), create_parent_window(), create_registry_key(), create_storage(), CredIsMarshaledCredentialA(), CryptAcquireContextW(), CryptGetDefaultProviderW(), CryptSetProviderExW(), delete_file_test(), DeleteMonitorA(), DeletePortA(), DnsValidateName_A(), DnsValidateName_UTF8(), drive_get_FileSystem(), drive_get_VolumeName(), EnumMonitorsA(), EnumPortsA(), EnumPrintProcessorsA(), EnumResourceLanguagesA(), EnumResourceLanguagesW(), filedlg_collect_places_pidls(), fill_processor_information(), fill_props(), find_installed_ports(), find_resourceA(), find_resourceW(), get_manifest_in_associated_manifest(), get_manifest_in_module(), get_nt_pathW(), get_object_dll_path(), get_registry_locale_info(), GetPrinterDriverDirectoryA(), GetTextFaceA(), helper_createpackage(), HTMLFormElement_get_dispid(), HTMLMetaElement_get_name(), IntSetupDiSetDeviceRegistryPropertyAW(), is_elem_name(), lineGetCountryW(), LoadBoard(), LOCALE_InitRegistry(), locale_update_registry(), lookup_assembly(), MCIWndProc(), MsiBeginTransactionA(), MsiGetPropertyA(), open_classes_key(), open_file_test(), parse_assembly(), parse_files(), PdhLookupPerfIndexByNameA(), PSetupEnumMonitor(), query_typelib_path(), RegQueryValueExA(), RtlCreateActivationContext(), SaveBoard(), SetupDiGetDeviceRegistryPropertyW(), SetupGetFileCompressionInfoExA(), SetupOpenInfFileA(), SetUserGeoID(), SymAddSymbol(), symt_enum_locals_helper(), symt_enum_module(), symt_get_nameW(), tally_test_file(), test_actctx(), test_button_class(), test_ClosePort(), test_comctl32_class(), test_CreateTextFile(), test_CreateTypeLib(), test_DialogBoxParam(), test_dispatch(), test_ExtractIcon(), test_font_events_disp(), test_GetComputerName(), test_GetComputerNameExW(), test_interface_identifier_conversion(), test_junction_points(), test_legacy_filter(), test_mxwriter_dtd(), test_NtCreateFile(), test_OpenPort(), test_PathYetAnotherMakeUniqueName(), test_put_dataType(), test_query_attribute_information_file(), test_query_volume_information_file(), test_Read(), test_ReadAll(), test_readonly(), test_RtlDosPathNameToNtPathName_U_WithStatus(), test_SetDocString(), test_SetFuncAndParamNames(), test_SetVarHelpContext(), test_SHParseDisplayName(), test_sip(), test_Win32_Baseboard(), test_Win32_Bios(), test_Win32_ComputerSystem(), test_Win32_ComputerSystemProduct(), test_Win32_DisplayControllerConfiguration(), test_Win32_OperatingSystem(), test_Win32_Processor(), test_Win32_SystemEnclosure(), test_WriteDocType(), test_WriteLine(), test_WTSEnumerateProcessesW(), testGetComputerObjectNameW(), testGetUserNameExW(), testTDA(), ValidateShim(), VBSAXAttributes_getLocalName(), wave_in_test_device(), wave_out_test_device(), and write_doctype().

◆ registry_key

Initial value:
= {'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\',
'W','i','n','M','i','n','e',0}

Definition at line 38 of file main.c.

◆ timeW

const WCHAR timeW[] = {'T','i','m','e','%','u',0}
static

Definition at line 50 of file main.c.

Referenced by LoadBoard(), and SaveBoard().

◆ widthW

const WCHAR widthW[] = {'W','i','d','t','h',0}
static

Definition at line 45 of file main.c.

Referenced by LoadBoard(), and SaveBoard().

◆ wnd_style

Definition at line 37 of file main.c.

Referenced by CreateBoard(), and wWinMain().

◆ xposW

const WCHAR xposW[] = {'X','p','o','s',0}
static

Definition at line 42 of file main.c.

Referenced by LoadBoard(), and SaveBoard().

◆ yposW

const WCHAR yposW[] = {'Y','p','o','s',0}
static

Definition at line 43 of file main.c.

Referenced by LoadBoard(), and SaveBoard().