~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

Viewing changes to mess/src/osd/winui/dialogs.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Jordi Mallach, Emmanuel Kasper
  • Date: 2011-12-19 22:56:27 UTC
  • mfrom: (0.1.2)
  • Revision ID: package-import@ubuntu.com-20111219225627-ub5oga1oys4ogqzm
Tags: 0.144-1
[ Jordi Mallach ]
* Fix syntax errors in DEP5 copyright file (lintian).
* Use a versioned copyright Format specification field.
* Update Vcs-* URLs.
* Move transitional packages to the new metapackages section, and make
  them priority extra.
* Remove references to GNU/Linux and MESS sources from copyright.
* Add build variables for s390x.
* Use .xz tarballs as it cuts 4MB for the upstream sources.
* Add nplayers.ini as a patch. Update copyright file to add CC-BY-SA-3.0.

[ Emmanuel Kasper ]
* New upstream release. Closes: #651538.
* Add Free Desktop compliant png icons of various sizes taken from
  the hydroxygen iconset
* Mess is now built from a new source package, to avoid possible source
  incompatibilities between mame and the mess overlay.
* Mame-tools are not built from the mame source package anymore, but
  from the mess source package

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 
3
 
  M.A.M.E.UI  -  Multiple Arcade Machine Emulator with User Interface
4
 
  Win32 Portions Copyright (C) 1997-2003 Michael Soderstrom and Chris Kirmse,
5
 
  Copyright (C) 2003-2007 Chris Kirmse and the MAME32/MAMEUI team.
6
 
 
7
 
  This file is part of MAMEUI, and may only be used, modified and
8
 
  distributed under the terms of the MAME license, in "readme.txt".
9
 
  By continuing to use, modify or distribute this file you indicate
10
 
  that you have read the license and understand and accept it fully.
11
 
 
12
 
 ***************************************************************************/
13
 
 
14
 
/***************************************************************************
15
 
 
16
 
  dialogs.c
17
 
 
18
 
  Dialog box procedures go here
19
 
 
20
 
***************************************************************************/
21
 
 
22
 
#define WIN32_LEAN_AND_MEAN
23
 
 
24
 
#ifdef _MSC_VER
25
 
#ifndef NONAMELESSUNION
26
 
#define NONAMELESSUNION
27
 
#endif
28
 
#endif
29
 
 
30
 
// standard windows headers
31
 
#include <windows.h>
32
 
#include <windowsx.h>
33
 
#include <shellapi.h>
34
 
#include <commctrl.h>
35
 
#include <commdlg.h>
36
 
#include <stdlib.h>
37
 
 
38
 
// standard C headers
39
 
#include <string.h>
40
 
#include <tchar.h>
41
 
 
42
 
// MAMEUI headers
43
 
#include "bitmask.h"
44
 
#include "treeview.h"
45
 
#include "resource.h"
46
 
#include "mui_opts.h"
47
 
#include "help.h"
48
 
#include "winui.h"
49
 
#include "properties.h"  // For GetHelpIDs
50
 
 
51
 
// MAME headers
52
 
#include "strconv.h"
53
 
#include "winutf8.h"
54
 
 
55
 
#ifdef _MSC_VER
56
 
#define snprintf _snprintf
57
 
#endif
58
 
 
59
 
#define FILTERTEXT_LEN 256
60
 
 
61
 
static char g_FilterText[FILTERTEXT_LEN];
62
 
 
63
 
#define NUM_EXCLUSIONS  10
64
 
 
65
 
/* Pairs of filters that exclude each other */
66
 
static DWORD filterExclusion[NUM_EXCLUSIONS] =
67
 
{
68
 
        IDC_FILTER_CLONES,      IDC_FILTER_ORIGINALS,
69
 
        IDC_FILTER_NONWORKING,  IDC_FILTER_WORKING,
70
 
        IDC_FILTER_UNAVAILABLE, IDC_FILTER_AVAILABLE,
71
 
        IDC_FILTER_RASTER,      IDC_FILTER_VECTOR,
72
 
        IDC_FILTER_HORIZONTAL,  IDC_FILTER_VERTICAL
73
 
};
74
 
 
75
 
static void DisableFilterControls(HWND hWnd, LPCFOLDERDATA lpFilterRecord,
76
 
                                                                  LPCFILTER_ITEM lpFilterItem, DWORD dwFlags);
77
 
static void EnableFilterExclusions(HWND hWnd, DWORD dwCtrlID);
78
 
static DWORD ValidateFilters(LPCFOLDERDATA lpFilterRecord, DWORD dwFlags);
79
 
static void OnHScroll(HWND hWnd, HWND hwndCtl, UINT code, int pos);
80
 
 
81
 
/***************************************************************************/
82
 
 
83
 
const char * GetFilterText(void)
84
 
{
85
 
        return g_FilterText;
86
 
}
87
 
 
88
 
INT_PTR CALLBACK ResetDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
89
 
