CheckRadioButton (hwnd, IDC2_VTXWINDOWS, IDC2_VTPOORMAN, cfg.vtmode == VT_XWINDOWS ? IDC2_VTXWINDOWS : cfg.vtmode == VT_OEMANSI ? IDC2_VTOEMANSI : cfg.vtmode == VT_OEMONLY ? IDC2_VTOEMONLY : IDC2_VTPOORMAN);
CheckDlgButton (hwnd, IDC1_BLINKCUR, cfg.blink_cur); CheckDlgButton (hwnd, IDC1_BEEP, cfg.beep); CheckDlgButton (hwnd, IDC2_SCROLLBAR, cfg.scrollbar); CheckDlgButton (hwnd, IDC2_LOCKSIZE, cfg.locksize); CheckDlgButton (hwnd, IDC2_BCE, cfg.bce); CheckDlgButton (hwnd, IDC2_BLINKTEXT, cfg.blinktext);
static int CALLBACK TerminalProc (HWND hwnd, UINT msg,				    WPARAM wParam, LPARAM lParam) {    CHOOSEFONT cf;    LOGFONT lf;    char fontstatic[256];    switch (msg) {      case WM_INITDIALOG:	CheckDlgButton (hwnd, IDC2_WRAPMODE, cfg.wrap_mode);	CheckDlgButton (hwnd, IDC2_WINNAME, cfg.win_name_always);	CheckDlgButton (hwnd, IDC2_DECOM, cfg.dec_om);	CheckDlgButton (hwnd, IDC2_LFHASCR, cfg.lfhascr);	SetDlgItemInt (hwnd, IDC2_ROWSEDIT, cfg.height, FALSE);	SetDlgItemInt (hwnd, IDC2_COLSEDIT, cfg.width, FALSE);	SetDlgItemInt (hwnd, IDC2_SAVEEDIT, cfg.savelines, FALSE);	fmtfont (fontstatic);	SetDlgItemText (hwnd, IDC2_FONTSTATIC, fontstatic);	CheckRadioButton (hwnd, IDC2_VTXWINDOWS, IDC2_VTPOORMAN,			  cfg.vtmode == VT_XWINDOWS ? IDC2_VTXWINDOWS :			  cfg.vtmode == VT_OEMANSI ? IDC2_VTOEMANSI :			  cfg.vtmode == VT_OEMONLY ? IDC2_VTOEMONLY :			  IDC2_VTPOORMAN);	break;      case WM_COMMAND:	switch (LOWORD(wParam)) {	  case IDC2_WRAPMODE:	    if (HIWORD(wParam) == BN_CLICKED ||		HIWORD(wParam) == BN_DOUBLECLICKED)		cfg.wrap_mode = IsDlgButtonChecked (hwnd, IDC2_WRAPMODE);	    break;	  case IDC2_WINNAME:	    if (HIWORD(wParam) == BN_CLICKED ||		HIWORD(wParam) == BN_DOUBLECLICKED)		cfg.win_name_always = IsDlgButtonChecked (hwnd, IDC2_WINNAME);	    break;	  case IDC2_DECOM:	    if (HIWORD(wParam) == BN_CLICKED ||		HIWORD(wParam) == BN_DOUBLECLICKED)		cfg.dec_om = IsDlgButtonChecked (hwnd, IDC2_DECOM);	    break;	  case IDC2_LFHASCR:	    if (HIWORD(wParam) == BN_CLICKED ||		HIWORD(wParam) == BN_DOUBLECLICKED)		cfg.lfhascr = IsDlgButtonChecked (hwnd, IDC2_LFHASCR);	    break;	  case IDC2_ROWSEDIT:	    if (HIWORD(wParam) == EN_CHANGE)		MyGetDlgItemInt (hwnd, IDC2_ROWSEDIT, &cfg.height);	    break;	  case IDC2_COLSEDIT:	    if (HIWORD(wParam) == EN_CHANGE)		MyGetDlgItemInt (hwnd, IDC2_COLSEDIT, &cfg.width);	    break;	  case IDC2_SAVEEDIT:	    if (HIWORD(wParam) == EN_CHANGE)		MyGetDlgItemInt (hwnd, IDC2_SAVEEDIT, &cfg.savelines);	    break;	  case IDC2_CHOOSEFONT:	    lf.lfHeight = cfg.fontheight;	    lf.lfWidth = lf.lfEscapement = lf.lfOrientation = 0;	    lf.lfItalic = lf.lfUnderline = lf.lfStrikeOut = 0;	    lf.lfWeight = (cfg.fontisbold ? FW_BOLD : 0);	    lf.lfCharSet = cfg.fontcharset;	    lf.lfOutPrecision = OUT_DEFAULT_PRECIS;	    lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;	    lf.lfQuality = DEFAULT_QUALITY;	    lf.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE;	    strncpy (lf.lfFaceName, cfg.font, sizeof(lf.lfFaceName)-1);	    lf.lfFaceName[sizeof(lf.lfFaceName)-1] = '\0';	    cf.lStructSize = sizeof(cf);	    cf.hwndOwner = hwnd;	    cf.lpLogFont = &lf;	    cf.Flags = CF_FIXEDPITCHONLY | CF_FORCEFONTEXIST |		CF_INITTOLOGFONTSTRUCT | CF_SCREENFONTS;	    if (ChooseFont (&cf)) {		strncpy (cfg.font, lf.lfFaceName, sizeof(cfg.font)-1);		cfg.font[sizeof(cfg.font)-1] = '\0';		cfg.fontisbold = (lf.lfWeight == FW_BOLD);		cfg.fontcharset = lf.lfCharSet;		cfg.fontheight = lf.lfHeight;		fmtfont (fontstatic);		SetDlgItemText (hwnd, IDC2_FONTSTATIC, fontstatic);	    }	    break;	  case IDC2_VTXWINDOWS:	  case IDC2_VTOEMANSI:	  case IDC2_VTOEMONLY:	  case IDC2_VTPOORMAN:	    cfg.vtmode =		(IsDlgButtonChecked (hwnd, IDC2_VTXWINDOWS) ? VT_XWINDOWS :		 IsDlgButtonChecked (hwnd, IDC2_VTOEMANSI) ? VT_OEMANSI :		 IsDlgButtonChecked (hwnd, IDC2_VTOEMONLY) ? VT_OEMONLY :		 VT_POORMAN);	    break;	}	break;    }    return GeneralPanelProc (hwnd, msg, wParam, lParam);}