mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-05-30 00:04:49 -05:00
Add ability to configure the initial window title
[originally from svn r661]
This commit is contained in:
parent
4a2ea18a51
commit
7fc8ef792f
1
putty.h
1
putty.h
@ -163,6 +163,7 @@ typedef struct {
|
|||||||
int alt_space; /* is it special? */
|
int alt_space; /* is it special? */
|
||||||
int ldisc_term;
|
int ldisc_term;
|
||||||
int scroll_on_key;
|
int scroll_on_key;
|
||||||
|
char wintitle[256]; /* initial window title */
|
||||||
/* Terminal options */
|
/* Terminal options */
|
||||||
int savelines;
|
int savelines;
|
||||||
int dec_om;
|
int dec_om;
|
||||||
|
12
win_res.h
12
win_res.h
@ -7,6 +7,7 @@
|
|||||||
#define IDD_PANEL0 103
|
#define IDD_PANEL0 103
|
||||||
#define IDD_PANEL1 104
|
#define IDD_PANEL1 104
|
||||||
#define IDD_PANEL2 105
|
#define IDD_PANEL2 105
|
||||||
|
#define IDD_PANELW 115
|
||||||
#define IDD_PANEL3 106
|
#define IDD_PANEL3 106
|
||||||
#define IDD_PANEL35 107
|
#define IDD_PANEL35 107
|
||||||
#define IDD_PANEL4 108
|
#define IDD_PANEL4 108
|
||||||
@ -70,7 +71,6 @@
|
|||||||
|
|
||||||
#define IDC2_WRAPMODE 1001
|
#define IDC2_WRAPMODE 1001
|
||||||
#define IDC2_DECOM 1002
|
#define IDC2_DECOM 1002
|
||||||
#define IDC2_WINNAME 1003
|
|
||||||
#define IDC2_DIMSTATIC 1004
|
#define IDC2_DIMSTATIC 1004
|
||||||
#define IDC2_ROWSSTATIC 1005
|
#define IDC2_ROWSSTATIC 1005
|
||||||
#define IDC2_ROWSEDIT 1006
|
#define IDC2_ROWSEDIT 1006
|
||||||
@ -81,13 +81,17 @@
|
|||||||
#define IDC2_FONTSTATIC 1011
|
#define IDC2_FONTSTATIC 1011
|
||||||
#define IDC2_CHOOSEFONT 1012
|
#define IDC2_CHOOSEFONT 1012
|
||||||
#define IDC2_LFHASCR 1018
|
#define IDC2_LFHASCR 1018
|
||||||
#define IDC1_BLINKCUR 1020
|
|
||||||
#define IDC1_BEEP 1021
|
#define IDC1_BEEP 1021
|
||||||
#define IDC2_SCROLLBAR 1022
|
|
||||||
#define IDC2_LOCKSIZE 1023
|
|
||||||
#define IDC2_BCE 1024
|
#define IDC2_BCE 1024
|
||||||
#define IDC2_BLINKTEXT 1025
|
#define IDC2_BLINKTEXT 1025
|
||||||
|
|
||||||
|
#define IDCW_WINNAME 1001
|
||||||
|
#define IDCW_BLINKCUR 1002
|
||||||
|
#define IDCW_SCROLLBAR 1003
|
||||||
|
#define IDCW_LOCKSIZE 1004
|
||||||
|
#define IDCW_WINTITLE 1005
|
||||||
|
#define IDCW_WINEDIT 1006
|
||||||
|
|
||||||
#define IDC3_TTSTATIC 1001
|
#define IDC3_TTSTATIC 1001
|
||||||
#define IDC3_TTEDIT 1002
|
#define IDC3_TTEDIT 1002
|
||||||
#define IDC3_TSSTATIC 1003
|
#define IDC3_TSSTATIC 1003
|
||||||
|
23
win_res.inp
23
win_res.inp
@ -145,7 +145,7 @@ BEGIN
|
|||||||
AUTOCHECKBOX "Reset scrollback on &keypress", IDC1_SCROLLKEY, SCOL
|
AUTOCHECKBOX "Reset scrollback on &keypress", IDC1_SCROLLKEY, SCOL
|
||||||
END
|
END
|
||||||
|
|
||||||
/* Accelerators used: [aco] bdghiklmnprswy */
|
/* Accelerators used: [aco] dghlmnprsw */
|
||||||
IDD_PANEL2 DIALOG DISCARDABLE 6, 30, 168, 163
|
IDD_PANEL2 DIALOG DISCARDABLE 6, 30, 168, 163
|
||||||
STYLE WS_CHILD | WS_VISIBLE | NOT WS_BORDER
|
STYLE WS_CHILD | WS_VISIBLE | NOT WS_BORDER
|
||||||
FONT 8, "MS Sans Serif"
|
FONT 8, "MS Sans Serif"
|
||||||
@ -170,12 +170,8 @@ BEGIN
|
|||||||
GRID(1,8,10)
|
GRID(1,8,10)
|
||||||
AUTOCHECKBOX "Auto &wrap mode initially on", IDC2_WRAPMODE, SCOL
|
AUTOCHECKBOX "Auto &wrap mode initially on", IDC2_WRAPMODE, SCOL
|
||||||
AUTOCHECKBOX "&DEC Origin Mode initially on", IDC2_DECOM, SCOL
|
AUTOCHECKBOX "&DEC Origin Mode initially on", IDC2_DECOM, SCOL
|
||||||
AUTOCHECKBOX "Avoid ever using &icon title", IDC2_WINNAME, SCOL
|
|
||||||
AUTOCHECKBOX "Implicit CR in every &LF", IDC2_LFHASCR, SCOL
|
AUTOCHECKBOX "Implicit CR in every &LF", IDC2_LFHASCR, SCOL
|
||||||
AUTOCHECKBOX "&Blinking cursor", IDC1_BLINKCUR, SCOL
|
|
||||||
AUTOCHECKBOX "Bee&p enabled", IDC1_BEEP, SCOL
|
AUTOCHECKBOX "Bee&p enabled", IDC1_BEEP, SCOL
|
||||||
AUTOCHECKBOX "Displa&y scrollbar", IDC2_SCROLLBAR, SCOL
|
|
||||||
AUTOCHECKBOX "Loc&k Window size", IDC2_LOCKSIZE, SCOL
|
|
||||||
AUTOCHECKBOX "Use Back&ground colour erase", IDC2_BCE, SCOL
|
AUTOCHECKBOX "Use Back&ground colour erase", IDC2_BCE, SCOL
|
||||||
AUTOCHECKBOX "Enable bli&nking text", IDC2_BLINKTEXT, SCOL
|
AUTOCHECKBOX "Enable bli&nking text", IDC2_BLINKTEXT, SCOL
|
||||||
GAP(6)
|
GAP(6)
|
||||||
@ -183,6 +179,23 @@ BEGIN
|
|||||||
GAP(6)
|
GAP(6)
|
||||||
END
|
END
|
||||||
|
|
||||||
|
/* Accelerators used: [aco] bikty */
|
||||||
|
IDD_PANELW DIALOG DISCARDABLE 6, 30, 168, 163
|
||||||
|
STYLE WS_CHILD | WS_VISIBLE | NOT WS_BORDER
|
||||||
|
FONT 8, "MS Sans Serif"
|
||||||
|
INIT(10,176,8,162) SPOS(3,3)
|
||||||
|
BEGIN
|
||||||
|
GRID(4,4,24)
|
||||||
|
LTEXT "Initial window &title:", IDCW_WINTITLE, COL(1), SS(3,2)
|
||||||
|
EDITTEXT IDCW_WINEDIT, ADJ(8) COL(1), SS(3,3), ES_AUTOHSCROLL
|
||||||
|
NEXT(2)
|
||||||
|
GRID(1,8,10)
|
||||||
|
AUTOCHECKBOX "Avoid ever using &icon title", IDCW_WINNAME, SCOL
|
||||||
|
AUTOCHECKBOX "&Blinking cursor", IDCW_BLINKCUR, SCOL
|
||||||
|
AUTOCHECKBOX "Displa&y scrollbar", IDCW_SCROLLBAR, SCOL
|
||||||
|
AUTOCHECKBOX "Loc&k Window size", IDCW_LOCKSIZE, SCOL
|
||||||
|
END
|
||||||
|
|
||||||
/* Accelerators used: [aco] bdflrstuv */
|
/* Accelerators used: [aco] bdflrstuv */
|
||||||
IDD_PANEL3 DIALOG DISCARDABLE 6, 30, 168, 163
|
IDD_PANEL3 DIALOG DISCARDABLE 6, 30, 168, 163
|
||||||
STYLE WS_CHILD | WS_VISIBLE | NOT WS_BORDER
|
STYLE WS_CHILD | WS_VISIBLE | NOT WS_BORDER
|
||||||
|
40
win_res.rc
40
win_res.rc
@ -145,7 +145,7 @@ BEGIN
|
|||||||
AUTOCHECKBOX "Reset scrollback on &keypress", IDC1_SCROLLKEY, 3, 143, 162, 8
|
AUTOCHECKBOX "Reset scrollback on &keypress", IDC1_SCROLLKEY, 3, 143, 162, 8
|
||||||
END
|
END
|
||||||
|
|
||||||
/* Accelerators used: [aco] bdghiklmnprswy */
|
/* Accelerators used: [aco] dghlmnprsw */
|
||||||
IDD_PANEL2 DIALOG DISCARDABLE 6, 30, 168, 163
|
IDD_PANEL2 DIALOG DISCARDABLE 6, 30, 168, 163
|
||||||
STYLE WS_CHILD | WS_VISIBLE | NOT WS_BORDER
|
STYLE WS_CHILD | WS_VISIBLE | NOT WS_BORDER
|
||||||
FONT 8, "MS Sans Serif"
|
FONT 8, "MS Sans Serif"
|
||||||
@ -170,19 +170,32 @@ BEGIN
|
|||||||
|
|
||||||
AUTOCHECKBOX "Auto &wrap mode initially on", IDC2_WRAPMODE, 3, 62, 162, 8
|
AUTOCHECKBOX "Auto &wrap mode initially on", IDC2_WRAPMODE, 3, 62, 162, 8
|
||||||
AUTOCHECKBOX "&DEC Origin Mode initially on", IDC2_DECOM, 3, 72, 162, 8
|
AUTOCHECKBOX "&DEC Origin Mode initially on", IDC2_DECOM, 3, 72, 162, 8
|
||||||
AUTOCHECKBOX "Avoid ever using &icon title", IDC2_WINNAME, 3, 82, 162, 8
|
AUTOCHECKBOX "Implicit CR in every &LF", IDC2_LFHASCR, 3, 82, 162, 8
|
||||||
AUTOCHECKBOX "Implicit CR in every &LF", IDC2_LFHASCR, 3, 92, 162, 8
|
AUTOCHECKBOX "Bee&p enabled", IDC1_BEEP, 3, 92, 162, 8
|
||||||
AUTOCHECKBOX "&Blinking cursor", IDC1_BLINKCUR, 3, 102, 162, 8
|
AUTOCHECKBOX "Use Back&ground colour erase", IDC2_BCE, 3, 102, 162, 8
|
||||||
AUTOCHECKBOX "Bee&p enabled", IDC1_BEEP, 3, 112, 162, 8
|
AUTOCHECKBOX "Enable bli&nking text", IDC2_BLINKTEXT, 3, 112, 162, 8
|
||||||
AUTOCHECKBOX "Displa&y scrollbar", IDC2_SCROLLBAR, 3, 122, 162, 8
|
|
||||||
AUTOCHECKBOX "Loc&k Window size", IDC2_LOCKSIZE, 3, 132, 162, 8
|
|
||||||
AUTOCHECKBOX "Use Back&ground colour erase", IDC2_BCE, 3, 142, 162, 8
|
|
||||||
AUTOCHECKBOX "Enable bli&nking text", IDC2_BLINKTEXT, 3, 152, 162, 8
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
||||||
|
/* Accelerators used: [aco] bikty */
|
||||||
|
IDD_PANELW DIALOG DISCARDABLE 6, 30, 168, 163
|
||||||
|
STYLE WS_CHILD | WS_VISIBLE | NOT WS_BORDER
|
||||||
|
FONT 8, "MS Sans Serif"
|
||||||
|
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
LTEXT "Initial window &title:", IDCW_WINTITLE, 3, 3, 119, 8
|
||||||
|
EDITTEXT IDCW_WINEDIT, 3, 11, 119, 12, ES_AUTOHSCROLL
|
||||||
|
|
||||||
|
|
||||||
|
AUTOCHECKBOX "Avoid ever using &icon title", IDCW_WINNAME, 3, 29, 162, 8
|
||||||
|
AUTOCHECKBOX "&Blinking cursor", IDCW_BLINKCUR, 3, 39, 162, 8
|
||||||
|
AUTOCHECKBOX "Displa&y scrollbar", IDCW_SCROLLBAR, 3, 49, 162, 8
|
||||||
|
AUTOCHECKBOX "Loc&k Window size", IDCW_LOCKSIZE, 3, 59, 162, 8
|
||||||
|
END
|
||||||
|
|
||||||
/* Accelerators used: [aco] bdflrstuv */
|
/* Accelerators used: [aco] bdflrstuv */
|
||||||
IDD_PANEL3 DIALOG DISCARDABLE 6, 30, 168, 163
|
IDD_PANEL3 DIALOG DISCARDABLE 6, 30, 168, 163
|
||||||
STYLE WS_CHILD | WS_VISIBLE | NOT WS_BORDER
|
STYLE WS_CHILD | WS_VISIBLE | NOT WS_BORDER
|
||||||
@ -340,15 +353,14 @@ BEGIN
|
|||||||
|
|
||||||
END
|
END
|
||||||
|
|
||||||
/* Accelerators used: co */
|
/* Accelerators used: c */
|
||||||
IDD_LOGBOX DIALOG DISCARDABLE 100, 20, 260, 119
|
IDD_LOGBOX DIALOG DISCARDABLE 100, 20, 160, 119
|
||||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
CAPTION "PuTTY Event Log"
|
CAPTION "PuTTY Event Log"
|
||||||
FONT 8, "MS Sans Serif"
|
FONT 8, "MS Sans Serif"
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "&Close", IDOK, 135, 102, 44, 14
|
DEFPUSHBUTTON "&Close", IDOK, 58, 102, 44, 14
|
||||||
PUSHBUTTON "C&opy", IDN_COPY, 81, 102, 44, 14
|
LISTBOX IDN_LIST, 3, 3, 154, 95, LBS_HASSTRINGS | LBS_USETABSTOPS | WS_VSCROLL
|
||||||
LISTBOX IDN_LIST, 3, 3, 254, 95, LBS_HASSTRINGS | LBS_USETABSTOPS | WS_VSCROLL | LBS_EXTENDEDSEL
|
|
||||||
END
|
END
|
||||||
|
|
||||||
/* No accelerators used */
|
/* No accelerators used */
|
||||||
|
84
windlg.c
84
windlg.c
@ -16,9 +16,9 @@
|
|||||||
#include "win_res.h"
|
#include "win_res.h"
|
||||||
#include "storage.h"
|
#include "storage.h"
|
||||||
|
|
||||||
#define NPANELS 8
|
#define NPANELS 9
|
||||||
#define MAIN_NPANELS 8
|
#define MAIN_NPANELS 9
|
||||||
#define RECONF_NPANELS 5
|
#define RECONF_NPANELS 6
|
||||||
|
|
||||||
static char **events = NULL;
|
static char **events = NULL;
|
||||||
static int nevents = 0, negsize = 0;
|
static int nevents = 0, negsize = 0;
|
||||||
@ -110,6 +110,7 @@ static void save_settings (char *section, int do_host) {
|
|||||||
write_setting_i (sesskey, "AutoWrapMode", cfg.wrap_mode);
|
write_setting_i (sesskey, "AutoWrapMode", cfg.wrap_mode);
|
||||||
write_setting_i (sesskey, "LFImpliesCR", cfg.lfhascr);
|
write_setting_i (sesskey, "LFImpliesCR", cfg.lfhascr);
|
||||||
write_setting_i (sesskey, "WinNameAlways", cfg.win_name_always);
|
write_setting_i (sesskey, "WinNameAlways", cfg.win_name_always);
|
||||||
|
write_setting_s (sesskey, "WinTitle", cfg.wintitle);
|
||||||
write_setting_i (sesskey, "TermWidth", cfg.width);
|
write_setting_i (sesskey, "TermWidth", cfg.width);
|
||||||
write_setting_i (sesskey, "TermHeight", cfg.height);
|
write_setting_i (sesskey, "TermHeight", cfg.height);
|
||||||
write_setting_s (sesskey, "Font", cfg.font);
|
write_setting_s (sesskey, "Font", cfg.font);
|
||||||
@ -227,6 +228,7 @@ static void load_settings (char *section, int do_host) {
|
|||||||
gppi (sesskey, "AutoWrapMode", 1, &cfg.wrap_mode);
|
gppi (sesskey, "AutoWrapMode", 1, &cfg.wrap_mode);
|
||||||
gppi (sesskey, "LFImpliesCR", 0, &cfg.lfhascr);
|
gppi (sesskey, "LFImpliesCR", 0, &cfg.lfhascr);
|
||||||
gppi (sesskey, "WinNameAlways", 0, &cfg.win_name_always);
|
gppi (sesskey, "WinNameAlways", 0, &cfg.win_name_always);
|
||||||
|
gpps (sesskey, "WinTitle", "", cfg.wintitle, sizeof(cfg.wintitle));
|
||||||
gppi (sesskey, "TermWidth", 80, &cfg.width);
|
gppi (sesskey, "TermWidth", 80, &cfg.width);
|
||||||
gppi (sesskey, "TermHeight", 24, &cfg.height);
|
gppi (sesskey, "TermHeight", 24, &cfg.height);
|
||||||
gpps (sesskey, "Font", "Courier", cfg.font, sizeof(cfg.font));
|
gpps (sesskey, "Font", "Courier", cfg.font, sizeof(cfg.font));
|
||||||
@ -726,7 +728,6 @@ static int CALLBACK TerminalProc (HWND hwnd, UINT msg,
|
|||||||
switch (msg) {
|
switch (msg) {
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
CheckDlgButton (hwnd, IDC2_WRAPMODE, cfg.wrap_mode);
|
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_DECOM, cfg.dec_om);
|
||||||
CheckDlgButton (hwnd, IDC2_LFHASCR, cfg.lfhascr);
|
CheckDlgButton (hwnd, IDC2_LFHASCR, cfg.lfhascr);
|
||||||
SetDlgItemInt (hwnd, IDC2_ROWSEDIT, cfg.height, FALSE);
|
SetDlgItemInt (hwnd, IDC2_ROWSEDIT, cfg.height, FALSE);
|
||||||
@ -734,10 +735,7 @@ static int CALLBACK TerminalProc (HWND hwnd, UINT msg,
|
|||||||
SetDlgItemInt (hwnd, IDC2_SAVEEDIT, cfg.savelines, FALSE);
|
SetDlgItemInt (hwnd, IDC2_SAVEEDIT, cfg.savelines, FALSE);
|
||||||
fmtfont (fontstatic);
|
fmtfont (fontstatic);
|
||||||
SetDlgItemText (hwnd, IDC2_FONTSTATIC, fontstatic);
|
SetDlgItemText (hwnd, IDC2_FONTSTATIC, fontstatic);
|
||||||
CheckDlgButton (hwnd, IDC1_BLINKCUR, cfg.blink_cur);
|
|
||||||
CheckDlgButton (hwnd, IDC1_BEEP, cfg.beep);
|
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_BCE, cfg.bce);
|
||||||
CheckDlgButton (hwnd, IDC2_BLINKTEXT, cfg.blinktext);
|
CheckDlgButton (hwnd, IDC2_BLINKTEXT, cfg.blinktext);
|
||||||
break;
|
break;
|
||||||
@ -748,11 +746,6 @@ static int CALLBACK TerminalProc (HWND hwnd, UINT msg,
|
|||||||
HIWORD(wParam) == BN_DOUBLECLICKED)
|
HIWORD(wParam) == BN_DOUBLECLICKED)
|
||||||
cfg.wrap_mode = IsDlgButtonChecked (hwnd, IDC2_WRAPMODE);
|
cfg.wrap_mode = IsDlgButtonChecked (hwnd, IDC2_WRAPMODE);
|
||||||
break;
|
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:
|
case IDC2_DECOM:
|
||||||
if (HIWORD(wParam) == BN_CLICKED ||
|
if (HIWORD(wParam) == BN_CLICKED ||
|
||||||
HIWORD(wParam) == BN_DOUBLECLICKED)
|
HIWORD(wParam) == BN_DOUBLECLICKED)
|
||||||
@ -804,26 +797,11 @@ static int CALLBACK TerminalProc (HWND hwnd, UINT msg,
|
|||||||
SetDlgItemText (hwnd, IDC2_FONTSTATIC, fontstatic);
|
SetDlgItemText (hwnd, IDC2_FONTSTATIC, fontstatic);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IDC1_BLINKCUR:
|
|
||||||
if (HIWORD(wParam) == BN_CLICKED ||
|
|
||||||
HIWORD(wParam) == BN_DOUBLECLICKED)
|
|
||||||
cfg.blink_cur = IsDlgButtonChecked (hwnd, IDC1_BLINKCUR);
|
|
||||||
break;
|
|
||||||
case IDC1_BEEP:
|
case IDC1_BEEP:
|
||||||
if (HIWORD(wParam) == BN_CLICKED ||
|
if (HIWORD(wParam) == BN_CLICKED ||
|
||||||
HIWORD(wParam) == BN_DOUBLECLICKED)
|
HIWORD(wParam) == BN_DOUBLECLICKED)
|
||||||
cfg.beep = IsDlgButtonChecked (hwnd, IDC1_BEEP);
|
cfg.beep = IsDlgButtonChecked (hwnd, IDC1_BEEP);
|
||||||
break;
|
break;
|
||||||
case IDC2_SCROLLBAR:
|
|
||||||
if (HIWORD(wParam) == BN_CLICKED ||
|
|
||||||
HIWORD(wParam) == BN_DOUBLECLICKED)
|
|
||||||
cfg.scrollbar = IsDlgButtonChecked (hwnd, IDC2_SCROLLBAR);
|
|
||||||
break;
|
|
||||||
case IDC2_LOCKSIZE:
|
|
||||||
if (HIWORD(wParam) == BN_CLICKED ||
|
|
||||||
HIWORD(wParam) == BN_DOUBLECLICKED)
|
|
||||||
cfg.locksize = IsDlgButtonChecked (hwnd, IDC2_LOCKSIZE);
|
|
||||||
break;
|
|
||||||
case IDC2_BLINKTEXT:
|
case IDC2_BLINKTEXT:
|
||||||
if (HIWORD(wParam) == BN_CLICKED ||
|
if (HIWORD(wParam) == BN_CLICKED ||
|
||||||
HIWORD(wParam) == BN_DOUBLECLICKED)
|
HIWORD(wParam) == BN_DOUBLECLICKED)
|
||||||
@ -840,6 +818,49 @@ static int CALLBACK TerminalProc (HWND hwnd, UINT msg,
|
|||||||
return GeneralPanelProc (hwnd, msg, wParam, lParam);
|
return GeneralPanelProc (hwnd, msg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int CALLBACK WindowProc (HWND hwnd, UINT msg,
|
||||||
|
WPARAM wParam, LPARAM lParam) {
|
||||||
|
switch (msg) {
|
||||||
|
case WM_INITDIALOG:
|
||||||
|
SetDlgItemText (hwnd, IDCW_WINEDIT, cfg.wintitle);
|
||||||
|
CheckDlgButton (hwnd, IDCW_WINNAME, cfg.win_name_always);
|
||||||
|
CheckDlgButton (hwnd, IDCW_BLINKCUR, cfg.blink_cur);
|
||||||
|
CheckDlgButton (hwnd, IDCW_SCROLLBAR, cfg.scrollbar);
|
||||||
|
CheckDlgButton (hwnd, IDCW_LOCKSIZE, cfg.locksize);
|
||||||
|
break;
|
||||||
|
case WM_COMMAND:
|
||||||
|
switch (LOWORD(wParam)) {
|
||||||
|
case IDCW_WINNAME:
|
||||||
|
if (HIWORD(wParam) == BN_CLICKED ||
|
||||||
|
HIWORD(wParam) == BN_DOUBLECLICKED)
|
||||||
|
cfg.win_name_always = IsDlgButtonChecked (hwnd, IDCW_WINNAME);
|
||||||
|
break;
|
||||||
|
case IDCW_BLINKCUR:
|
||||||
|
if (HIWORD(wParam) == BN_CLICKED ||
|
||||||
|
HIWORD(wParam) == BN_DOUBLECLICKED)
|
||||||
|
cfg.blink_cur = IsDlgButtonChecked (hwnd, IDCW_BLINKCUR);
|
||||||
|
break;
|
||||||
|
case IDCW_SCROLLBAR:
|
||||||
|
if (HIWORD(wParam) == BN_CLICKED ||
|
||||||
|
HIWORD(wParam) == BN_DOUBLECLICKED)
|
||||||
|
cfg.scrollbar = IsDlgButtonChecked (hwnd, IDCW_SCROLLBAR);
|
||||||
|
break;
|
||||||
|
case IDCW_LOCKSIZE:
|
||||||
|
if (HIWORD(wParam) == BN_CLICKED ||
|
||||||
|
HIWORD(wParam) == BN_DOUBLECLICKED)
|
||||||
|
cfg.locksize = IsDlgButtonChecked (hwnd, IDCW_LOCKSIZE);
|
||||||
|
break;
|
||||||
|
case IDCW_WINEDIT:
|
||||||
|
if (HIWORD(wParam) == EN_CHANGE)
|
||||||
|
GetDlgItemText (hwnd, IDCW_WINEDIT, cfg.wintitle,
|
||||||
|
sizeof(cfg.wintitle)-1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return GeneralPanelProc (hwnd, msg, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
static int CALLBACK TelnetProc (HWND hwnd, UINT msg,
|
static int CALLBACK TelnetProc (HWND hwnd, UINT msg,
|
||||||
WPARAM wParam, LPARAM lParam) {
|
WPARAM wParam, LPARAM lParam) {
|
||||||
int i;
|
int i;
|
||||||
@ -1282,13 +1303,14 @@ static int CALLBACK TranslationProc (HWND hwnd, UINT msg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static DLGPROC panelproc[NPANELS] = {
|
static DLGPROC panelproc[NPANELS] = {
|
||||||
ConnectionProc, KeyboardProc, TerminalProc,
|
ConnectionProc, KeyboardProc, TerminalProc, WindowProc,
|
||||||
TelnetProc, SshProc, SelectionProc, ColourProc, TranslationProc
|
TelnetProc, SshProc, SelectionProc, ColourProc, TranslationProc
|
||||||
};
|
};
|
||||||
static char *panelids[NPANELS] = {
|
static char *panelids[NPANELS] = {
|
||||||
MAKEINTRESOURCE(IDD_PANEL0),
|
MAKEINTRESOURCE(IDD_PANEL0),
|
||||||
MAKEINTRESOURCE(IDD_PANEL1),
|
MAKEINTRESOURCE(IDD_PANEL1),
|
||||||
MAKEINTRESOURCE(IDD_PANEL2),
|
MAKEINTRESOURCE(IDD_PANEL2),
|
||||||
|
MAKEINTRESOURCE(IDD_PANELW),
|
||||||
MAKEINTRESOURCE(IDD_PANEL3),
|
MAKEINTRESOURCE(IDD_PANEL3),
|
||||||
MAKEINTRESOURCE(IDD_PANEL35),
|
MAKEINTRESOURCE(IDD_PANEL35),
|
||||||
MAKEINTRESOURCE(IDD_PANEL4),
|
MAKEINTRESOURCE(IDD_PANEL4),
|
||||||
@ -1297,12 +1319,12 @@ static char *panelids[NPANELS] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static char *names[NPANELS] = {
|
static char *names[NPANELS] = {
|
||||||
"Connection", "Keyboard", "Terminal", "Telnet",
|
"Connection", "Keyboard", "Terminal", "Window", "Telnet",
|
||||||
"SSH", "Selection", "Colours", "Translation"
|
"SSH", "Selection", "Colours", "Translation"
|
||||||
};
|
};
|
||||||
|
|
||||||
static int mainp[MAIN_NPANELS] = { 0, 1, 2, 3, 4, 5, 6, 7};
|
static int mainp[MAIN_NPANELS] = { 0, 1, 2, 3, 4, 5, 6, 7, 8};
|
||||||
static int reconfp[RECONF_NPANELS] = { 1, 2, 5, 6, 7};
|
static int reconfp[RECONF_NPANELS] = { 1, 2, 3, 6, 7, 8};
|
||||||
|
|
||||||
static int GenericMainDlgProc (HWND hwnd, UINT msg,
|
static int GenericMainDlgProc (HWND hwnd, UINT msg,
|
||||||
WPARAM wParam, LPARAM lParam,
|
WPARAM wParam, LPARAM lParam,
|
||||||
|
13
window.c
13
window.c
@ -415,7 +415,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) {
|
|||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
char *error;
|
char *error;
|
||||||
char msg[1024];
|
char msg[1024], *title;
|
||||||
char *realhost;
|
char *realhost;
|
||||||
|
|
||||||
error = back->init (hwnd, cfg.host, cfg.port, &realhost);
|
error = back->init (hwnd, cfg.host, cfg.port, &realhost);
|
||||||
@ -425,9 +425,14 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
window_name = icon_name = NULL;
|
window_name = icon_name = NULL;
|
||||||
sprintf(msg, "%s - PuTTY", realhost);
|
if (*cfg.wintitle) {
|
||||||
set_title (msg);
|
title = cfg.wintitle;
|
||||||
set_icon (msg);
|
} else {
|
||||||
|
sprintf(msg, "%s - PuTTY", realhost);
|
||||||
|
title = msg;
|
||||||
|
}
|
||||||
|
set_title (title);
|
||||||
|
set_icon (title);
|
||||||
}
|
}
|
||||||
|
|
||||||
session_closed = FALSE;
|
session_closed = FALSE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user