{
90
 
        BOOL resetFilters  = FALSE;
91
 
        BOOL resetGames    = FALSE;
92
 
        BOOL resetUI       = FALSE;
93
 
        BOOL resetDefaults = FALSE;
94
 
 
95
 
        switch (Msg)
96
 
        {
97
 
        case WM_INITDIALOG:
98
 
                return TRUE;
99
 
 
100
 
        case WM_HELP:
101
 
                /* User clicked the ? from the upper right on a control */
102
 
                HelpFunction((HWND)((LPHELPINFO)lParam)->hItemHandle, MAMEUICONTEXTHELP, HH_TP_HELP_WM_HELP, GetHelpIDs());
103
 
                break;
104
 
 
105
 
        case WM_CONTEXTMENU:
106
 
                HelpFunction((HWND)wParam, MAMEUICONTEXTHELP, HH_TP_HELP_CONTEXTMENU, GetHelpIDs());
107
 
 
108
 
                break;
109
 
 
110
 
        case WM_COMMAND :
111
 
                switch (GET_WM_COMMAND_ID(wParam, lParam))
112
 
                {
113
 
                case IDOK :
114
 
                        resetFilters  = Button_GetCheck(GetDlgItem(hDlg, IDC_RESET_FILTERS));
115
 
                        resetGames        = Button_GetCheck(GetDlgItem(hDlg, IDC_RESET_GAMES));
116
 
                        resetDefaults = Button_GetCheck(GetDlgItem(hDlg, IDC_RESET_DEFAULT));
117
 
                        resetUI           = Button_GetCheck(GetDlgItem(hDlg, IDC_RESET_UI));
118
 
                        if (resetFilters || resetGames || resetUI || resetDefaults)
119
 
                        {
120
 
 
121
 
                                TCHAR temp[400];
122
 
                                _tcscpy(temp, TEXT(MAMEUINAME));
123
 
                                _tcscat(temp, TEXT(" will now reset the following\n"));
124
 
                                _tcscat(temp, TEXT("to the default settings:\n\n"));
125
 
 
126
 
                                if (resetDefaults)
127
 
                                        _tcscat(temp, TEXT("Global game options\n"));
128
 
                                if (resetGames)
129
 
                                        _tcscat(temp, TEXT("Individual game options\n"));
130
 
                                if (resetFilters)
131
 
                                        _tcscat(temp, TEXT("Custom folder filters\n"));
132
 
                                if (resetUI)
133
 
                                {
134
 
                                        _tcscat(temp, TEXT("User interface settings\n\n"));
135
 
                                        _tcscat(temp, TEXT("Resetting the User Interface options\n"));
136
 
                                        _tcscat(temp, TEXT("requires exiting "));
137
 
                                        _tcscat(temp, TEXT(MAMEUINAME));
138
 
                                        _tcscat(temp, TEXT(".\n"));
139
 
                                }
140
 
                                _tcscat(temp, TEXT("\nDo you wish to continue?"));
141
 
                                if (MessageBox(hDlg, temp, TEXT("Restore Settings"), IDOK) == IDOK)
142
 
                                {
143
 
                                        if (resetFilters)
144
 
                                                ResetFilters();
145
 
 
146
 
                                        if (resetGames)
147
 
                                                ResetAllGameOptions();
148
 
 
149
 
                                        if (resetDefaults)
150
 
                                                ResetGameDefaults();
151
 
 
152
 
                                        // This is the only case we need to exit and restart for.
153
 
                                        if (resetUI)
154
 
                                        {
155
 
                                                ResetGUI();
156
 
                                                EndDialog(hDlg, 1);
157
 
                                                return TRUE;
158
 
                                        } else {
159
 
                                                EndDialog(hDlg, 0);
160
 
                                                return TRUE;
161
 
                                        }
162
 
                                } else {
163
 
                                        // Give the user a chance to change what they want to reset.
164
 
                                        break;
165
 
                                }
166
 
                        }
167
 
                // Nothing was selected but OK, just fall through
168
 
                case IDCANCEL :
169
 
                        EndDialog(hDlg, 0);
170
 
                        return TRUE;
171
 
                }
172
 
                break;
173
 
        }
174
 
        return 0;
175
 
}
176
 
 
177
 
INT_PTR CALLBACK InterfaceDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
178
 
{
179
 
        CHOOSECOLOR cc;
180
 
        COLORREF choice_colors[16];
181
 
        TCHAR tmp[4];
182
 
        int i = 0;
183
 
        BOOL bRedrawList = FALSE;
184
 
        int nCurSelection = 0;
185
 
        int nHistoryTab = 0;
186
 
        int nTabCount = 0;
187
 
        int nPatternCount = 0;
188
 
        int value = 0;
189
 
        const char* snapname = NULL;
190
 
 
191
 
        switch (Msg)
192
 
        {
193
 
        case WM_INITDIALOG:
194
 
                Button_SetCheck(GetDlgItem(hDlg,IDC_START_GAME_CHECK),GetGameCheck());
195
 
                Button_SetCheck(GetDlgItem(hDlg,IDC_JOY_GUI),GetJoyGUI());
196
 
                Button_SetCheck(GetDlgItem(hDlg,IDC_KEY_GUI),GetKeyGUI());
197
 
                Button_SetCheck(GetDlgItem(hDlg,IDC_BROADCAST),GetBroadcast());
198
 
                Button_SetCheck(GetDlgItem(hDlg,IDC_RANDOM_BG),GetRandomBackground());
199
 
 
200
 
                Button_SetCheck(GetDlgItem(hDlg,IDC_HIDE_MOUSE),GetHideMouseOnStartup());
201
 
 
202
 
                // Get the current value of the control
203
 
                SendDlgItemMessage(hDlg, IDC_CYCLETIMESEC, TBM_SETRANGE,
204
 
                                        (WPARAM)FALSE,
205
 
                                        (LPARAM)MAKELONG(0, 60)); /* [0, 60] */
206
 
                value = GetCycleScreenshot();
207
 
                SendDlgItemMessage(hDlg,IDC_CYCLETIMESEC, TBM_SETPOS, TRUE, value);
208
 
                _itot(value,tmp,10);
209
 
                SendDlgItemMessage(hDlg,IDC_CYCLETIMESECTXT,WM_SETTEXT,0, (WPARAM)tmp);
210
 
 
211
 
                Button_SetCheck(GetDlgItem(hDlg,IDC_STRETCH_SCREENSHOT_LARGER),
212
 
                                                GetStretchScreenShotLarger());
213
 
                Button_SetCheck(GetDlgItem(hDlg,IDC_FILTER_INHERIT),
214
 
                                                GetFilterInherit());
215
 
                Button_SetCheck(GetDlgItem(hDlg,IDC_NOOFFSET_CLONES),
216
 
                                                GetOffsetClones());
217
 
                (void)ComboBox_AddString(GetDlgItem(hDlg, IDC_HISTORY_TAB), TEXT("Snapshot"));
218
 
                (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_HISTORY_TAB), nTabCount++, TAB_SCREENSHOT);
219
 
                (void)ComboBox_AddString(GetDlgItem(hDlg, IDC_HISTORY_TAB), TEXT("Flyer"));
220
 
                (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_HISTORY_TAB), nTabCount++, TAB_FLYER);
