home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / ddrawrep.zip / EMSETUP.C < prev    next >
C/C++ Source or Header  |  1999-09-24  |  1KB  |  46 lines

  1. #define WIN32_LEAN_AND_MEAN
  2. #include <windows.h>
  3. #include <string.h>
  4. #include "resource.h"
  5.  
  6. int __stdcall PrivateEmulatorSetup(int type);
  7.  
  8. BOOL CALLBACK SetupWnd(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
  9. {    int EmMode;
  10.   switch (uMsg) {
  11.         case WM_INITDIALOG:
  12.       CheckRadioButton(hwndDlg,IDC_DIS,IDC_REF,IDC_DIS+PrivateEmulatorSetup(-1));
  13.             break;
  14.         case WM_COMMAND:
  15.       switch (wParam) {
  16.         case IDC_APPLY:
  17.         case IDOK:
  18.           EmMode=0;
  19.           if (IsDlgButtonChecked(hwndDlg,IDC_RGB)) EmMode=1;
  20.           if (IsDlgButtonChecked(hwndDlg,IDC_REF)) EmMode=2;
  21.           PrivateEmulatorSetup(EmMode);
  22.           if (wParam == IDOK) {
  23.             char buf[8];
  24.             wsprintf(buf,"%ld",EmMode);
  25.             WriteProfileString("Direct3D","Emulation",buf);
  26.           }
  27.           EndDialog(hwndDlg,0);
  28.           break;
  29.         case IDCANCEL:
  30.           EndDialog(hwndDlg,1);
  31.           break;
  32.       }
  33.             break;
  34.         case WM_CLOSE:
  35.             EndDialog(hwndDlg,1);
  36.             break;
  37.     }
  38.     return 0;
  39. }
  40.  
  41. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
  42.                    LPSTR lpCmdLine, int nCmdShow)
  43. {    
  44.     return DialogBoxParam(hInstance,MAKEINTRESOURCE(IDD_DIALOG1),0,SetupWnd,(LPARAM)lpCmdLine);
  45. }
  46.