DXGL r568 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r567‎ | r568 | r569 >
Date:00:44, 19 November 2014
Author:admin
Status:new
Tags:
Comment:
Fill in several DXGLCFG2 controls.
Modified paths:
  • /cfgmgr/ReadMe.txt (modified) (history)
  • /cfgmgr/cfgmgr.c (modified) (history)
  • /dxglcfg2/dxglcfg2.c (modified) (history)
  • /dxglcfg2/dxglcfg2.rc (modified) (history)
  • /dxglcfg2/resource.h (modified) (history)

Diff [purge]

Index: cfgmgr/ReadMe.txt
@@ -32,10 +32,12 @@
3333 0 - Use native primary surface size. Most compatible.
3434 1 - Adjust primary surface size to match display.
3535 2 - Adjust primary surface to nearest integer multiple of native.
36 -3 - Use exact 2x scale.
37 -4 - Use exact 3x scale.
38 -5 - Use exact 4x scale.
39 -6 - Use custom scale.
 36+3 - Use exact 1.5x scale.
 37+4 - Use exact 2x scale.
 38+5 - Use exact 2.5x scale.
 39+6 - Use exact 3x scale.
 40+7 - Use exact 4x scale.
 41+8 - Use custom scale.
4042
4143 Member primaryscalex
4244 REG_DWORD HKCU\DXGL\<app>\PrimaryScaleX
Index: cfgmgr/cfgmgr.c
@@ -442,7 +442,7 @@
443443 cfg->primaryscaley = ReadFloat(hKey,cfg->primaryscaley,&cfgmask->primaryscaley,_T("PrimaryScaleY"));
444444 ReadPath(hKey,cfg->shaderfile,cfgmask->shaderfile,_T("ShaderFile"));
445445 cfg->SortModes = ReadDWORD(hKey,cfg->SortModes,&cfgmask->SortModes,_T("SortModes"));
446 - cfg->AddColorDepths = ReadDeprecatedBool(hKey, cfg->AddColorDepths, &cfgmask->AddColorDepths, _T("AddColorDepths"), 1 | 4 | 16, 0);
 446+ cfg->AddColorDepths = ReadDeprecatedBool(hKey, cfg->AddColorDepths, &cfgmask->AddColorDepths, _T("AllColorDepths"), 1 | 4 | 16, 0);
447447 cfg->AddColorDepths = ReadDWORD(hKey,cfg->AddColorDepths,&cfgmask->AddColorDepths,_T("AddColorDepths"));
448448 cfg->AddModes = ReadDeprecatedBool(hKey, cfg->AddModes, &cfgmask->AddModes, _T("ExtraModes"),7,0);
449449 cfg->AddModes = ReadDWORD(hKey, cfg->AddModes, &cfgmask->AddModes, _T("AddModes"));
Index: dxglcfg2/dxglcfg2.c
@@ -22,6 +22,7 @@
2323 #include <stdlib.h>
2424 #include <crtdbg.h>
2525 #include <windows.h>
 26+#include <windowsx.h>
2627 #include <HtmlHelp.h>
2728 #include <CommCtrl.h>
2829 #include <string.h>
@@ -79,6 +80,45 @@
8081 HWND hTabs[5];
8182 int tabopen;
8283
 84+static const TCHAR *colormodes[32] = {
 85+ _T("None"),
 86+ _T("8-bit"),
 87+ _T("15-bit"),
 88+ _T("8/15-bit"),
 89+ _T("16-bit"),
 90+ _T("8/16-bit"),
 91+ _T("8/15-bit"),
 92+ _T("8/15/16-bit"),
 93+ _T("24-bit"),
 94+ _T("8/24-bit"),
 95+ _T("15/24-bit"),
 96+ _T("8/15/24-bit"),
 97+ _T("16/24-bit"),
 98+ _T("8/16/24-bit"),
 99+ _T("8/15/24-bit"),
 100+ _T("8/15/16/24-bit"),
 101+ _T("32-bit"),
 102+ _T("8/32-bit"),
 103+ _T("15/32-bit"),
 104+ _T("8/15/32-bit"),
 105+ _T("16/32-bit"),
 106+ _T("8/16/32-bit"),
 107+ _T("8/15/32-bit"),
 108+ _T("8/15/16/32-bit"),
 109+ _T("24/32-bit"),
 110+ _T("8/24/32-bit"),
 111+ _T("15/24/32-bit"),
 112+ _T("8/15/24/32-bit"),
 113+ _T("16/24/32-bit"),
 114+ _T("8/16/24/32-bit"),
 115+ _T("8/15/24/32-bit"),
 116+ _T("8/15/16/24/32-bit")
 117+};
 118+
 119+LRESULT CALLBACK CheckedComboProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 120+{
 121+}
 122+