221
 
                (void)ComboBox_AddString(GetDlgItem(hDlg, IDC_HISTORY_TAB), TEXT("Cabinet"));
222
 
                (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_HISTORY_TAB), nTabCount++, TAB_CABINET);
223
 
                (void)ComboBox_AddString(GetDlgItem(hDlg, IDC_HISTORY_TAB), TEXT("Marquee"));
224
 
                (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_HISTORY_TAB), nTabCount++, TAB_MARQUEE);
225
 
                (void)ComboBox_AddString(GetDlgItem(hDlg, IDC_HISTORY_TAB), TEXT("Title"));
226
 
                (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_HISTORY_TAB), nTabCount++, TAB_TITLE);
227
 
                (void)ComboBox_AddString(GetDlgItem(hDlg, IDC_HISTORY_TAB), TEXT("Control Panel"));
228
 
                (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_HISTORY_TAB), nTabCount++, TAB_CONTROL_PANEL);
229
 
                (void)ComboBox_AddString(GetDlgItem(hDlg, IDC_HISTORY_TAB), TEXT("PCB"));
230
 
                (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_HISTORY_TAB), nTabCount++, TAB_PCB);
231
 
                (void)ComboBox_AddString(GetDlgItem(hDlg, IDC_HISTORY_TAB), TEXT("All"));
232
 
                (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_HISTORY_TAB), nTabCount++, TAB_ALL);
233
 
                (void)ComboBox_AddString(GetDlgItem(hDlg, IDC_HISTORY_TAB), TEXT("None"));
234
 
                (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_HISTORY_TAB), nTabCount++, TAB_NONE);
235
 
                if (GetHistoryTab() < MAX_TAB_TYPES) {
236
 
                        (void)ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_HISTORY_TAB), GetHistoryTab());
237
 
                }
238
 
                else {
239
 
                        (void)ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_HISTORY_TAB), GetHistoryTab()-TAB_SUBTRACT);
240
 
                }
241
 
                (void)ComboBox_AddString(GetDlgItem(hDlg, IDC_SNAPNAME), TEXT("Gamename"));
242
 
                (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_SNAPNAME), nPatternCount++, "%g");
243
 
                (void)ComboBox_AddString(GetDlgItem(hDlg, IDC_SNAPNAME), TEXT("Gamename + Increment"));
244
 
                (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_SNAPNAME), nPatternCount++, "%g%i");
245
 
                (void)ComboBox_AddString(GetDlgItem(hDlg, IDC_SNAPNAME), TEXT("Gamename/Gamename"));
246
 
                (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_SNAPNAME), nPatternCount++, "%g/%g");
247
 
                (void)ComboBox_AddString(GetDlgItem(hDlg, IDC_SNAPNAME), TEXT("Gamename/Gamename + Increment"));
248
 
                (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_SNAPNAME), nPatternCount++, "%g/%g%i");
249
 
                (void)ComboBox_AddString(GetDlgItem(hDlg, IDC_SNAPNAME), TEXT("Gamename/Increment"));
250
 
                (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_SNAPNAME), nPatternCount, "%g/%i");
251
 
                //Default to this setting
252
 
                (void)ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_SNAPNAME), nPatternCount++);
253
 
                snapname = GetSnapName();
254
 
                if (core_stricmp(snapname,"%g" )==0) {
255
 
                        (void)ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_SNAPNAME), 0);
256
 
                }
257
 
                if (core_stricmp(snapname,"%g%i" )==0) {
258
 
                        (void)ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_SNAPNAME), 1);
259
 
                }
260
 
                if (core_stricmp(snapname,"%g/%g" )==0) {
261
 
                        (void)ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_SNAPNAME), 2);
262
 
                }
263
 
                if (core_stricmp(snapname,"%g/%g%i" )==0) {
264
 
                        (void)ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_SNAPNAME), 3);
265
 
                }
266
 
                if (core_stricmp(snapname,"%g/%i" )==0) {
267
 
                        (void)ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_SNAPNAME), 4);
268
 
                }
269
 
 
270
 
                SendDlgItemMessage(hDlg, IDC_SCREENSHOT_BORDERSIZE, TBM_SETRANGE,
271
 
                                        (WPARAM)FALSE,
272
 
                                        (LPARAM)MAKELONG(0, 100)); /* [0, 100] */
273
 
                value = GetScreenshotBorderSize();
274
 
                SendDlgItemMessage(hDlg,IDC_SCREENSHOT_BORDERSIZE, TBM_SETPOS, TRUE, value);
275
 
                _itot(value,tmp,10);
276
 
                SendDlgItemMessage(hDlg,IDC_SCREENSHOT_BORDERSIZETXT,WM_SETTEXT,0, (WPARAM)tmp);
277
 
 
278
 
                //return TRUE;
279
 
                break;
280
 
 
281
 
        case WM_HELP:
282
 
                /* User clicked the ? from the upper right on a control */
283
 
                HelpFunction((HWND)((LPHELPINFO)lParam)->hItemHandle, MAMEUICONTEXTHELP, HH_TP_HELP_WM_HELP, GetHelpIDs());
284
 
                break;
285
 
 
286
 
        case WM_CONTEXTMENU:
287
 
                HelpFunction((HWND)wParam, MAMEUICONTEXTHELP, HH_TP_HELP_CONTEXTMENU, GetHelpIDs());
288
 
                break;
289
 
        case WM_HSCROLL:
