dbghelp: Use wine_dll_enum_load_path to search the dll load path.
[wine/wine-kai.git] / programs / winemine / dialog.c
blobc517162614027b9a0aefbfe305db320eea71323f
1 /*
2 * WineMine (dialog.c)
4 * Copyright 2000 Joshua Thielen
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #define WIN32_LEAN_AND_MEAN
23 #include <windows.h>
24 #include "main.h"
25 #include "dialog.h"
26 #include "resource.h"
28 BOOL CALLBACK CustomDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
30 BOOL IsRet;
31 static BOARD *p_board;
33 switch( uMsg ) {
34 case WM_INITDIALOG:
35 p_board = (BOARD*) lParam;
36 SetDlgItemInt( hDlg, IDC_EDITROWS, p_board->rows, FALSE );
37 SetDlgItemInt( hDlg, IDC_EDITCOLS, p_board->cols, FALSE );
38 SetDlgItemInt( hDlg, IDC_EDITMINES, p_board->mines, FALSE );
39 return TRUE;
41 case WM_COMMAND:
42 switch( LOWORD( wParam ) ) {
43 case IDOK:
44 p_board->rows = GetDlgItemInt( hDlg, IDC_EDITROWS, &IsRet, FALSE );
45 p_board->cols = GetDlgItemInt( hDlg, IDC_EDITCOLS, &IsRet, FALSE );
46 p_board->mines = GetDlgItemInt( hDlg, IDC_EDITMINES, &IsRet, FALSE );
47 CheckLevel( p_board );
48 EndDialog( hDlg, 0 );
49 return TRUE;
51 case IDCANCEL:
52 EndDialog( hDlg, 1 );
53 return TRUE;
55 break;
57 return FALSE;
60 BOOL CALLBACK CongratsDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
62 static BOARD *p_board;
64 switch( uMsg ) {
65 case WM_INITDIALOG:
66 p_board = (BOARD*) lParam;
67 SetDlgItemText( hDlg, IDC_EDITNAME,
68 p_board->best_name[p_board->difficulty] );
69 return TRUE;
71 case WM_COMMAND:
72 switch( LOWORD( wParam ) ) {
73 case IDOK:
74 GetDlgItemText( hDlg, IDC_EDITNAME,
75 p_board->best_name[p_board->difficulty],
76 sizeof( p_board->best_name[p_board->difficulty] ) );
77 EndDialog( hDlg, 0 );
78 return TRUE;
80 case IDCANCEL:
81 EndDialog( hDlg, 0 );
82 return TRUE;
84 break;
86 return FALSE;
89 BOOL CALLBACK TimesDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
91 static BOARD *p_board;
92 unsigned i;
94 switch( uMsg ) {
95 case WM_INITDIALOG:
96 p_board = (BOARD*) lParam;
98 /* set best names */
99 for( i = 0; i < 3; i++ )
100 SetDlgItemText( hDlg, (IDC_NAME1) + i, p_board->best_name[i] );
102 /* set best times */
103 for( i = 0; i < 3; i++ )
104 SetDlgItemInt( hDlg, (IDC_TIME1) + i, p_board->best_time[i], FALSE );
105 return TRUE;
107 case WM_COMMAND:
108 switch( LOWORD( wParam ) ) {
109 case IDOK:
110 case IDCANCEL:
111 EndDialog( hDlg, 0 );
112 return TRUE;
114 break;
116 return FALSE;
119 BOOL CALLBACK AboutDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
121 switch( uMsg ) {
122 case WM_INITDIALOG:
123 return TRUE;
125 case WM_COMMAND:
126 switch( LOWORD( wParam ) ) {
127 case IDOK:
128 case IDCANCEL:
129 EndDialog( hDlg, 0 );
130 return TRUE;
132 break;
134 return FALSE;