83123 DWORD AddApp(LPCTSTR path, BOOL copyfile, BOOL admin)
84124 {
85125 BOOL installed = FALSE;
@@ -310,6 +350,30 @@
311351 SendDlgItemMessage(hWnd,DlgItem,CB_SETCURSEL,value,0);
312352 }
313353
 354+__inline DWORD EncodePrimaryScale(DWORD scale)
 355+{
 356+ switch (scale)
 357+ {
 358+ case 0:
 359+ return 2;
 360+ case 1:
 361+ return 0;
 362+ case 2:
 363+ return 1;
 364+ default:
 365+ return scale;
 366+ }
 367+}
 368+
 369+void SetPrimaryScaleCombo(HWND hWnd, int DlgItem, DWORD value, DWORD mask, BOOL tristate)
 370+{
 371+ if (tristate && !mask)
 372+ SendDlgItemMessage(hWnd, DlgItem, CB_SETCURSEL,
 373+ SendDlgItemMessage(hWnd, DlgItem, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 374+ else
 375+ SendDlgItemMessage(hWnd, DlgItem, CB_SETCURSEL, EncodePrimaryScale(value), 0);
 376+}
 377+
314378 void SetAspectCombo(HWND hWnd, int DlgItem, float value, DWORD mask, BOOL tristate)
315379 {
316380 TCHAR buffer[32];
@@ -605,114 +669,130 @@
606670 tabopen = 0;
607671
608672 // Load global settings.
609 -/* // scaler
 673+ // scaler
610674 _tcscpy(buffer,_T("Change desktop resolution"));
611 - SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_ADDSTRING,0,(LPARAM)buffer);
 675+ SendDlgItemMessage(hTabs[0], IDC_VIDMODE, CB_ADDSTRING, 0, (LPARAM)buffer);
612676 _tcscpy(buffer,_T("Stretch to screen"));
613 - SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_ADDSTRING,1,(LPARAM)buffer);
 677+ SendDlgItemMessage(hTabs[0],IDC_VIDMODE,CB_ADDSTRING,1,(LPARAM)buffer);
614678 _tcscpy(buffer,_T("Aspect corrected stretch"));
615 - SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_ADDSTRING,2,(LPARAM)buffer);
 679+ SendDlgItemMessage(hTabs[0], IDC_VIDMODE, CB_ADDSTRING, 2, (LPARAM)buffer);
616680 _tcscpy(buffer,_T("Center image on screen"));
617 - SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_ADDSTRING,3,(LPARAM)buffer);
 681+ SendDlgItemMessage(hTabs[0], IDC_VIDMODE, CB_ADDSTRING, 3, (LPARAM)buffer);
618682 _tcscpy(buffer,_T("Stretch if mode not found"));
619 - SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_ADDSTRING,4,(LPARAM)buffer);
 683+ SendDlgItemMessage(hTabs[0], IDC_VIDMODE, CB_ADDSTRING, 4, (LPARAM)buffer);
620684 _tcscpy(buffer,_T("Scale if mode not found"));
621 - SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_ADDSTRING,5,(LPARAM)buffer);
 685+ SendDlgItemMessage(hTabs[0], IDC_VIDMODE, CB_ADDSTRING, 5, (LPARAM)buffer);
622686 _tcscpy(buffer,_T("Center if mode not found"));
623 - SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_ADDSTRING,6,(LPARAM)buffer);
 687+ SendDlgItemMessage(hTabs[0], IDC_VIDMODE, CB_ADDSTRING, 6, (LPARAM)buffer);
624688 _tcscpy(buffer,_T("Crop to screen (experimental)"));
625 - SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_ADDSTRING,7,(LPARAM)buffer);
626 - SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_SETCURSEL,cfg->scaler,0);
 689+ SendDlgItemMessage(hTabs[0],IDC_VIDMODE,CB_ADDSTRING,7,(LPARAM)buffer);
 690+ SendDlgItemMessage(hTabs[0],IDC_VIDMODE,CB_SETCURSEL,cfg->scaler,0);
627691 // colormode
628 - if(cfg->colormode) SendDlgItemMessage(hWnd,IDC_COLOR,BM_SETCHECK,BST_CHECKED,0);
629 - else SendDlgItemMessage(hWnd,IDC_COLOR,BM_SETCHECK,BST_UNCHECKED,0);
 692+ if (cfg->colormode) SendDlgItemMessage(hTabs[0], IDC_COLOR, BM_SETCHECK, BST_CHECKED, 0);
 693+ else SendDlgItemMessage(hTabs[0], IDC_COLOR, BM_SETCHECK, BST_UNCHECKED, 0);
630694 // scalingfilter
631695 _tcscpy(buffer,_T("Nearest"));
632 - SendDlgItemMessage(hWnd,IDC_SCALE,CB_ADDSTRING,0,(LPARAM)buffer);
 696+ SendDlgItemMessage(hTabs[0], IDC_SCALE, CB_ADDSTRING, 0, (LPARAM)buffer);
633697 _tcscpy(buffer,_T("Bilinear"));
634 - SendDlgItemMessage(hWnd,IDC_SCALE,CB_ADDSTRING,1,(LPARAM)buffer);
635 - SendDlgItemMessage(hWnd,IDC_SCALE,CB_SETCURSEL,cfg->scalingfilter,0);
 698+ SendDlgItemMessage(hTabs[0],IDC_SCALE,CB_ADDSTRING,1,(LPARAM)buffer);
 699+ SendDlgItemMessage(hTabs[0],IDC_SCALE,CB_SETCURSEL,cfg->scalingfilter,0);
636700 // aspect
637701 _tcscpy(buffer,_T("Default"));
638 - SendDlgItemMessage(hWnd,IDC_ASPECT,CB_ADDSTRING,0,(LPARAM)buffer);
 702+ SendDlgItemMessage(hTabs[0], IDC_ASPECT, CB_ADDSTRING, 0, (LPARAM)buffer);
639703 _tcscpy(buffer,_T("4:3"));
640 - SendDlgItemMessage(hWnd,IDC_ASPECT,CB_ADDSTRING,0,(LPARAM)buffer);
 704+ SendDlgItemMessage(hTabs[0], IDC_ASPECT, CB_ADDSTRING, 0, (LPARAM)buffer);
641705 _tcscpy(buffer,_T("16:10"));
642 - SendDlgItemMessage(hWnd,IDC_ASPECT,CB_ADDSTRING,0,(LPARAM)buffer);
 706+ SendDlgItemMessage(hTabs[0], IDC_ASPECT, CB_ADDSTRING, 0, (LPARAM)buffer);
643707 _tcscpy(buffer,_T("16:9"));
644 - SendDlgItemMessage(hWnd,IDC_ASPECT,CB_ADDSTRING,0,(LPARAM)buffer);
 708+ SendDlgItemMessage(hTabs[0], IDC_ASPECT, CB_ADDSTRING, 0, (LPARAM)buffer);
645709 _tcscpy(buffer,_T("5:4"));
646 - SendDlgItemMessage(hWnd,IDC_ASPECT,CB_ADDSTRING,0,(LPARAM)buffer);
647 - SetAspectCombo(hWnd, IDC_ASPECT, cfg->aspect, cfgmask->aspect, tristate);
648 -
649 - // highres
650 - if(cfg->highres) SendDlgItemMessage(hWnd,IDC_HIGHRES,BM_SETCHECK,BST_CHECKED,0);
651 - else SendDlgItemMessage(hWnd,IDC_HIGHRES,BM_SETCHECK,BST_UNCHECKED,0);
 710+ SendDlgItemMessage(hTabs[0], IDC_ASPECT, CB_ADDSTRING, 0, (LPARAM)buffer);
 711+ SetAspectCombo(hTabs[0], IDC_ASPECT, cfg->aspect, cfgmask->aspect, tristate);
 712+ // primaryscale
 713+ _tcscpy(buffer, _T("Auto (Window Size)"));
 714+ SendDlgItemMessage(hTabs[2], IDC_PRIMARYSCALE, CB_ADDSTRING, 0, (LPARAM)buffer);
 715+ _tcscpy(buffer, _T("Auto (Multiple of Native)"));
 716+ SendDlgItemMessage(hTabs[2], IDC_PRIMARYSCALE, CB_ADDSTRING, 1, (LPARAM)buffer);
 717+ _tcscpy(buffer, _T("1x Native (Recommended)"));
 718+ SendDlgItemMessage(hTabs[2], IDC_PRIMARYSCALE, CB_ADDSTRING, 2, (LPARAM)buffer);
 719+ _tcscpy(buffer, _T("1.5x Native"));
 720+ SendDlgItemMessage(hTabs[2], IDC_PRIMARYSCALE, CB_ADDSTRING, 3, (LPARAM)buffer);
 721+ _tcscpy(buffer, _T("2x Native"));
 722+ SendDlgItemMessage(hTabs[2], IDC_PRIMARYSCALE, CB_ADDSTRING, 4, (LPARAM)buffer);
 723+ _tcscpy(buffer, _T("2.5x Native"));
 724+ SendDlgItemMessage(hTabs[2], IDC_PRIMARYSCALE, CB_ADDSTRING, 5, (LPARAM)buffer);
 725+ _tcscpy(buffer, _T("3x Native"));
 726+ SendDlgItemMessage(hTabs[2], IDC_PRIMARYSCALE, CB_ADDSTRING, 6, (LPARAM)buffer);
 727+ _tcscpy(buffer, _T("4x Native"));
 728+ SendDlgItemMessage(hTabs[2], IDC_PRIMARYSCALE, CB_ADDSTRING, 7, (LPARAM)buffer);
 729+ _tcscpy(buffer, _T("Custom"));
 730+ SendDlgItemMessage(hTabs[2], IDC_PRIMARYSCALE, CB_ADDSTRING, 8, (LPARAM)buffer);
 731+ SetPrimaryScaleCombo(hTabs[2], IDC_PRIMARYSCALE, cfg->primaryscale, cfgmask->primaryscale, tristate);
652732 // texfilter
653733 _tcscpy(buffer,_T("Application default"));
654 - SendDlgItemMessage(hWnd,IDC_TEXFILTER,CB_ADDSTRING,0,(LPARAM)buffer);
 734+ SendDlgItemMessage(hTabs[1], IDC_TEXFILTER, CB_ADDSTRING, 0, (LPARAM)buffer);
655735 _tcscpy(buffer,_T("Nearest"));
656 - SendDlgItemMessage(hWnd,IDC_TEXFILTER,CB_ADDSTRING,1,(LPARAM)buffer);
 736+ SendDlgItemMessage(hTabs[1], IDC_TEXFILTER, CB_ADDSTRING, 1, (LPARAM)buffer);
657737 _tcscpy(buffer,_T("Bilinear"));
658 - SendDlgItemMessage(hWnd,IDC_TEXFILTER,CB_ADDSTRING,2,(LPARAM)buffer);
 738+ SendDlgItemMessage(hTabs[1], IDC_TEXFILTER, CB_ADDSTRING, 2, (LPARAM)buffer);
659739 _tcscpy(buffer,_T("Nearest, nearest mipmap"));
660 - SendDlgItemMessage(hWnd,IDC_TEXFILTER,CB_ADDSTRING,3,(LPARAM)buffer);
 740+ SendDlgItemMessage(hTabs[1], IDC_TEXFILTER, CB_ADDSTRING, 3, (LPARAM)buffer);
661741 _tcscpy(buffer,_T("Nearest, linear mipmap"));
662 - SendDlgItemMessage(hWnd,IDC_TEXFILTER,CB_ADDSTRING,4,(LPARAM)buffer);
 742+ SendDlgItemMessage(hTabs[1], IDC_TEXFILTER, CB_ADDSTRING, 4, (LPARAM)buffer);
663743 _tcscpy(buffer,_T("Bilinear, nearest mipmap"));
664 - SendDlgItemMessage(hWnd,IDC_TEXFILTER,CB_ADDSTRING,5,(LPARAM)buffer);
 744+ SendDlgItemMessage(hTabs[1], IDC_TEXFILTER, CB_ADDSTRING, 5, (LPARAM)buffer);
665745 _tcscpy(buffer,_T("Bilinear, linear mipmap"));
666 - SendDlgItemMessage(hWnd,IDC_TEXFILTER,CB_ADDSTRING,6,(LPARAM)buffer);
667 - SendDlgItemMessage(hWnd,IDC_TEXFILTER,CB_SETCURSEL,cfg->texfilter,0);
 746+ SendDlgItemMessage(hTabs[1],IDC_TEXFILTER,CB_ADDSTRING,6,(LPARAM)buffer);
 747+ SendDlgItemMessage(hTabs[1],IDC_TEXFILTER,CB_SETCURSEL,cfg->texfilter,0);
668748 // anisotropic
669749 if (anisotropic < 2)
670750 {
671751 _tcscpy(buffer,_T("Not supported"));
672 - SendDlgItemMessage(hWnd,IDC_ANISO,CB_ADDSTRING,0,(LPARAM)buffer);
673 - SendDlgItemMessage(hWnd,IDC_ANISO,CB_SETCURSEL,0,0);
674 - EnableWindow(GetDlgItem(hWnd,IDC_ANISO),FALSE);
 752+ SendDlgItemMessage(hTabs[1], IDC_ANISO, CB_ADDSTRING, 0, (LPARAM)buffer);
 753+ SendDlgItemMessage(hTabs[1], IDC_ANISO, CB_SETCURSEL, 0, 0);
 754+ EnableWindow(GetDlgItem(hTabs[1], IDC_ANISO), FALSE);
675755 cfg->anisotropic = 0;
676756 }
677757 else
678758 {
679759 _tcscpy(buffer,_T("Application default"));
680 - SendDlgItemMessage(hWnd,IDC_ANISO,CB_ADDSTRING,0,(LPARAM)buffer);
 760+ SendDlgItemMessage(hTabs[1], IDC_ANISO, CB_ADDSTRING, 0, (LPARAM)buffer);
681761 _tcscpy(buffer,_T("Disabled"));
682 - SendDlgItemMessage(hWnd,IDC_ANISO,CB_ADDSTRING,1,(LPARAM)buffer);
 762+ SendDlgItemMessage(hTabs[1], IDC_ANISO, CB_ADDSTRING, 1, (LPARAM)buffer);
683763 if(anisotropic >= 2)
684764 {
685765 _tcscpy(buffer,_T("2x"));
686 - SendDlgItemMessage(hWnd,IDC_ANISO,CB_ADDSTRING,2,(LPARAM)buffer);
 766+ SendDlgItemMessage(hTabs[1], IDC_ANISO, CB_ADDSTRING, 2, (LPARAM)buffer);
687767 }
688768 if(anisotropic >= 4)
689769 {
690770 _tcscpy(buffer,_T("4x"));
691 - SendDlgItemMessage(hWnd,IDC_ANISO,CB_ADDSTRING,4,(LPARAM)buffer);
 771+ SendDlgItemMessage(hTabs[1], IDC_ANISO, CB_ADDSTRING, 4, (LPARAM)buffer);
692772 }
693773 if(anisotropic >= 8)
694774 {
695775 _tcscpy(buffer,_T("8x"));
696 - SendDlgItemMessage(hWnd,IDC_ANISO,CB_ADDSTRING,8,(LPARAM)buffer);
 776+ SendDlgItemMessage(hTabs[1], IDC_ANISO, CB_ADDSTRING, 8, (LPARAM)buffer);
697777 }
698778 if(anisotropic >= 16)
699779 {
700780 _tcscpy(buffer,_T("16x"));
701 - SendDlgItemMessage(hWnd,IDC_ANISO,CB_ADDSTRING,16,(LPARAM)buffer);
 781+ SendDlgItemMessage(hTabs[1], IDC_ANISO, CB_ADDSTRING, 16, (LPARAM)buffer);
702782 }
703783 if(anisotropic >= 32)
704784 {
705785 _tcscpy(buffer,_T("32x"));
706 - SendDlgItemMessage(hWnd,IDC_ANISO,CB_ADDSTRING,4,(LPARAM)buffer);
 786+ SendDlgItemMessage(hTabs[1], IDC_ANISO, CB_ADDSTRING, 4, (LPARAM)buffer);
707787 }
708 - SendDlgItemMessage(hWnd,IDC_ANISO,CB_SETCURSEL,cfg->anisotropic,0);
 788+ SendDlgItemMessage(hTabs[1], IDC_ANISO, CB_SETCURSEL, cfg->anisotropic, 0);
709789 }
710790 // msaa
711791 if(msaa)
712792 {
713793 _tcscpy(buffer,_T("Application default"));
714 - SendDlgItemMessage(hWnd,IDC_MSAA,CB_ADDSTRING,0,(LPARAM)buffer);
 794+ SendDlgItemMessage(hTabs[1], IDC_MSAA, CB_ADDSTRING, 0, (LPARAM)buffer);
715795 _tcscpy(buffer,_T("Disabled"));
716 - SendDlgItemMessage(hWnd,IDC_MSAA,CB_ADDSTRING,1,(LPARAM)buffer);
 796+ SendDlgItemMessage(hTabs[1], IDC_MSAA, CB_ADDSTRING, 1, (LPARAM)buffer);
717797 if(maxcoverage)
718798 {
719799 for(i = 0; i < maxcoverage; i++)
@@ -720,7 +800,7 @@
721801 if((msaamodes[i] & 0xfff) <= 4)
722802 _sntprintf(buffer,64,_T("%dx"),msaamodes[i] & 0xfff);
723803 else _sntprintf(buffer,64,_T("%dx coverage, %dx color"),(msaamodes[i] & 0xfff), (msaamodes[i] >> 12));
724 - SendDlgItemMessage(hWnd,IDC_MSAA,CB_ADDSTRING,msaamodes[i],(LPARAM)buffer);
 804+ SendDlgItemMessage(hTabs[1], IDC_MSAA, CB_ADDSTRING, msaamodes[i], (LPARAM)buffer);
725805 }
726806 }
727807 else
@@ -728,59 +808,63 @@
729809 if(maxsamples >= 2)
730810 {
731811 _tcscpy(buffer,_T("2x"));
732 - SendDlgItemMessage(hWnd,IDC_MSAA,CB_ADDSTRING,2,(LPARAM)buffer);
 812+ SendDlgItemMessage(hTabs[1], IDC_MSAA, CB_ADDSTRING, 2, (LPARAM)buffer);
733813 }
734814 if(maxsamples >= 4)
735815 {
736816 _tcscpy(buffer,_T("4x"));
737 - SendDlgItemMessage(hWnd,IDC_MSAA,CB_ADDSTRING,4,(LPARAM)buffer);
 817+ SendDlgItemMessage(hTabs[1], IDC_MSAA, CB_ADDSTRING, 4, (LPARAM)buffer);
738818 }
739819 if(maxsamples >= 8)
740820 {
741821 _tcscpy(buffer,_T("8x"));
742 - SendDlgItemMessage(hWnd,IDC_MSAA,CB_ADDSTRING,8,(LPARAM)buffer);
 822+ SendDlgItemMessage(hTabs[1], IDC_MSAA, CB_ADDSTRING, 8, (LPARAM)buffer);
743823 }
744824 if(maxsamples >= 16)
745825 {
746826 _tcscpy(buffer,_T("16x"));
747 - SendDlgItemMessage(hWnd,IDC_MSAA,CB_ADDSTRING,16,(LPARAM)buffer);
 827+ SendDlgItemMessage(hTabs[1], IDC_MSAA, CB_ADDSTRING, 16, (LPARAM)buffer);
748828 }
749829 if(maxsamples >= 32)
750830 {
751831 _tcscpy(buffer,_T("32x"));
752 - SendDlgItemMessage(hWnd,IDC_MSAA,CB_ADDSTRING,32,(LPARAM)buffer);
 832+ SendDlgItemMessage(hTabs[1], IDC_MSAA, CB_ADDSTRING, 32, (LPARAM)buffer);
753833 }
754834 }
755 - SendDlgItemMessage(hWnd,IDC_MSAA,CB_SETCURSEL,cfg->msaa,0);
 835+ SendDlgItemMessage(hTabs[1], IDC_MSAA, CB_SETCURSEL, cfg->msaa, 0);
756836 }
757837 else
758838 {
759839 _tcscpy(buffer,_T("Not supported"));
760 - SendDlgItemMessage(hWnd,IDC_MSAA,CB_ADDSTRING,0,(LPARAM)buffer);
761 - SendDlgItemMessage(hWnd,IDC_MSAA,CB_SETCURSEL,0,0);
762 - EnableWindow(GetDlgItem(hWnd,IDC_MSAA),FALSE);
 840+ SendDlgItemMessage(hTabs[1], IDC_MSAA, CB_ADDSTRING, 0, (LPARAM)buffer);
 841+ SendDlgItemMessage(hTabs[1], IDC_MSAA, CB_SETCURSEL, 0, 0);
 842+ EnableWindow(GetDlgItem(hTabs[1], IDC_MSAA), FALSE);
763843 cfg->msaa = 0;
764844 }
765845 // aspect3d
766846 _tcscpy(buffer,_T("Stretch to display"));
767 - SendDlgItemMessage(hWnd,IDC_ASPECT3D,CB_ADDSTRING,0,(LPARAM)buffer);
 847+ SendDlgItemMessage(hTabs[1], IDC_ASPECT3D, CB_ADDSTRING, 0, (LPARAM)buffer);
768848 _tcscpy(buffer,_T("Expand viewable area"));
769 - SendDlgItemMessage(hWnd,IDC_ASPECT3D,CB_ADDSTRING,1,(LPARAM)buffer);
 849+ SendDlgItemMessage(hTabs[1], IDC_ASPECT3D, CB_ADDSTRING, 1, (LPARAM)buffer);
770850 _tcscpy(buffer,_T("Crop to display"));
771 - SendDlgItemMessage(hWnd,IDC_ASPECT3D,CB_ADDSTRING,2,(LPARAM)buffer);
772 - SendDlgItemMessage(hWnd,IDC_ASPECT3D,CB_SETCURSEL,cfg->aspect3d,0);
 851+ SendDlgItemMessage(hTabs[1],IDC_ASPECT3D,CB_ADDSTRING,2,(LPARAM)buffer);
 852+ SendDlgItemMessage(hTabs[1],IDC_ASPECT3D,CB_SETCURSEL,cfg->aspect3d,0);
773853 // sort modes
774854 _tcscpy(buffer,_T("Use system order"));
775 - SendDlgItemMessage(hWnd,IDC_SORTMODES,CB_ADDSTRING,0,(LPARAM)buffer);
 855+ SendDlgItemMessage(hTabs[0], IDC_SORTMODES, CB_ADDSTRING, 0, (LPARAM)buffer);
776856 _tcscpy(buffer,_T("Group by color depth"));
777 - SendDlgItemMessage(hWnd,IDC_SORTMODES,CB_ADDSTRING,1,(LPARAM)buffer);
 857+ SendDlgItemMessage(hTabs[0], IDC_SORTMODES, CB_ADDSTRING, 1, (LPARAM)buffer);
778858 _tcscpy(buffer,_T("Group by resolution"));
779 - SendDlgItemMessage(hWnd,IDC_SORTMODES,CB_ADDSTRING,2,(LPARAM)buffer);
780 - SendDlgItemMessage(hWnd,IDC_SORTMODES,CB_SETCURSEL,cfg->SortModes,0);
 859+ SendDlgItemMessage(hTabs[0],IDC_SORTMODES,CB_ADDSTRING,2,(LPARAM)buffer);
 860+ SendDlgItemMessage(hTabs[0],IDC_SORTMODES,CB_SETCURSEL,cfg->SortModes,0);
781861 // color depths
782 - if(cfg->AllColorDepths) SendDlgItemMessage(hWnd,IDC_UNCOMMONCOLOR,BM_SETCHECK,BST_CHECKED,0);
783 - else SendDlgItemMessage(hWnd,IDC_UNCOMMONCOLOR,BM_SETCHECK,BST_UNCHECKED,0);
784 - // extra modes
 862+ for (i = 0; i < 32; i++)
 863+ {
 864+ _tcscpy(buffer, colormodes[i]);
 865+ SendDlgItemMessage(hTabs[0], IDC_COLORDEPTH, CB_ADDSTRING, i, (LPARAM)buffer);
 866+ }
 867+ SendDlgItemMessage(hTabs[0], IDC_COLORDEPTH, CB_SETCURSEL, cfg->AddColorDepths, 0);
 868+ /*// extra modes
785869 if(cfg->ExtraModes) SendDlgItemMessage(hWnd,IDC_EXTRAMODES,BM_SETCHECK,BST_CHECKED,0);
786870 else SendDlgItemMessage(hWnd,IDC_EXTRAMODES,BM_SETCHECK,BST_UNCHECKED,0);
787871 // shader path
@@ -944,7 +1028,7 @@
9451029 }
9461030 else
9471031 {
948 - //EnableWindow(GetDlgItem(hWnd, IDC_DPISCALE), FALSE);
 1032+ EnableWindow(GetDlgItem(hTabs[0], IDC_DPISCALE), FALSE);
9491033 }
9501034 if(token) CloseHandle(token);
9511035 return TRUE;
@@ -1383,6 +1467,7 @@
13841468
13851469 int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
13861470 {
 1471+ WNDCLASSEX wc;
13871472 INITCOMMONCONTROLSEX icc;
13881473 HMODULE comctl32;
13891474 BOOL(WINAPI *iccex)(LPINITCOMMONCONTROLSEX lpInitCtrls);
@@ -1403,6 +1488,12 @@
14041489 iccex = (BOOL (WINAPI *)(LPINITCOMMONCONTROLSEX))GetProcAddress(comctl32,"InitCommonControlsEx");
14051490 if(iccex) iccex(&icc);
14061491 else InitCommonControls();
 1492+ ZeroMemory(&wc, sizeof(WNDCLASSEX));
 1493+ wc.cbSize = sizeof(WNDCLASSEX);
 1494+ wc.lpfnWndProc = CheckedComboProc;
 1495+ wc.hInstance = hInstance;
 1496+ wc.lpszClassName = _T("CheckedComboBox");
 1497+ RegisterClassEx(&wc);
14071498 hinstance = hInstance;
14081499 GetModuleFileName(NULL,hlppath,MAX_PATH);
14091500 GetDirFromPath(hlppath);
Index: dxglcfg2/dxglcfg2.rc
@@ -15,9 +15,11 @@
1616 // License along with this library; if not, write to the Free Software
1717 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818
 19+#define APSTUDIO_HIDDEN_SYMBOLS
1920 #include <windows.h>
2021 #include <commctrl.h>
2122 #include <richedit.h>
 23+#undef APSTUDIO_HIDDEN_SYMBOLS
2224 #include "resource.h"
2325 #include "../common/version.h"
2426
@@ -37,7 +39,7 @@
3840 COMBOBOX IDC_EXTRAMODES, 114, 42, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
3941 LTEXT "Additional display modes", 0, 114, 32, 78, 8, SS_LEFT, WS_EX_LEFT
4042 COMBOBOX IDC_COLORDEPTH, 114, 17, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
41 - LTEXT "Add color depths", 0, 114, 7, 54, 8, SS_LEFT, WS_EX_LEFT
 43+ LTEXT "Add color depths", IDC_STATIC, 114, 7, 54, 8, SS_LEFT, WS_EX_LEFT
4244 LTEXT "DPI scaling mode", IDC_STATIC, 7, 82, 55, 8, SS_LEFT, WS_EX_LEFT
4345 COMBOBOX IDC_DPISCALE, 7, 92, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
4446 LTEXT "Screen aspect ratio", IDC_STATIC, 7, 57, 63, 8, SS_LEFT, WS_EX_LEFT
@@ -92,7 +94,7 @@
9395 EDITTEXT IDC_CUSTOMSCALEX, 15, 69, 40, 14, WS_DISABLED | ES_AUTOHSCROLL, WS_EX_LEFT
9496 LTEXT "X", IDC_CUSTOMSCALELABELX, 7, 72, 6, 8, WS_DISABLED | SS_LEFT, WS_EX_LEFT
9597 EDITTEXT IDC_CUSTOMSCALEY, 65, 69, 40, 14, WS_DISABLED | ES_AUTOHSCROLL, WS_EX_LEFT
96 - AUTOCHECKBOX "Use post-processing shader", 0, 7, 8, 103, 8, 0, WS_EX_LEFT
 98+ AUTOCHECKBOX "Use post-processing shader", IDC_USESHADER, 7, 8, 103, 8, 0, WS_EX_LEFT
9799 COMBOBOX IDC_SHADER, 7, 18, 247, 92, WS_DISABLED | CBS_DROPDOWN | CBS_HASSTRINGS, WS_EX_LEFT
98100 PUSHBUTTON "...", IDC_BROWSESHADER, 256, 17, 20, 14, WS_DISABLED, WS_EX_LEFT
99101 }
@@ -138,7 +140,7 @@
139141 FONT 8, "Ms Shell Dlg"
140142 {
141143 LTEXT "Loading profiles...", 0, 95, 10, 56, 8, SS_LEFT, WS_EX_LEFT
142 - CONTROL "", 0, PROGRESS_CLASS, 0, 7, 20, 232, 14, WS_EX_LEFT
 144+ CONTROL "", IDC_PROGRESS, PROGRESS_CLASS, 0, 7, 20, 232, 14, WS_EX_LEFT
143145 }
144146
145147
Index: dxglcfg2/resource.h
@@ -59,3 +59,5 @@
6060 #define IDC_CUSTOMSCALEY 1027
6161 #define IDC_VSYNC 1028
6262 #define IDC_COLOR 1029
 63+#define IDC_USESHADER 1030
 64+#define IDC_PROGRESS 1031