290
 
                HANDLE_WM_HSCROLL(hDlg, wParam, lParam, OnHScroll);
291
 
                break;
292
 
        case WM_COMMAND :
293
 
                switch (GET_WM_COMMAND_ID(wParam, lParam))
294
 
                {
295
 
                case IDC_SCREENSHOT_BORDERCOLOR:
296
 
                {
297
 
                        for (i=0;i<16;i++)
298
 
                                choice_colors[i] = GetCustomColor(i);
299
 
 
300
 
                        cc.lStructSize = sizeof(CHOOSECOLOR);
301
 
                        cc.hwndOwner   = hDlg;
302
 
                        cc.rgbResult   = GetScreenshotBorderColor();
303
 
                        cc.lpCustColors = choice_colors;
304
 
                        cc.Flags       = CC_ANYCOLOR | CC_RGBINIT | CC_SOLIDCOLOR;
305
 
                        if (!ChooseColor(&cc))
306
 
                                return TRUE;
307
 
                        for (i=0;i<16;i++)
308
 
                                SetCustomColor(i,choice_colors[i]);
309
 
                        SetScreenshotBorderColor(cc.rgbResult);
310
 
                        UpdateScreenShot();
311
 
                        return TRUE;
312
 
                }
313
 
                case IDOK :
314
 
                {
315
 
                        BOOL checked = FALSE;
316
 
 
317
 
                        SetGameCheck(Button_GetCheck(GetDlgItem(hDlg, IDC_START_GAME_CHECK)));
318
 
                        SetJoyGUI(Button_GetCheck(GetDlgItem(hDlg, IDC_JOY_GUI)));
319
 
                        SetKeyGUI(Button_GetCheck(GetDlgItem(hDlg, IDC_KEY_GUI)));
320
 
                        SetBroadcast(Button_GetCheck(GetDlgItem(hDlg, IDC_BROADCAST)));
321
 
                        SetRandomBackground(Button_GetCheck(GetDlgItem(hDlg, IDC_RANDOM_BG)));
322
 
 
323
 
                        SetHideMouseOnStartup(Button_GetCheck(GetDlgItem(hDlg,IDC_HIDE_MOUSE)));
324
 
 
325
 
                        if( Button_GetCheck(GetDlgItem(hDlg,IDC_RESET_PLAYCOUNT ) ) )
326
 
                        {
327
 
                                ResetPlayCount( -1 );
328
 
                                bRedrawList = TRUE;
329
 
                        }
330
 
                        if( Button_GetCheck(GetDlgItem(hDlg,IDC_RESET_PLAYTIME ) ) )
331
 
                        {
332
 
                                ResetPlayTime( -1 );
333
 
                                bRedrawList = TRUE;
334
 
                        }
335
 
                        value = SendDlgItemMessage(hDlg,IDC_CYCLETIMESEC, TBM_GETPOS, 0, 0);
336
 
                        if( GetCycleScreenshot() != value )
337
 
                        {
338
 
                                SetCycleScreenshot(value);
339
 
                        }
340
 
                        value = SendDlgItemMessage(hDlg,IDC_SCREENSHOT_BORDERSIZE, TBM_GETPOS, 0, 0);
341
 
                        if( GetScreenshotBorderSize() != value )
342
 
                        {
343
 
                                SetScreenshotBorderSize(value);
344
 
                                UpdateScreenShot();
345
 
                        }
346
 
                        value = SendDlgItemMessage(hDlg,IDC_HIGH_PRIORITY, TBM_GETPOS, 0, 0);
347
 
                        checked = Button_GetCheck(GetDlgItem(hDlg,IDC_STRETCH_SCREENSHOT_LARGER));
348
 
                        if (checked != GetStretchScreenShotLarger())
349
 
                        {
350
 
                                SetStretchScreenShotLarger(checked);
351
 
                                UpdateScreenShot();
352
 
                        }
353
 
                        checked = Button_GetCheck(GetDlgItem(hDlg,IDC_FILTER_INHERIT));
354
 
                        if (checked != GetFilterInherit())
355
 
                        {
356
 
                                SetFilterInherit(checked);
357
 
                                // LineUpIcons does just a ResetListView(), which is what we want here
358
 
                                PostMessage(GetMainWindow(),WM_COMMAND, MAKEWPARAM(ID_VIEW_LINEUPICONS, FALSE),(LPARAM)NULL);
359
 
                        }
360
 
                        checked = Button_GetCheck(GetDlgItem(hDlg,IDC_NOOFFSET_CLONES));
361
 
                        if (checked != GetOffsetClones())
362
 
                        {
363
 
                                SetOffsetClones(checked);
364
 
                                // LineUpIcons does just a ResetListView(), which is what we want here
365
 
                                PostMessage(GetMainWindow(),WM_COMMAND, MAKEWPARAM(ID_VIEW_LINEUPICONS, FALSE),(LPARAM)NULL);
366
 
                        }
367
 
                        nCurSelection = ComboBox_GetCurSel(GetDlgItem(hDlg,IDC_SNAPNAME));
368
 
                        if (nCurSelection != CB_ERR) {
369
 
                                const char* snapname_selection = (const char*)ComboBox_GetItemData(GetDlgItem(hDlg,IDC_SNAPNAME), nCurSelection);
370
 
                                if (snapname_selection) {
371
 
                                        SetSnapName(snapname_selection);
372
 
                                }
373
 
                        }
374
 
                        EndDialog(hDlg, 0);
375
 
 
376
 
                        nCurSelection = ComboBox_GetCurSel(GetDlgItem(hDlg,IDC_HISTORY_TAB));
377
 
                        if (nCurSelection != CB_ERR)
378
 
                                nHistoryTab = ComboBox_GetItemData(GetDlgItem(hDlg,IDC_HISTORY_TAB), nCurSelection);
379
 
                        EndDialog(hDlg, 0);
380
 
                        if( GetHistoryTab() != nHistoryTab )
381
 
                        {
382
 
                                SetHistoryTab(nHistoryTab, TRUE);
383
 
                                ResizePickerControls(GetMainWindow());
384
 
                                UpdateScreenShot();
385
 
                        }
386
 
                        if( bRedrawList )
387
 
                        {
388
 
                                UpdateListView();
389
 
                        }
390
 
                        return TRUE;
391
 
                }
392
 
                case IDCANCEL :
393
 
                        EndDialog(hDlg, 0);
394
 
                        return TRUE;
395
 
                }
