forked from PlexaryDamato/nrage-input
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathInterface.cpp
4055 lines (3473 loc) · 127 KB
/
Interface.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
N-Rage`s Dinput8 Plugin
(C) 2002, 2006 Norbert Wladyka
Author`s Email: [email protected]
Website: http://go.to/nrage
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "commonIncludes.h"
#include <windows.h>
#include <Commctrl.h>
#include <stdio.h>
#include "NRagePluginV2.h"
#include "DirectInput.h"
#include "XInputController.h"
#include "FileAccess.h"
#include "PakIO.h"
#include "Interface.h"
#include "International.h"
// Prototypes //
BOOL CALLBACK ControllerTabProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
BOOL CALLBACK ControlsTabProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
BOOL CALLBACK XControlsTabProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); // Xinput Control main proc. --tecnicors
BOOL CALLBACK DevicesTabProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
BOOL CALLBACK ModifierTabProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
BOOL CALLBACK ControllerPakTabProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
BOOL CALLBACK PakProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
BOOL CALLBACK MemPakProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
BOOL CALLBACK RumblePakProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
BOOL CALLBACK TransferPakProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
BOOL CALLBACK ShortcutsTabProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
BOOL CALLBACK FoldersDialogProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
LRESULT CALLBACK BlockerProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
BOOL InitOverlay();
HWND MakeOverlay();
// BOOL CALLBACK EnumGetKeyDesc( LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef ); // nope, sorry. --rabid
bool GetButtonID( LPDWORD ButtonID, const BYTE bIndex, const BYTE bButtonSet );
bool GetButtonText( const BUTTON& btnButton, LPTSTR Buffer);
DWORD ScanDevices( LPDWORD lpdwCounter, LPBUTTON pButton );
void DeleteControllerSettings( int indexController );
void GetCurrentConfiguration();
void UpdateControllerStructures();
// global Variables //
INTERFACEVALUES *g_ivConfig = NULL; // this structure holds all GUI-Data; it points to a valid struct only if the config window is open
LPDIRECTINPUTDEVICE8 g_pConfigDevice = NULL; // one device handle for current FF device; between messages so it needs to be persistent
LPDIRECTINPUTEFFECT g_pConfigEffect = NULL; // FF-effect handle
HWND g_hMainDialog = NULL; // handle of base-dialog
// Main dialog control handler
BOOL CALLBACK MainDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
static HWND hTabControl;
HWND hDlgItem;
long i,j;
switch(uMsg)
{
case WM_INITDIALOG:
{
DebugWriteA("Config interface: Open\n");
g_ivConfig = (INTERFACEVALUES*)P_malloc( sizeof(INTERFACEVALUES) ); // TODO: CHECK THIS MALLOC!
ZeroMemory( g_ivConfig, sizeof(INTERFACEVALUES) );
CopyMemory( &g_ivConfig->Shortcuts, &g_scShortcuts ,sizeof(SHORTCUTS) );
for( i = 0; i < 4; ++i )
DeleteControllerSettings( i );
EnterCriticalSection( &g_critical ); // block because the InitiateControllers code may still be running.
if( !g_strEmuInfo.fInitialisedPlugin )
{
LoadConfigFromINI();
}
GetCurrentConfiguration();
LeaveCriticalSection( &g_critical );
g_hMainDialog = hDlg;
// Display Version
{
TCHAR tszBuffer[DEFAULT_BUFFER], tszMsg[DEFAULT_BUFFER / 2];
LoadString( g_hResourceDLL, IDS_VERSTRING, tszBuffer, DEFAULT_BUFFER / 2);
_stprintf(tszMsg, tszBuffer, VERSIONINFO);
SetDlgItemText( hDlg, IDC_VERSIONSTRING, tszMsg );
}
// Tab - Control //
hTabControl = NULL;
hDlgItem = GetDlgItem( hDlg, IDC_UPPERTAB );
TCITEM tcItem;
tcItem.mask = TCIF_TEXT;
TCHAR tszText[DEFAULT_BUFFER], tszBuff[DEFAULT_BUFFER];
tcItem.pszText = tszText;
LoadString( g_hResourceDLL, IDS_TAB_CONTROLLER, tszBuff, DEFAULT_BUFFER );
for (int i = 0; i < 4; i++ )
{
wsprintf( tszText, tszBuff, i + 1 );
TabCtrl_InsertItem( hDlgItem, i, &tcItem );
}
LoadString( g_hResourceDLL, IDS_TAB_SHORTCUTS, tszText, DEFAULT_BUFFER );
TabCtrl_InsertItem( hDlgItem, TAB_SHORTCUTS, &tcItem );
// Tab - Control End //
g_ivConfig->ChosenTab = TAB_CONTROLLER1;
TabCtrl_SetCurSel( GetDlgItem( hDlg, IDC_UPPERTAB), g_ivConfig->ChosenTab );
NMHDR nmInit;
nmInit.hwndFrom = hDlgItem;
nmInit.idFrom = IDC_UPPERTAB;
nmInit.code = TCN_SELCHANGE;
MainDlgProc( hDlg, WM_NOTIFY, IDC_UPPERTAB, (LPARAM)&nmInit );
// we can't click "Use" without saving when not emulating, because the emu resets controls before loading a ROM
if( !g_bRunning )
EnableWindow( GetDlgItem( hDlg, IDUSE ), FALSE );
#ifndef _UNICODE
EnableWindow( GetDlgItem( hDlg, IDC_LANGUAGE), FALSE );
#endif // #ifdef _UNICODE
InitOverlay();
}
// call routine to show content( recursive call )
MainDlgProc( hDlg, WM_USER_UPDATE, 0, 0 );
return TRUE; // the system sets focus to one control element
case WM_NOTIFY:
hDlgItem = ((LPNMHDR)lParam)->hwndFrom;
i = ((LPNMHDR)lParam)->code;
j = ((LPNMHDR)lParam)->idFrom;
switch( j )
{
case IDC_UPPERTAB:
if( i == TCN_SELCHANGE )
{
i = g_ivConfig->ChosenTab;
g_ivConfig->ChosenTab = (BYTE)TabCtrl_GetCurSel( hDlgItem );
if( hTabControl )
{
if( (( i == TAB_CONTROLLER1 ) || ( i == TAB_CONTROLLER2 ) || ( i == TAB_CONTROLLER3 ) || ( i == TAB_CONTROLLER4 )) &&
(( g_ivConfig->ChosenTab == TAB_CONTROLLER1 ) || ( g_ivConfig->ChosenTab == TAB_CONTROLLER2 ) || ( g_ivConfig->ChosenTab == TAB_CONTROLLER3 ) || ( g_ivConfig->ChosenTab == TAB_CONTROLLER4 )))
{
MainDlgProc( hDlg, WM_USER_UPDATE, 0, 0 );
return TRUE;
}
else
DestroyWindow( hTabControl );
}
switch( g_ivConfig->ChosenTab )
{
case TAB_CONTROLLER1:
case TAB_CONTROLLER2:
case TAB_CONTROLLER3:
case TAB_CONTROLLER4:
hTabControl = CreateDialog( g_hResourceDLL, MAKEINTRESOURCE( IDD_CONTROLLER ), hDlg, ControllerTabProc );
break;
case TAB_SHORTCUTS:
hTabControl = CreateDialog( g_hResourceDLL, MAKEINTRESOURCE( IDD_SHORTCUT ), hDlg, ShortcutsTabProc );
break;
default:
hTabControl = NULL;
return TRUE;
}
RECT rectWindow,
rectTab, rectMain; // need to know the position of the calling tab window relative to its parent
GetWindowRect( hDlg, &rectMain );
GetWindowRect( hDlgItem, &rectTab );
GetClientRect( hDlgItem, &rectWindow );
TabCtrl_AdjustRect( hDlgItem, FALSE, &rectWindow );
// second, third param: plus Tabwindow's position relative to main
MoveWindow( hTabControl, (rectTab.left - rectMain.left), (rectTab.top - rectMain.top), rectWindow.right - rectWindow.left, rectWindow.bottom - rectWindow.top, FALSE );
ShowWindow( hTabControl, SW_SHOW );
}
return TRUE;
default:
return FALSE;
}
case WM_COMMAND:
hDlgItem = GetDlgItem( hDlg, LOWORD(wParam) );
switch( LOWORD(wParam) )
{
case IDSAVE:
if( hTabControl )
{
DestroyWindow( hTabControl );
hTabControl = NULL;
}
DebugWriteA("Config interface: Save\n");
StoreConfigToINI();
// NO BREAK-- this is intentional
case IDUSE:
if( hTabControl )
{
DestroyWindow( hTabControl );
hTabControl = NULL;
}
DebugWriteA("Config interface: Use\n");
CopyMemory( &g_scShortcuts ,&g_ivConfig->Shortcuts, sizeof(SHORTCUTS) );
UpdateControllerStructures();
EndDialog( hDlg, TRUE );
return TRUE;
case IDCANCEL:
if( hTabControl )
{
DestroyWindow( hTabControl );
hTabControl = NULL;
}
EndDialog( hDlg, FALSE );
return TRUE;
case IDC_LANGUAGE:
if( HIWORD(wParam) == CBN_SELCHANGE )
{
i = SendMessage( hDlgItem, CB_GETCURSEL, 0, 0 );
g_ivConfig->Language = (LANGID) SendMessage( hDlgItem, CB_GETITEMDATA, i, 0 );
}
return TRUE;
case IDC_STOREINDB:
case IDC_UPDATEDB:
case IDC_ERASEFROMDB:
case IDC_SAVEPROFILE:
case IDC_LOADPROFILE:
// we don't have handlers for these, so fall through to FALSE
default:
return FALSE;
}
case WM_CLOSE:
if( hTabControl )
{
DestroyWindow( hTabControl );
hTabControl = NULL;
}
EndDialog( hDlg, FALSE );
return TRUE;
case WM_DESTROY:
if( hTabControl )
{
DestroyWindow( hTabControl );
hTabControl = NULL;
}
EnterCriticalSection(&g_critical);
ReleaseEffect( g_pConfigEffect );
ReleaseDevice( g_pConfigDevice );
for( i = 0; i < 4; ++i )
{
freePakData( &g_ivConfig->Controllers[i] );
freeModifiers( &g_ivConfig->Controllers[i] );
}
P_free( g_ivConfig );
g_ivConfig = NULL;
DebugWriteA("Config interface: Closed\n");
LeaveCriticalSection(&g_critical);
return TRUE;
case WM_USER_UPDATE:
#ifdef _UNICODE
// filling DropDownlist with languages
hDlgItem = GetDlgItem( hDlg, IDC_LANGUAGE );
SendMessage (hDlgItem, CB_RESETCONTENT, 0, 0);
{
TCHAR szBuffer[MAX_PATH];
TCHAR * pSlash;
WIN32_FIND_DATA fData;
long lLangFound = 0; // the index matching our current language
VerLanguageName(0x0009, szBuffer, DEFAULT_BUFFER); // English (default resource)
j = SendMessage( hDlgItem, CB_ADDSTRING, 0, (LPARAM)szBuffer );
SendMessage( hDlgItem, CB_SETITEMDATA, j, 0 );
GetModuleFileName( NULL, szBuffer, MAX_PATH );
pSlash = _tcsrchr( szBuffer, '\\' );
_tcscpy(pSlash + 1, _T("NRage-Language-*.dll"));
// Search for any file available called NRage-Language-XXXX.dll (where X is numbers)
HANDLE fSearch = FindFirstFile(szBuffer, &fData);
while ( fSearch != INVALID_HANDLE_VALUE )
{
DWORD dwLangID = 0;
if (_stscanf(fData.cFileName, _T("NRage-Language-%u.dll"), &dwLangID))
{
VerLanguageName(dwLangID, szBuffer, DEFAULT_BUFFER);
j = SendMessage( hDlgItem, CB_ADDSTRING, 0, (LPARAM)szBuffer );
SendMessage( hDlgItem, CB_SETITEMDATA, j, dwLangID );
if (dwLangID == g_ivConfig->Language)
lLangFound = j;
}
if (!FindNextFile(fSearch, &fData))
fSearch = INVALID_HANDLE_VALUE;
}
FindClose(fSearch);
SendMessage( hDlgItem, CB_SETCURSEL, lLangFound, 0 ); // set combo box selection
}
// DropDownlist End
#else
hDlgItem = GetDlgItem( hDlg, IDC_LANGUAGE );
SendMessage(hDlgItem, CB_RESETCONTENT, 0, 0);
j = SendMessage(hDlgItem, CB_ADDSTRING, 0, (LPARAM) _T("Language selection disabled"));
SendMessage( hDlgItem, CB_SETITEMDATA, j, 0 );
SendMessage(hDlgItem, CB_SETCURSEL, 0, 0);
#endif // #ifdef _UNICODE
// call child-dialog(s) to update their content as well
if( hTabControl )
SendMessage( hTabControl, WM_USER_UPDATE, 0, 0 );
return TRUE;
default:
return FALSE; //false means the msg didn't got processed
}
// return TRUE; //msg got processed
}
BOOL CALLBACK ControllerTabProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
static HWND hTabControl;
CONTROLLER *pcController = &g_ivConfig->Controllers[g_ivConfig->ChosenTab];;
HWND hDlgItem;
long i,j;
switch(uMsg)
{
case WM_INITDIALOG:
hTabControl = NULL;
// Tab - Control //
hDlgItem = GetDlgItem( hDlg, IDC_CONTROLLERTAB );
TCITEM tcItem;
tcItem.mask = TCIF_TEXT;
TCHAR tszText[DEFAULT_BUFFER];
tcItem.pszText = tszText;
LoadString( g_hResourceDLL, IDS_TAB_CONTROLS, tszText, DEFAULT_BUFFER );
TabCtrl_InsertItem( hDlgItem, TAB_CONTROLS, &tcItem );
LoadString( g_hResourceDLL, IDS_TAB_DEVICES, tszText, DEFAULT_BUFFER );
TabCtrl_InsertItem( hDlgItem, TAB_DEVICES, &tcItem );
LoadString( g_hResourceDLL, IDS_TAB_MODIFIERS, tszText, DEFAULT_BUFFER );
TabCtrl_InsertItem( hDlgItem, TAB_MODIFIERS, &tcItem );
LoadString( g_hResourceDLL, IDS_TAB_CONTROLLERPAK, tszText, DEFAULT_BUFFER );
TabCtrl_InsertItem( hDlgItem, TAB_PAK, &tcItem );
NMHDR nmInit;
nmInit.hwndFrom = hDlgItem;
nmInit.idFrom = IDC_CONTROLLERTAB;
nmInit.code = TCN_SELCHANGE;
// initiate Tab-Display
ControllerTabProc( hDlg, WM_NOTIFY, IDC_CONTROLLERTAB, (LPARAM)&nmInit );
// Tab - Control End //
// call routine to show content( recursive call )
ControllerTabProc( hDlg, WM_USER_UPDATE, 0, 0 );
return FALSE; // don't give it focus
case WM_NOTIFY:
hDlgItem = ((LPNMHDR)lParam)->hwndFrom;
i = ((LPNMHDR)lParam)->code;
j = ((LPNMHDR)lParam)->idFrom;
switch( j )
{
case IDC_CONTROLLERTAB:
if( i == TCN_SELCHANGE )
{
if( hTabControl )
DestroyWindow( hTabControl );
i = TabCtrl_GetCurSel( hDlgItem );
switch( i )
{
case TAB_CONTROLS:
if( pcController->fXInput) // added to show the xinput controller config tab --tecnicors
hTabControl = CreateDialog ( g_hResourceDLL, MAKEINTRESOURCE( IDD_XCONTROLS ), hDlg, XControlsTabProc );
else
hTabControl = CreateDialog( g_hResourceDLL, MAKEINTRESOURCE( IDD_CONTROLS ), hDlg, ControlsTabProc );
break;
case TAB_DEVICES:
hTabControl = CreateDialog( g_hResourceDLL, MAKEINTRESOURCE( IDD_DEVICES ), hDlg, DevicesTabProc );
break;
case TAB_MODIFIERS:
hTabControl = CreateDialog( g_hResourceDLL, MAKEINTRESOURCE( IDD_MODIFIER ), hDlg, ModifierTabProc );
break;
case TAB_PAK:
hTabControl = CreateDialog( g_hResourceDLL, MAKEINTRESOURCE( IDD_CONTROLLERPAK ), hDlg, ControllerPakTabProc );
break;
default:
hTabControl = NULL;
return TRUE;
}
hDlgItem = GetDlgItem( hDlg, IDC_CONTROLLERTAB );
RECT rectWindow,
rectTab, rectMain; // need to know the position of the calling tab window relative to its parent
GetWindowRect( hDlg, &rectMain );
GetWindowRect( hDlgItem, &rectTab );
GetClientRect( hDlgItem, &rectWindow );
TabCtrl_AdjustRect( hDlgItem, FALSE, &rectWindow );
MoveWindow( hTabControl, rectWindow.left + (rectTab.left - rectMain.left), rectWindow.top + (rectTab.top - rectMain.top), rectWindow.right - rectWindow.left, rectWindow.bottom - rectWindow.top, FALSE );
ShowWindow( hTabControl, SW_SHOW );
return TRUE;
}
else
return FALSE;
default:
return FALSE;
}
case WM_COMMAND:
hDlgItem = GetDlgItem( hDlg, LOWORD(wParam) );
switch( LOWORD(wParam) )
{
TCHAR tszTitle[DEFAULT_BUFFER], tszText[DEFAULT_BUFFER];
case IDC_PLUGGED:
pcController->fPlugged = ( IsDlgButtonChecked( hDlg, LOWORD(wParam) ) == BST_CHECKED );
return TRUE;
case IDC_CLEARCONTROLLER:
LoadString( g_hResourceDLL, IDS_DLG_CLEAR, tszText, DEFAULT_BUFFER );
LoadString( g_hResourceDLL, IDS_DLG_CLEAR_TITLE, tszTitle, DEFAULT_BUFFER );
if( MessageBox( hDlg, tszText, tszTitle, MB_OKCANCEL | MB_ICONWARNING ) == IDOK )
{
DeleteControllerSettings( g_ivConfig->ChosenTab );
ControllerTabProc( hDlg, WM_USER_UPDATE, 0, 0 );
}
return TRUE;
case IDC_SETDEFAULT:
LoadString( g_hResourceDLL, IDS_DLG_CONTROLRESTORE, tszText, DEFAULT_BUFFER );
LoadString( g_hResourceDLL, IDS_DLG_CONTROLRESTORE_TITLE, tszTitle, DEFAULT_BUFFER );
if( MessageBox( hDlg, tszText, tszTitle, MB_OKCANCEL | MB_ICONWARNING ) == IDOK )
{
DeleteControllerSettings( g_ivConfig->ChosenTab );
LoadProfileFromResource( g_ivConfig->ChosenTab, true);
*(g_ivConfig->FFDevices[g_ivConfig->ChosenTab].szProductName) = '\0'; // default profile has no FF device
g_ivConfig->FFDevices[g_ivConfig->ChosenTab].bProductCounter = 0;
ControllerTabProc( hDlg, WM_USER_UPDATE, 0, 0 );
}
return TRUE;
case IDC_SAVEPROFILE:
{
TCHAR szFilename[MAX_PATH+1] = _T("");
if( BrowseFile( hDlg, szFilename, BF_PROFILE, BF_SAVE ))
{
FILE * fFile = _tfopen( szFilename, _T("wS") );
if (fFile)
{
fprintf(fFile, "@" STRING_PROFILEVERSION "\n\n");
FormatProfileBlock( fFile, g_ivConfig->ChosenTab );
fclose(fFile);
}
else
WarningMessage( IDS_ERR_PROFWRITE, MB_OK );
}
}
return TRUE;
case IDC_LOADPROFILE:
{
TCHAR szFilename[MAX_PATH+1] = TEXT( "" );
if( BrowseFile( hDlg, szFilename, BF_PROFILE, BF_LOAD ))
{
DebugWrite(_T("Config interface: Load shortcuts file: %s\n"), szFilename);
if( LoadProfileFile( szFilename, g_ivConfig->ChosenTab, g_ivConfig->FFDevices[g_ivConfig->ChosenTab].szProductName, &g_ivConfig->FFDevices[g_ivConfig->ChosenTab].bProductCounter ))
ControllerTabProc( hDlg, WM_USER_UPDATE, 0, 0 );
else
WarningMessage( IDS_ERR_PROFREAD, MB_OK );
}
}
return TRUE;
case IDC_XINPUT_ENABLER: // change to xinput config --tecnicors
pcController->fXInput = ( IsDlgButtonChecked( hDlg, LOWORD(wParam) ) == BST_CHECKED );
if( hTabControl )
DestroyWindow( hTabControl );
if( pcController->fXInput )
hTabControl = CreateDialog ( g_hResourceDLL, MAKEINTRESOURCE( IDD_XCONTROLS ), hDlg, XControlsTabProc );
else
hTabControl = CreateDialog( g_hResourceDLL, MAKEINTRESOURCE( IDD_CONTROLS ), hDlg, ControlsTabProc );
{
hDlgItem = GetDlgItem( hDlg, IDC_CONTROLLERTAB );
RECT rectWindow,
rectTab, rectMain; // need to know the position of the calling tab window relative to its parent
GetWindowRect( hDlg, &rectMain );
GetWindowRect( hDlgItem, &rectTab );
GetClientRect( hDlgItem, &rectWindow );
TabCtrl_AdjustRect( hDlgItem, FALSE, &rectWindow );
MoveWindow( hTabControl, rectWindow.left + (rectTab.left - rectMain.left), rectWindow.top + (rectTab.top - rectMain.top), rectWindow.right - rectWindow.left, rectWindow.bottom - rectWindow.top, FALSE );
ShowWindow( hTabControl, SW_SHOW );
}
return TRUE; // END IDC_XINPUT_ENABLER
default:
return FALSE;
}
case WM_USER_UPDATE:
// for this dialog
CheckDlgButton( hDlg, IDC_PLUGGED, pcController->fPlugged ? BST_CHECKED : BST_UNCHECKED );
CheckDlgButton( hDlg, IDC_XINPUT_ENABLER, pcController->fXInput ? BST_CHECKED : BST_UNCHECKED );
if( hTabControl )
DestroyWindow( hTabControl );
if( pcController->fXInput )
hTabControl = CreateDialog ( g_hResourceDLL, MAKEINTRESOURCE( IDD_XCONTROLS ), hDlg, XControlsTabProc );
else
hTabControl = CreateDialog( g_hResourceDLL, MAKEINTRESOURCE( IDD_CONTROLS ), hDlg, ControlsTabProc );
{
hDlgItem = GetDlgItem( hDlg, IDC_CONTROLLERTAB );
RECT rectWindow,
rectTab, rectMain; // need to know the position of the calling tab window relative to its parent
GetWindowRect( hDlg, &rectMain );
GetWindowRect( hDlgItem, &rectTab );
GetClientRect( hDlgItem, &rectWindow );
TabCtrl_AdjustRect( hDlgItem, FALSE, &rectWindow );
MoveWindow( hTabControl, rectWindow.left + (rectTab.left - rectMain.left), rectWindow.top + (rectTab.top - rectMain.top), rectWindow.right - rectWindow.left, rectWindow.bottom - rectWindow.top, FALSE );
ShowWindow( hTabControl, SW_SHOW );
}
// call child-dialog(s) to update their content as well
if( hTabControl )
SendMessage( hTabControl, WM_USER_UPDATE, 0, 0 );
return TRUE;
default:
return FALSE; //false means the msg didn't got processed
}
}
// "Controls" tab
BOOL CALLBACK ControlsTabProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
static LPBUTTON aButtons = NULL; // should point to g_ivConfig->Controllers[g_ivConfig->ChosenTab].aButton array
static DWORD dwButtonID[3]; // 0:ID of PushButton 1:ID of TextWindow 2:offset in aButtons struct
static DWORD dwCounter;
static bool bScanRunning;
static HWND hFocus = NULL;
static HWND hBlocker = NULL;
TCHAR szBuffer[40], szTemp[40];
HWND hDlgItem;
long i;
switch(uMsg)
{
case WM_INITDIALOG:
// SetTicks on TrackBar
hDlgItem = GetDlgItem( hDlg, IDC_CTRRANGE );
SendMessage( hDlgItem, TBM_SETRANGE, (WPARAM) TRUE, (LPARAM) MAKELONG( 0, 100 ));
SendMessage( hDlgItem, TBM_SETTICFREQ, (WPARAM) 10, 0 );
SendMessage( hDlgItem, TBM_SETPAGESIZE, (WPARAM) 0, 1 );
// SetTicks on RapidFire Bar
hDlgItem = GetDlgItem( hDlg, IDC_RAPIDFIRERATE );
SendMessage( hDlgItem, TBM_SETRANGE, (WPARAM) TRUE, (LPARAM) MAKELONG( 0, 32 ));
SendMessage( hDlgItem, TBM_SETTICFREQ, (WPARAM) 1, 0 );
SendMessage( hDlgItem, TBM_SETPAGESIZE, (WPARAM) 0, 1 );
// call routine to show content( recursive call )
ControlsTabProc( hDlg, WM_USER_UPDATE, 0, 0 );
return FALSE; // don't give it focus
case WM_COMMAND:
hDlgItem = GetDlgItem( hDlg, LOWORD(wParam) );
switch( LOWORD(wParam) )
{
case IDC_N64RANGE:
g_ivConfig->Controllers[g_ivConfig->ChosenTab].fRealN64Range = ( IsDlgButtonChecked( hDlg, LOWORD(wParam) ) == BST_CHECKED );
return TRUE;
case IDC_RAPIDFIREENABLE:
g_ivConfig->Controllers[g_ivConfig->ChosenTab].bRapidFireEnabled = (IsDlgButtonChecked( hDlg, LOWORD(wParam)) == BST_CHECKED);
return TRUE;
case IDC_CONFIG1:
case IDC_CONFIG2:
case IDC_CONFIG3:
if( HIWORD(wParam) == BN_CLICKED )
{
if( LOWORD(wParam) == IDC_CONFIG1 )
g_ivConfig->Controllers[g_ivConfig->ChosenTab].bAxisSet = 0;
else if( LOWORD(wParam) == IDC_CONFIG2 )
g_ivConfig->Controllers[g_ivConfig->ChosenTab].bAxisSet = 1;
else if( LOWORD(wParam) == IDC_CONFIG3 )
g_ivConfig->Controllers[g_ivConfig->ChosenTab].bAxisSet = 2;
ControlsTabProc( hDlg, WM_USER_UPDATE, 1, 0 );
}
return TRUE;
case IDC_LEFTTRIGGER:
case IDC_RIGHTTRIGGER:
case IDC_ZTRIGGER:
case IDC_DUP:
case IDC_DLEFT:
case IDC_DRIGHT:
case IDC_DDOWN:
case IDC_AUP:
case IDC_ALEFT:
case IDC_ARIGHT:
case IDC_ADOWN:
case IDC_CUP:
case IDC_CLEFT:
case IDC_CRIGHT:
case IDC_CDOWN:
case IDC_ABUTTON:
case IDC_BBUTTON:
case IDC_SBUTTON: // any of these cases means user wants to assign a button
if( bScanRunning )
{ ; // do nothing
/* bScanRunning = false;
KillTimer( hDlg, TIMER_BUTTON );
GetButtonText( aButtons[dwButtonID[2]], szBuffer );
SendMessage( GetDlgItem( hDlg, dwButtonID[1] ), WM_SETTEXT , 0, (LPARAM)szBuffer ); */
}
else if( HIWORD(wParam) == BN_CLICKED )
{
EnterCriticalSection(&g_critical);
dwButtonID[0] = LOWORD(wParam);
dwCounter = 0;
GetButtonID( dwButtonID, 0, BSET_CONTROLS );
if( dwButtonID[2] >= PF_APADR )
dwButtonID[2] += g_ivConfig->Controllers[g_ivConfig->ChosenTab].bAxisSet * 4;
if (hFocus == NULL)
hFocus = SetFocus( NULL );
hBlocker = MakeOverlay();
SetTimer( hDlg, TIMER_BUTTON, INTERVAL_BUTTON, NULL );
bScanRunning = true;
LeaveCriticalSection(&g_critical);
}
return TRUE;
default:
return FALSE;
}
case WM_TIMER: // when assigning buttons, this gets called every 20ms (or value in INTERVAL_BUTTON)
if( wParam == TIMER_BUTTON && bScanRunning )
{
BUTTON newButton;
i = ScanDevices( &dwCounter, &newButton);
if( i || dwCounter > 500 )
{
bScanRunning = false;
KillTimer( hDlg, TIMER_BUTTON );
EnterCriticalSection(&g_critical);
if( i == SC_SCANESCAPE ) // Scan aborted
ZeroMemory(&aButtons[dwButtonID[2]], sizeof(BUTTON)); //aButtons[dwButtonID[2]].dwButton = 0;
else if( i == SC_SCANSUCCEED ) // Got a key, mouseclick, joybutton, or axis
aButtons[dwButtonID[2]] = newButton;
DestroyWindow( hBlocker );
LeaveCriticalSection(&g_critical);
GetButtonText( aButtons[dwButtonID[2]], szBuffer );
SendMessage( GetDlgItem( hDlg, dwButtonID[1] ), WM_SETTEXT , 0, (LPARAM)szBuffer );
if( hFocus != NULL )
{
SetFocus( hFocus );
hFocus = NULL;
}
}
else
{
if(( dwCounter % 50 ) == 0 )
{
TCHAR tszText[DEFAULT_BUFFER];
LoadString( g_hResourceDLL, IDS_C_POLLING, tszText, DEFAULT_BUFFER );
wsprintf( szBuffer, tszText, 10 - dwCounter / 50 );
SendMessage( GetDlgItem( hDlg, dwButtonID[1] ), WM_SETTEXT , 0, (LPARAM)szBuffer );
}
++dwCounter;
}
return TRUE;
}
else
return FALSE;
case WM_HSCROLL: // TrackBars
case WM_VSCROLL:
switch ( GetWindowLong( (HWND)lParam, GWL_ID ) )
{
case IDC_CTRRANGE:
TCHAR tszText[DEFAULT_BUFFER];
LoadString( g_hResourceDLL, IDS_C_RANGE, tszText, DEFAULT_BUFFER );
g_ivConfig->Controllers[g_ivConfig->ChosenTab].bStickRange = (BYTE)SendMessage( (HWND)lParam, TBM_GETPOS, 0, 0 );
wsprintf( szBuffer, tszText, g_ivConfig->Controllers[g_ivConfig->ChosenTab].bStickRange );
SendMessage( GetDlgItem( hDlg, IDT_RANGE ), WM_SETTEXT , 0, (LPARAM)szBuffer );
return TRUE;
case IDC_RAPIDFIRERATE:
g_ivConfig->Controllers[g_ivConfig->ChosenTab].bRapidFireRate = 33 - (BYTE)SendMessage( (HWND)lParam, TBM_GETPOS, 0, 0 );
return TRUE;
default:
return FALSE;
}
case WM_USER_UPDATE:
bScanRunning = false;
KillTimer( hDlg, TIMER_BUTTON );
EnterCriticalSection(&g_critical);
aButtons = g_ivConfig->Controllers[g_ivConfig->ChosenTab].aButton;
LeaveCriticalSection(&g_critical);
if( wParam == 0 )
{
CheckDlgButton( hDlg, IDC_N64RANGE, g_ivConfig->Controllers[g_ivConfig->ChosenTab].fRealN64Range ? BST_CHECKED : BST_UNCHECKED );
CheckDlgButton( hDlg, IDC_RAPIDFIREENABLE, g_ivConfig->Controllers[g_ivConfig->ChosenTab].bRapidFireEnabled ? BST_CHECKED : BST_UNCHECKED );
CheckDlgButton( hDlg, IDC_CONFIG1, ( g_ivConfig->Controllers[g_ivConfig->ChosenTab].bAxisSet == 0 ) ? BST_CHECKED : BST_UNCHECKED );
CheckDlgButton( hDlg, IDC_CONFIG2, ( g_ivConfig->Controllers[g_ivConfig->ChosenTab].bAxisSet == 1 ) ? BST_CHECKED : BST_UNCHECKED );
CheckDlgButton( hDlg, IDC_CONFIG3, ( g_ivConfig->Controllers[g_ivConfig->ChosenTab].bAxisSet == 2 ) ? BST_CHECKED : BST_UNCHECKED );
SendMessage( GetDlgItem( hDlg, IDC_CTRRANGE ), TBM_SETPOS, TRUE, g_ivConfig->Controllers[g_ivConfig->ChosenTab].bStickRange );
LoadString( g_hResourceDLL, IDS_C_RANGE, szTemp, 40 );
wsprintf( szBuffer, szTemp, g_ivConfig->Controllers[g_ivConfig->ChosenTab].bStickRange );
SendMessage( GetDlgItem( hDlg, IDT_RANGE ), WM_SETTEXT , 0, (LPARAM)szBuffer );
SendMessage( GetDlgItem( hDlg, IDC_RAPIDFIRERATE ), TBM_SETPOS, TRUE, 33 - g_ivConfig->Controllers[g_ivConfig->ChosenTab].bRapidFireRate );
i = 0;
}
else
i = PF_APADR;
for( ;i < 18; ++i )
{
DWORD dwIDs[3];
dwIDs[2] = i;
if( !GetButtonID( dwIDs, 2, BSET_CONTROLS ))
continue;
if( dwIDs[2] >= PF_APADR )
dwIDs[2] += g_ivConfig->Controllers[g_ivConfig->ChosenTab].bAxisSet * 4;
GetButtonText( aButtons[dwIDs[2]], szBuffer );
SendMessage( GetDlgItem( hDlg, dwIDs[1] ), WM_SETTEXT , 0, (LPARAM)szBuffer );
}
return TRUE;
default:
return FALSE; //false means the msg didn't got processed
}
// return TRUE; //msg got processed
}
// XInput controllers tab --tecnicors
BOOL CALLBACK XControlsTabProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
LPXCONTROLLER gController = &g_ivConfig->Controllers[g_ivConfig->ChosenTab].xiController;
switch( uMsg )
{
case WM_INITDIALOG:
for( int i = IDC_XC_A; i <= IDC_XC_START; i++ )
FillN64ButtonComboBox( hDlg, i );
for( int i = IDC_XC_DPAD; i <= IDC_XC_RTS; i++ )
FillN64AnalogComboBox( hDlg, i );
XControlsTabProc( hDlg, WM_USER_UPDATE, 0, 0 );
return FALSE;
case WM_USER_UPDATE:
{
TCHAR buffer[MAX_PATH];
GetDirectory( buffer, DIRECTORY_DLL );
_stprintf_s( buffer, _T("%sXInput Controller %d Config.xcc"), buffer, gController->nControl + 1 );
FILE *saveFile = _tfopen( buffer, _T("rS") );
if( saveFile )
{
LoadXInputConfigFromFile( saveFile, gController );
fclose( saveFile );
}
}
if( !ReadXInputControllerKeys( hDlg, gController ))
for( int i = IDC_XC_A; i <= IDC_XC_RTS; i++ )
SendDlgItemMessage( hDlg, i, CB_SETCURSEL, 0, ( LPARAM )0 );
return TRUE;
case WM_COMMAND:
switch( LOWORD( wParam ))
{
case IDC_XC_USE:
StoreXInputControllerKeys( hDlg, gController );
{
TCHAR buffer[MAX_PATH];
GetDirectory( buffer, DIRECTORY_DLL );
_stprintf_s( buffer, _T("%sXInput Controller %d Config.xcc"), buffer, gController->nControl + 1 );
FILE *saveFile = _tfopen( buffer, _T("wS") );
SaveXInputConfigToFile( saveFile, gController );
fclose( saveFile );
}
return TRUE;
}
return FALSE;
default:
return FALSE;
}
}// END Xinput Controller Tab --tecnicors
BOOL CALLBACK DevicesTabProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
CONTROLLER *pcController = &g_ivConfig->Controllers[g_ivConfig->ChosenTab];
TCHAR szBuffer[DEFAULT_BUFFER], szTemp[DEFAULT_BUFFER];
HWND hDlgItem;
long i;
switch(uMsg)
{
case WM_INITDIALOG:
// TrackBars
hDlgItem = GetDlgItem( hDlg, IDC_DEADZONE );
SendMessage( hDlgItem, TBM_SETRANGE, (WPARAM) TRUE, (LPARAM) MAKELONG( 0, 100 ));
SendMessage( hDlgItem, TBM_SETTICFREQ, (WPARAM) 10, 0 );
SendMessage( hDlgItem, TBM_SETPAGESIZE, (WPARAM) 0, 1 );
hDlgItem = GetDlgItem( hDlg, IDC_MSSENSITIVITY_X );
SendMessage( hDlgItem, TBM_SETRANGE, (WPARAM) TRUE, (LPARAM) MAKELONG( 0, 1000 ));
SendMessage( hDlgItem, TBM_SETPAGESIZE, (WPARAM) 0, 1 );
hDlgItem = GetDlgItem( hDlg, IDC_MSSENSITIVITY_Y );
SendMessage( hDlgItem, TBM_SETRANGE, (WPARAM) TRUE, (LPARAM) MAKELONG( 0, 1000 ));
SendMessage( hDlgItem, TBM_SETPAGESIZE, (WPARAM) 0, 1 );
{
short sTics[] = { 25, 50, 75, 100, 125, 150, 200, 250, 300, 400, 500, 600, 700, 800, 900 };
for( i = 0; i < (sizeof(sTics) / sizeof(short)); ++i )
SendMessage( hDlgItem, TBM_SETTIC, 0, sTics[i] );
}
// TrackBars End
DevicesTabProc( hDlg, WM_USER_UPDATE, 0, 0 ); // setting values
return FALSE; // don't give it focus
case WM_COMMAND:
hDlgItem = GetDlgItem( hDlg, LOWORD(wParam) );
switch( LOWORD(wParam) )
{
case IDC_DEADPANMOUSEX:
if( LOWORD(wParam) == IDC_DEADPANMOUSEX )
i = MM_DEAD;
case IDC_BUFFEREDMOUSEX:
if( LOWORD(wParam) == IDC_BUFFEREDMOUSEX )
i = MM_BUFF;
case IDC_ABSOLUTEMOUSEX:
if( LOWORD(wParam) == IDC_ABSOLUTEMOUSEX )
i = MM_ABS;
if(( HIWORD(wParam) == BN_CLICKED ) && ( IsDlgButtonChecked( hDlg, LOWORD(wParam) ) == BST_CHECKED ))
pcController->bMouseMoveX = i;
return TRUE;
case IDC_DEADPANMOUSEY:
if( LOWORD(wParam) == IDC_DEADPANMOUSEY )
i = MM_DEAD;
case IDC_BUFFEREDMOUSEY:
if( LOWORD(wParam) == IDC_BUFFEREDMOUSEY )
i = MM_BUFF;
case IDC_ABSOLUTEMOUSEY:
if( LOWORD(wParam) == IDC_ABSOLUTEMOUSEY )
i = MM_ABS;
if(( HIWORD(wParam) == BN_CLICKED ) && ( IsDlgButtonChecked( hDlg, LOWORD(wParam) ) == BST_CHECKED ))
pcController->bMouseMoveY = i;
return TRUE;
case IDC_ACCELERATEX:
pcController->fKeyAbsoluteX = ( IsDlgButtonChecked( hDlg, LOWORD(wParam) ) == BST_CHECKED );
return TRUE;
case IDC_ACCELERATEY:
pcController->fKeyAbsoluteY = ( IsDlgButtonChecked( hDlg, LOWORD(wParam) ) == BST_CHECKED );
return TRUE;
default:
return FALSE;
}
case WM_HSCROLL: // TrackBars
case WM_VSCROLL:
i = GetWindowLong( (HWND)lParam, GWL_ID );
switch( i )
{
case IDC_MSSENSITIVITY_X:
pcController->wMouseSensitivityX = (WORD)SendMessage( (HWND)lParam, TBM_GETPOS, 0, 0 );
LoadString( g_hResourceDLL, IDS_D_MSX, szTemp, DEFAULT_BUFFER );
wsprintf( szBuffer, szTemp, pcController->wMouseSensitivityX );
SendMessage( GetDlgItem( hDlg, IDT_MSSENSITIVITY_X ), WM_SETTEXT , 0, (LPARAM)szBuffer );
return TRUE;
case IDC_MSSENSITIVITY_Y:
pcController->wMouseSensitivityY = (WORD)SendMessage( (HWND)lParam, TBM_GETPOS, 0, 0 );
LoadString( g_hResourceDLL, IDS_D_MSY, szTemp, DEFAULT_BUFFER );
wsprintf( szBuffer, szTemp, pcController->wMouseSensitivityY );
SendMessage( GetDlgItem( hDlg, IDT_MSSENSITIVITY_Y ), WM_SETTEXT , 0, (LPARAM)szBuffer );
return TRUE;
case IDC_DEADZONE:
pcController->bPadDeadZone = (BYTE)SendMessage( (HWND)lParam, TBM_GETPOS, 0, 0 );
LoadString( g_hResourceDLL, IDS_D_DEADZONE, szTemp, DEFAULT_BUFFER );
wsprintf( szBuffer, szTemp, pcController->bPadDeadZone );
SendMessage( GetDlgItem( hDlg, IDT_DEADZONE ), WM_SETTEXT , 0, (LPARAM)szBuffer );
return TRUE;
default:
return FALSE;
}
case WM_USER_UPDATE:
if( pcController->bMouseMoveX == MM_DEAD )
CheckDlgButton( hDlg, IDC_DEADPANMOUSEX, BST_CHECKED );
else
CheckDlgButton( hDlg, IDC_DEADPANMOUSEX, BST_UNCHECKED );
if( pcController->bMouseMoveX == MM_BUFF )
CheckDlgButton( hDlg, IDC_BUFFEREDMOUSEX, BST_CHECKED );
else
CheckDlgButton( hDlg, IDC_BUFFEREDMOUSEX, BST_UNCHECKED );
if( pcController->bMouseMoveX == MM_ABS )
CheckDlgButton( hDlg, IDC_ABSOLUTEMOUSEX, BST_CHECKED );
else
CheckDlgButton( hDlg, IDC_ABSOLUTEMOUSEX, BST_UNCHECKED );
if( pcController->bMouseMoveY == MM_DEAD )
CheckDlgButton( hDlg, IDC_DEADPANMOUSEY, BST_CHECKED );
else
CheckDlgButton( hDlg, IDC_DEADPANMOUSEY, BST_UNCHECKED );
if( pcController->bMouseMoveY == MM_BUFF )
CheckDlgButton( hDlg, IDC_BUFFEREDMOUSEY, BST_CHECKED );
else
CheckDlgButton( hDlg, IDC_BUFFEREDMOUSEY, BST_UNCHECKED );
if( pcController->bMouseMoveY == MM_ABS )
CheckDlgButton( hDlg, IDC_ABSOLUTEMOUSEY, BST_CHECKED );