CheckDlgButton (hwnd, IDC0_CLOSEEXIT, cfg.close_on_exit); CheckDlgButton (hwnd, IDC0_CLOSEWARN, cfg.warn_on_close);
SetDlgItemInt (hwnd, IDC0_PINGEDIT, cfg.ping_interval, FALSE);
static void init_dlg_ctrls(HWND hwnd) {    int i;    char fontstatic[256];    SetDlgItemText (hwnd, IDC0_HOST, cfg.host);    SetDlgItemText (hwnd, IDC0_SESSEDIT, savedsession);    SetDlgItemInt (hwnd, IDC0_PORT, cfg.port, FALSE);    for (i = 0; i < nsessions; i++)	SendDlgItemMessage (hwnd, IDC0_SESSLIST, LB_ADDSTRING,			    0, (LPARAM) (sessions[i]));    CheckRadioButton (hwnd, IDC0_PROTRAW, IDC0_PROTSSH,		      cfg.protocol==PROT_SSH ? IDC0_PROTSSH :		      cfg.protocol==PROT_TELNET ? IDC0_PROTTELNET : IDC0_PROTRAW );    CheckDlgButton (hwnd, IDC0_CLOSEEXIT, cfg.close_on_exit);    CheckDlgButton (hwnd, IDC0_CLOSEWARN, cfg.warn_on_close);    CheckRadioButton (hwnd, IDC1_DEL008, IDC1_DEL127,		      cfg.bksp_is_delete ? IDC1_DEL127 : IDC1_DEL008);    CheckRadioButton (hwnd, IDC1_HOMETILDE, IDC1_HOMERXVT,		      cfg.rxvt_homeend ? IDC1_HOMERXVT : IDC1_HOMETILDE);    CheckRadioButton (hwnd, IDC1_FUNCTILDE, IDC1_FUNCXTERM,		      cfg.funky_type ?		      (cfg.funky_type==2 ? IDC1_FUNCXTERM		       : IDC1_FUNCLINUX )		      : IDC1_FUNCTILDE);    CheckRadioButton (hwnd, IDC1_CURNORMAL, IDC1_CURAPPLIC,		      cfg.app_cursor ? IDC1_CURAPPLIC : IDC1_CURNORMAL);    CheckRadioButton (hwnd, IDC1_KPNORMAL, IDC1_KPNH,		      cfg.nethack_keypad ? IDC1_KPNH :		      cfg.app_keypad ? IDC1_KPAPPLIC : IDC1_KPNORMAL);    CheckDlgButton (hwnd, IDC1_ALTF4, cfg.alt_f4);    CheckDlgButton (hwnd, IDC1_ALTSPACE, cfg.alt_space);    CheckDlgButton (hwnd, IDC1_LDISCTERM, cfg.ldisc_term);    CheckDlgButton (hwnd, IDC1_SCROLLKEY, cfg.scroll_on_key);    CheckDlgButton (hwnd, IDC2_WRAPMODE, cfg.wrap_mode);    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);    CheckDlgButton (hwnd, IDC2_BEEP, cfg.beep);    CheckDlgButton (hwnd, IDC2_BCE, cfg.bce);    CheckDlgButton (hwnd, IDC2_BLINKTEXT, cfg.blinktext);    SetDlgItemText (hwnd, IDC3_WINEDIT, cfg.wintitle);    CheckDlgButton (hwnd, IDC3_WINNAME, cfg.win_name_always);    CheckDlgButton (hwnd, IDC3_BLINKCUR, cfg.blink_cur);    CheckDlgButton (hwnd, IDC3_SCROLLBAR, cfg.scrollbar);    CheckDlgButton (hwnd, IDC3_LOCKSIZE, cfg.locksize);    SetDlgItemText (hwnd, IDC4_TTEDIT, cfg.termtype);    SetDlgItemText (hwnd, IDC4_TSEDIT, cfg.termspeed);    SetDlgItemText (hwnd, IDC4_LOGEDIT, cfg.username);    {	char *p = cfg.environmt;	while (*p) {	    SendDlgItemMessage (hwnd, IDC4_ENVLIST, LB_ADDSTRING, 0,				(LPARAM) p);	    p += strlen(p)+1;	}    }    CheckRadioButton (hwnd, IDC4_EMBSD, IDC4_EMRFC,		      cfg.rfc_environ ? IDC4_EMRFC : IDC4_EMBSD);    SetDlgItemText (hwnd, IDC5_TTEDIT, cfg.termtype);    SetDlgItemText (hwnd, IDC5_LOGEDIT, cfg.username);    CheckDlgButton (hwnd, IDC5_NOPTY, cfg.nopty);    CheckDlgButton (hwnd, IDC5_AGENTFWD, cfg.agentfwd);    CheckRadioButton (hwnd, IDC5_CIPHER3DES, IDC5_CIPHERDES,		      cfg.cipher == CIPHER_BLOWFISH ? IDC5_CIPHERBLOWF :		      cfg.cipher == CIPHER_DES ? IDC5_CIPHERDES :		      IDC5_CIPHER3DES);    CheckRadioButton (hwnd, IDC5_SSHPROT1, IDC5_SSHPROT2,		      cfg.sshprot == 1 ? IDC5_SSHPROT1 : IDC5_SSHPROT2);    CheckDlgButton (hwnd, IDC5_AUTHTIS, cfg.try_tis_auth);    SetDlgItemText (hwnd, IDC5_PKEDIT, cfg.keyfile);    SetDlgItemText (hwnd, IDC5_CMDEDIT, cfg.remote_cmd);    CheckRadioButton (hwnd, IDC6_MBWINDOWS, IDC6_MBXTERM,		      cfg.mouse_is_xterm ? IDC6_MBXTERM : IDC6_MBWINDOWS);    {	static int tabs[4] = {25, 61, 96, 128};	SendDlgItemMessage (hwnd, IDC6_CCLIST, LB_SETTABSTOPS, 4,			    (LPARAM) tabs);    }    for (i=0; i<256; i++) {	char str[100];	sprintf(str, "%d\t(0x%02X)\t%c\t%d", i, i,		(i>=0x21 && i != 0x7F) ? i : ' ',		cfg.wordness[i]);	SendDlgItemMessage (hwnd, IDC6_CCLIST, LB_ADDSTRING, 0,			    (LPARAM) str);    }    CheckDlgButton (hwnd, IDC7_BOLDCOLOUR, cfg.bold_colour);    CheckDlgButton (hwnd, IDC7_PALETTE, cfg.try_palette);    {	int i;	for (i=0; i<22; i++)	    if (cfg.bold_colour || permcolour[i])		SendDlgItemMessage (hwnd, IDC7_LIST, LB_ADDSTRING, 0,				    (LPARAM) colours[i]);    }    SendDlgItemMessage (hwnd, IDC7_LIST, LB_SETCURSEL, 0, 0);    SetDlgItemInt (hwnd, IDC7_RVALUE, cfg.colours[0][0], FALSE);    SetDlgItemInt (hwnd, IDC7_GVALUE, cfg.colours[0][1], FALSE);    SetDlgItemInt (hwnd, IDC7_BVALUE, cfg.colours[0][2], FALSE);    CheckRadioButton (hwnd, IDC8_NOXLAT, IDC8_88592WIN1250,		      cfg.xlat_88592w1250 ? IDC8_88592WIN1250 :		      cfg.xlat_enablekoiwin ? IDC8_KOI8WIN1251 :		      IDC8_NOXLAT);    CheckDlgButton (hwnd, IDC8_CAPSLOCKCYR, cfg.xlat_capslockcyr);    CheckRadioButton (hwnd, IDC8_VTXWINDOWS, IDC8_VTPOORMAN,		      cfg.vtmode == VT_XWINDOWS ? IDC8_VTXWINDOWS :		      cfg.vtmode == VT_OEMANSI ? IDC8_VTOEMANSI :		      cfg.vtmode == VT_OEMONLY ? IDC8_VTOEMONLY :		      IDC8_VTPOORMAN);}