396
 
                break;
397
 
        }
398
 
        return 0;
399
 
}
400
 
 
401
 
INT_PTR CALLBACK FilterDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
402
 
{
403
 
        static DWORD                    dwFilters;
404
 
        static DWORD                    dwpFilters;
405
 
        static LPCFOLDERDATA    lpFilterRecord;
406
 
        char                                    strText[250];
407
 
        int                                     i;
408
 
 
409
 
        switch (Msg)
410
 
        {
411
 
        case WM_INITDIALOG:
412
 
        {
413
 
                LPTREEFOLDER folder = GetCurrentFolder();
414
 
                LPTREEFOLDER lpParent = NULL;
415
 
                LPCFILTER_ITEM g_lpFilterList = GetFilterList();
416
 
 
417
 
                dwFilters = 0;
418
 
 
419
 
                if (folder != NULL)
420
 
                {
421
 
                        char tmp[80];
422
 
 
423
 
                        win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_EDIT), g_FilterText);
424
 
                        Edit_SetSel(GetDlgItem(hDlg, IDC_FILTER_EDIT), 0, -1);
425
 
                        // Mask out non filter flags
426
 
                        dwFilters = folder->m_dwFlags & F_MASK;
427
 
                        // Display current folder name in dialog titlebar
428
 
                        snprintf(tmp,ARRAY_LENGTH(tmp),"Filters for %s Folder",folder->m_lpTitle);
429
 
                        win_set_window_text_utf8(hDlg, tmp);
430
 
                        if ( GetFilterInherit() )
431
 
                        {
432
 
                                BOOL bShowExplanation = FALSE;
433
 
                                lpParent = GetFolder( folder->m_nParent );
434
 
                                if( lpParent )
435
 
                                {
436
 
                                        /* Check the Parent Filters and inherit them on child,
437
 
                     * No need to promote all games to parent folder, works as is */
438
 
                                        dwpFilters = lpParent->m_dwFlags & F_MASK;
439
 
                                        /*Check all possible Filters if inherited solely from parent, e.g. not being set explicitly on our folder*/
440
 
                                        if( (dwpFilters & F_CLONES) && !(dwFilters & F_CLONES) )
441
 
                                        {
442
 
                                                /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
443
 
                                                win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_CLONES), strText, 250);
444
 
                                                strcat(strText, " (*)");
445
 
                                                win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_CLONES), strText);
446
 
                                                bShowExplanation = TRUE;
447
 
                                        }
448
 
                                        if( (dwpFilters & F_NONWORKING) && !(dwFilters & F_NONWORKING) )
449
 
                                        {
450
 
                                                /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
451
 
                                                win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_NONWORKING), strText, 250);
452
 
                                                strcat(strText, " (*)");
453
 
                                                win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_NONWORKING), strText);
454
 
                                                bShowExplanation = TRUE;
455
 
                                        }
456
 
                                        if( (dwpFilters & F_UNAVAILABLE) && !(dwFilters & F_UNAVAILABLE) )
457
 
                                        {
458
 
                                                /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
459
 
                                                win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_UNAVAILABLE), strText, 250);
460
 
                                                strcat(strText, " (*)");
461
 
                                                win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_UNAVAILABLE), strText);
462
 
                                                bShowExplanation = TRUE;
463
 
                                        }
464
 
                                        if( (dwpFilters & F_VECTOR) && !(dwFilters & F_VECTOR) )
465
 
                                        {
466
 
                                                /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
467
 
                                                win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_VECTOR), strText, 250);
468
 
                                                strcat(strText, " (*)");
469
 
                                                win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_VECTOR), strText);
470
 
                                                bShowExplanation = TRUE;
471
 
                                        }
472
 
                                        if( (dwpFilters & F_RASTER) && !(dwFilters & F_RASTER) )
473
 
                                        {
474
 
                                                /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
475
 
                                                win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_RASTER), strText, 250);
476
 
                                                strcat(strText, " (*)");
477
 
                                                win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_RASTER), strText);
478
 
                                                bShowExplanation = TRUE;
479
 
                                        }
480
 
                                        if( (dwpFilters & F_ORIGINALS) && !(dwFilters & F_ORIGINALS) )
481
 
                                        {
482
 
                                                /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
483
 
                                                win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_ORIGINALS), strText, 250);
484
 
                                                strcat(strText, " (*)");
485
 
                                                win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_ORIGINALS), strText);
486
 
                                                bShowExplanation = TRUE;
487
 
                                        }
488
 
                                        if( (dwpFilters & F_WORKING) && !(dwFilters & F_WORKING) )
489
 
                                        {
490
 
                                                /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
491
 
                                                win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_WORKING), strText, 250);
492
 
                                                strcat(strText, " (*)");
493
 
                                                win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_WORKING), strText);
494
 
                                                bShowExplanation = TRUE;
495
 
                                        }
496
 
                                        if( (dwpFilters & F_AVAILABLE) && !(dwFilters & F_AVAILABLE) )
497
 
                                        {
498
 
                                                /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
499
 
                                                win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_AVAILABLE), strText, 250);
500
 
                                                strcat(strText, " (*)");
501
 
                                                win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_AVAILABLE), strText);
502
 
                                                bShowExplanation = TRUE;
503
 
                                        }
504
 
                                        if( (dwpFilters & F_HORIZONTAL) && !(dwFilters & F_HORIZONTAL) )
505
 
                                        {
506
 
                                                /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
507
 
                                                win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_HORIZONTAL), strText, 250);
508
 
                                                strcat(strText, " (*)");
509
 
                                                win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_HORIZONTAL), strText);
510
 
                                                bShowExplanation = TRUE;
511
 
                                        }
512
 
                                        if( (dwpFilters & F_VERTICAL) && !(dwFilters & F_VERTICAL) )
513
 
                                        {
514
 
                                                /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
515
 
                                                win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_VERTICAL), strText, 250);
516
 
                                                strcat(strText, " (*)");
517
 
                                                win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_VERTICAL), strText);
518
 
                                                bShowExplanation = TRUE;
519
 
                                        }
520
 
                                        /*Do not or in the Values of the parent, so that the values of the folder still can be set*/
521
 
                                        //dwFilters |= dwpFilters;
522
 
                                }
523
 
                                if( ! bShowExplanation )
524
 
                                {
525
 
                                        ShowWindow(GetDlgItem(hDlg, IDC_INHERITED), FALSE );
526
 
                                }
527
 
                        }
528
 
                        else
529
 
                        {
530
 
                                ShowWindow(GetDlgItem(hDlg, IDC_INHERITED), FALSE );
531
 
                        }
532
 
                        // Find the matching filter record if it exists
533
 
                        lpFilterRecord = FindFilter(folder->m_nFolderId);
534
 
 
535
 
                        // initialize and disable appropriate controls
536
 
                        for (i = 0; g_lpFilterList[i].m_dwFilterType; i++)
537
 
                        {
538
 
                                DisableFilterControls(hDlg, lpFilterRecord, &g_lpFilterList[i], dwFilters);
539
 
                        }
540
 
                }
541
 
                SetFocus(GetDlgItem(hDlg, IDC_FILTER_EDIT));
542
 
                return FALSE;
543
 
        }
544
 
        case WM_HELP:
545
 
                // User clicked the ? from the upper right on a control
546
 
                HelpFunction((HWND)((LPHELPINFO)lParam)->hItemHandle, MAMEUICONTEXTHELP,
547
 
                                         HH_TP_HELP_WM_HELP, GetHelpIDs());
548
 
                break;
549
 
 
550
 
        case WM_CONTEXTMENU:
551
 
                HelpFunction((HWND)wParam, MAMEUICONTEXTHELP, HH_TP_HELP_CONTEXTMENU, GetHelpIDs());
552
 
                break;
553
 
 
554
 
        case WM_COMMAND:
555
 
        {
556
 
                WORD wID                 = GET_WM_COMMAND_ID(wParam, lParam);
557
 
                WORD wNotifyCode = GET_WM_COMMAND_CMD(wParam, lParam);
558
 
                LPTREEFOLDER folder = GetCurrentFolder();
559
 
                LPCFILTER_ITEM g_lpFilterList = GetFilterList();
560
 
 
561
 
                switch (wID)
562
 
                {
563
 
                case IDOK:
564
 
                        dwFilters = 0;
565
 
 
566
 
                        win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_EDIT), g_FilterText, FILTERTEXT_LEN);
567
 
 
568
 
                        // see which buttons are checked
569
 
                        for (i = 0; g_lpFilterList[i].m_dwFilterType; i++)
570
 
                        {
571
 
                                if (Button_GetCheck(GetDlgItem(hDlg, g_lpFilterList[i].m_dwCtrlID)))
572
 
                                        dwFilters |= g_lpFilterList[i].m_dwFilterType;
573
 
                        }
574
 
 
575
 
                        // Mask out invalid filters
576
 
                        dwFilters = ValidateFilters(lpFilterRecord, dwFilters);
577
 
 
578
 
                        // Keep non filter flags
579
 
                        folder->m_dwFlags &= ~F_MASK;
580
 
 
581
 
                        // put in the set filters
582
 
                        folder->m_dwFlags |= dwFilters;
583
 
 
584
 
                        EndDialog(hDlg, 1);
585
 
                        return TRUE;
586
 
 
587
 
                case IDCANCEL:
588
 
                        EndDialog(hDlg, 0);
589
 
                        return TRUE;
590
 
 
591
 
                default:
592
 
                        // Handle unchecking mutually exclusive filters
593
 
                        if (wNotifyCode == BN_CLICKED)
594
 
                                EnableFilterExclusions(hDlg, wID);
595
 
                }
596
 
        }
597
 
        break;
598
 
        }
599
 
        return 0;
600
 
}
601
 
 
602
 
INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
603
 
{
604
 
        switch (Msg)
605
 
        {
606
 
        case WM_INITDIALOG:
607
 
                {
608
 
                        HBITMAP hBmp;
609
 
                        hBmp = (HBITMAP)LoadImage(GetModuleHandle(NULL),
610
 
                                                                          MAKEINTRESOURCE(IDB_ABOUT),
611
 
                                                                          IMAGE_BITMAP, 0, 0, LR_SHARED);
612
 
                        SendDlgItemMessage(hDlg, IDC_ABOUT, STM_SETIMAGE,
613
 
                                                (WPARAM)IMAGE_BITMAP, (LPARAM)hBmp);
614
 
                        win_set_window_text_utf8(GetDlgItem(hDlg, IDC_VERSION), GetVersionString());
615
 
                }
616
 
                return 1;
617
 
 
618
 
        case WM_COMMAND:
619
 
                EndDialog(hDlg, 0);
620
 
                return 1;
621
 
        }
622
 
        return 0;
623
 
}
624
 
 
625
 
INT_PTR CALLBACK AddCustomFileDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
626
 
{
627
 
    static LPTREEFOLDER default_selection = NULL;
628
 
        static int driver_index;
629
 
        BOOL res;
630
 
 
631
 
        switch (Msg)
632
 
        {
633
 
        case WM_INITDIALOG:
634
 
        {
635
 
            TREEFOLDER **folders;
636
 
                int num_folders;
637
 
                int i;
638
 
                TVINSERTSTRUCT tvis;
639
 
                TVITEM tvi;
640
 
                BOOL first_entry = TRUE;
641
 
                HIMAGELIST treeview_icons = GetTreeViewIconList();
642
 
 
643
 
                // current game passed in using DialogBoxParam()
644
 
                driver_index = lParam;
645
 
 
646
 
                (void)TreeView_SetImageList(GetDlgItem(hDlg,IDC_CUSTOM_TREE), treeview_icons, LVSIL_NORMAL);
647
 
 
648
 
                GetFolders(&folders,&num_folders);
649
 
 
650
 
                // should add "New..."
651
 
 
652
 
                // insert custom folders into our tree view
653
 
                for (i=0;i<num_folders;i++)
654
 
                {
655
 
                    if (folders[i]->m_dwFlags & F_CUSTOM)
656
 
                        {
657
 
                            HTREEITEM hti;
658
 
                                int jj;
659
 
 
660
 
                                if (folders[i]->m_nParent == -1)
661
 
                                {
662
 
                                        memset(&tvi, '\0', sizeof(tvi));
663
 
                                    tvis.hParent = TVI_ROOT;
664
 
                                        tvis.hInsertAfter = TVI_SORT;
665
 
                                        tvi.mask = TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
666
 
                                        tvi.pszText = folders[i]->m_lptTitle;
667
 
                                        tvi.lParam = (LPARAM)folders[i];
668
 
                                        tvi.iImage = GetTreeViewIconIndex(folders[i]->m_nIconId);
669
 
                                        tvi.iSelectedImage = 0;
670
 
#if defined(__GNUC__) /* bug in commctrl.h */
671
 
                                        tvis.item = tvi;
672
 
#else
673
 
                                        tvis.DUMMYUNIONNAME.item = tvi;
674
 
#endif
675
 
 
676
 
                                        hti = TreeView_InsertItem(GetDlgItem(hDlg,IDC_CUSTOM_TREE),&tvis);
677
 
 
678
 
                                        /* look for children of this custom folder */
679
 
                                        for (jj=0;jj<num_folders;jj++)
680
 
                                        {
681
 
                                            if (folders[jj]->m_nParent == i)
682
 
                                                {
683
 
                                                    HTREEITEM hti_child;
684
 
                                                    tvis.hParent = hti;
685
 
                                                        tvis.hInsertAfter = TVI_SORT;
686
 
                                                        tvi.mask = TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
687
 
                                                        tvi.pszText = folders[jj]->m_lptTitle;
688
 
                                                        tvi.lParam = (LPARAM)folders[jj];
689
 
                                                        tvi.iImage = GetTreeViewIconIndex(folders[jj]->m_nIconId);
690
 
                                                        tvi.iSelectedImage = 0;
691
 
#if defined(__GNUC__) /* bug in commctrl.h */
692
 
                                                tvis.item = tvi;
693
 
#else
694
 
                                                tvis.DUMMYUNIONNAME.item = tvi;
695
 
#endif
696
 
                                                        hti_child = TreeView_InsertItem(GetDlgItem(hDlg,IDC_CUSTOM_TREE),&tvis);
697
 
                                                        if (folders[jj] == default_selection)
698
 
                                                            res = TreeView_SelectItem(GetDlgItem(hDlg,IDC_CUSTOM_TREE),hti_child);
699
 
                                                }
700
 
                                        }
701
 
 
702
 
                                        /*TreeView_Expand(GetDlgItem(hDlg,IDC_CUSTOM_TREE),hti,TVE_EXPAND);*/
703
 
                                        if (first_entry || folders[i] == default_selection)
704
 
                                        {
705
 
                                            res = TreeView_SelectItem(GetDlgItem(hDlg,IDC_CUSTOM_TREE),hti);
706
 
                                                first_entry = FALSE;
707
 
                                        }
708
 
 
709
 
                                }
710
 
 
711
 
                        }
712
 
                }
713
 
 
714
 
                win_set_window_text_utf8(GetDlgItem(hDlg,IDC_CUSTOMFILE_GAME),
715
 
                                          ModifyThe(driver_list::driver(driver_index).description));
716
 
 
717
 
                return TRUE;
718
 
        }
719
 
        case WM_COMMAND:
720
 
                switch (GET_WM_COMMAND_ID(wParam, lParam))
721
 
                {
722
 
                case IDOK:
723
 
                {
724
 
                   TVITEM tvi;
725
 
                   tvi.hItem = TreeView_GetSelection(GetDlgItem(hDlg,IDC_CUSTOM_TREE));
726
 
                   tvi.mask = TVIF_PARAM;
727
 
                   if (TreeView_GetItem(GetDlgItem(hDlg,IDC_CUSTOM_TREE),&tvi) == TRUE)
728
 
                   {
729
 
                          /* should look for New... */
730
 
 
731
 
                          default_selection = (LPTREEFOLDER)tvi.lParam; /* start here next time */
732
 
 
733
 
                          AddToCustomFolder((LPTREEFOLDER)tvi.lParam,driver_index);
734
 
                   }
735
 
 
736
 
                   EndDialog(hDlg, 0);
737
 
                   return TRUE;
738
 
                }
739
 
                case IDCANCEL:
740
 
                        EndDialog(hDlg, 0);
741
 
                        return TRUE;
742
 
 
743
 
                }
744
 
                break;
745
 
        }
746
 
        return 0;
747
 
}
748
 
 
749
 
INT_PTR CALLBACK DirectXDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
750
 
{
751
 
        HWND hEdit;
752
 
 
753
 
        const char *directx_help =
754
 
                MAMEUINAME " requires DirectX version 3 or later, which is a set of operating\r\n"
755
 
                "system extensions by Microsoft for Windows 9x, NT and 2000.\r\n\r\n"
756
 
                "Visit Microsoft's DirectX web page at http://www.microsoft.com/directx\r\n"
757
 
                "download DirectX, install it, and then run " MAMEUINAME " again.\r\n";
758
 
 
759
 
        switch (Msg)
760
 
        {
761
 
        case WM_INITDIALOG:
762
 
                hEdit = GetDlgItem(hDlg, IDC_DIRECTX_HELP);
763
 
                Edit_SetSel(hEdit, Edit_GetTextLength(hEdit), Edit_GetTextLength(hEdit));
764
 
                Edit_ReplaceSel(hEdit, directx_help);
765
 
                return 1;
766
 
 
767
 
        case WM_COMMAND:
768
 
                if (LOWORD(wParam) == IDB_WEB_PAGE)
769
 
                        ShellExecute(GetMainWindow(), NULL, TEXT("http://www.microsoft.com/directx"),
770
 
                                                 NULL, NULL, SW_SHOWNORMAL);
771
 
 
772
 
                if (LOWORD(wParam) == IDCANCEL || LOWORD(wParam) == IDB_WEB_PAGE)
773
 
                        EndDialog(hDlg, 0);
774
 
                return 1;
775
 
        }
776
 
        return 0;
777
 
}
778
 
 
779
 
/***************************************************************************
780
 
    private functions
781
 
 ***************************************************************************/
782
 
 
783
 
static void DisableFilterControls(HWND hWnd, LPCFOLDERDATA lpFilterRecord,
784
 
                                                                  LPCFILTER_ITEM lpFilterItem, DWORD dwFlags)
785
 
{
786
 
        HWND  hWndCtrl = GetDlgItem(hWnd, lpFilterItem->m_dwCtrlID);
787
 
        DWORD dwFilterType = lpFilterItem->m_dwFilterType;
788
 
 
789
 
        /* Check the appropriate control */
790
 
        if (dwFilterType & dwFlags)
791
 
                Button_SetCheck(hWndCtrl, MF_CHECKED);
792
 
 
793
 
        /* No special rules for this folder? */
794
 
        if (!lpFilterRecord)
795
 
                return;
796
 
 
797
 
        /* If this is an excluded filter */
798
 
        if (lpFilterRecord->m_dwUnset & dwFilterType)
799
 
        {
800
 
                /* uncheck it and disable the control */
801
 
                Button_SetCheck(hWndCtrl, MF_UNCHECKED);
802
 
                EnableWindow(hWndCtrl, FALSE);
803
 
        }
804
 
 
805
 
        /* If this is an implied filter, check it and disable the control */
806
 
        if (lpFilterRecord->m_dwSet & dwFilterType)
807
 
        {
808
 
                Button_SetCheck(hWndCtrl, MF_CHECKED);
809
 
                EnableWindow(hWndCtrl, FALSE);
810
 
        }
811
 
}
812
 
 
813
 
// Handle disabling mutually exclusive controls
814
 
static void EnableFilterExclusions(HWND hWnd, DWORD dwCtrlID)
815
 
{
816
 
        int     i;
817
 
        DWORD   id;
818
 
 
819
 
        for (i = 0; i < NUM_EXCLUSIONS; i++)
820
 
        {
821
 
                // is this control in the list?
822
 
                if (filterExclusion[i] == dwCtrlID)
823
 
                {
824
 
                        // found the control id
825
 
                        break;
826
 
                }
827
 
        }
828
 
 
829
 
        // if the control was found
830
 
        if (i < NUM_EXCLUSIONS)
831
 
        {
832
 
                // find the opposing control id
833
 
                if (i % 2)
834
 
                        id = filterExclusion[i - 1];
835
 
                else
836
 
                        id = filterExclusion[i + 1];
837
 
 
838
 
                // Uncheck the other control
839
 
                Button_SetCheck(GetDlgItem(hWnd, id), MF_UNCHECKED);
840
 
        }
841
 
}
842
 
 
843
 
// Validate filter setting, mask out inappropriate filters for this folder
844
 
static DWORD ValidateFilters(LPCFOLDERDATA lpFilterRecord, DWORD dwFlags)
845
 
{
846
 
        DWORD dwFilters;
847
 
 
848
 
        if (lpFilterRecord != (LPFOLDERDATA)0)
849
 
        {
850
 
                // Mask out implied and excluded filters
851
 
                dwFilters = lpFilterRecord->m_dwSet | lpFilterRecord->m_dwUnset;
852
 
                return dwFlags & ~dwFilters;
853
 
        }
854
 
 
855
 
        // No special cases - all filters apply
856
 
        return dwFlags;
857
 
}
858
 
 
859
 
static void OnHScroll(HWND hwnd, HWND hwndCtl, UINT code, int pos)
860
 
{
861
 
        int value;
862
 
        TCHAR tmp[4];
863
 
        if (hwndCtl == GetDlgItem(hwnd, IDC_CYCLETIMESEC))
864
 
        {
865
 
                value = SendDlgItemMessage(hwnd,IDC_CYCLETIMESEC, TBM_GETPOS, 0, 0);
866
 
                _itot(value,tmp,10);
867
 
                SendDlgItemMessage(hwnd,IDC_CYCLETIMESECTXT,WM_SETTEXT,0, (WPARAM)tmp);
868
 
        }
869
 
        else
870
 
        if (hwndCtl == GetDlgItem(hwnd, IDC_SCREENSHOT_BORDERSIZE))
871
 
        {
872
 
                value = SendDlgItemMessage(hwnd,IDC_SCREENSHOT_BORDERSIZE, TBM_GETPOS, 0, 0);
873
 
                _itot(value,tmp,10);
874
 
                SendDlgItemMessage(hwnd,IDC_SCREENSHOT_BORDERSIZETXT,WM_SETTEXT,0, (WPARAM)tmp);
875
 
        }
876
 
}