#define WM_IGNORE_SIZE (WM_USER + 2)
#define WM_IGNORE_CLIP (WM_USER + 3)
-static int WINAPI WndProc (HWND, UINT, WPARAM, LPARAM);
+static LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
static int TranslateKey(WPARAM wParam, LPARAM lParam, unsigned char *output);
static void cfgtopalette(void);
static void init_palette(void);
set_icon (msg);
}
+ session_closed = FALSE;
+
/*
* Set up the input and output buffers.
*/
AppendMenu (m, MF_POPUP | MF_ENABLED, (UINT) p, "Telnet Command");
AppendMenu (m, MF_SEPARATOR, 0, 0);
}
- AppendMenu (m, MF_ENABLED, IDM_SHOWLOG, "Event Log");
+ AppendMenu (m, MF_ENABLED, IDM_SHOWLOG, "&Event Log");
AppendMenu (m, MF_SEPARATOR, 0, 0);
- AppendMenu (m, MF_ENABLED, IDM_NEWSESS, "New Session");
- AppendMenu (m, MF_ENABLED, IDM_DUPSESS, "Duplicate Session");
+ AppendMenu (m, MF_ENABLED, IDM_NEWSESS, "Ne&w Session");
+ AppendMenu (m, MF_ENABLED, IDM_DUPSESS, "&Duplicate Session");
s = CreateMenu();
get_sesslist(TRUE);
for (i = 1 ; i < ((nsessions < 256) ? nsessions : 256) ; i++)
AppendMenu (s, MF_ENABLED, IDM_SAVED_MIN + (16 * i) , sessions[i]);
- AppendMenu (m, MF_POPUP | MF_ENABLED, (UINT) s, "Saved Sessions");
- AppendMenu (m, MF_ENABLED, IDM_RECONF, "Change Settings");
+ AppendMenu (m, MF_POPUP | MF_ENABLED, (UINT) s, "Sa&ved Sessions");
+ AppendMenu (m, MF_ENABLED, IDM_RECONF, "Chan&ge Settings");
AppendMenu (m, MF_SEPARATOR, 0, 0);
- AppendMenu (m, MF_ENABLED, IDM_CLRSB, "Clear Scrollback");
- AppendMenu (m, MF_ENABLED, IDM_RESET, "Reset Terminal");
+ AppendMenu (m, MF_ENABLED, IDM_CLRSB, "C&lear Scrollback");
+ AppendMenu (m, MF_ENABLED, IDM_RESET, "Rese&t Terminal");
AppendMenu (m, MF_SEPARATOR, 0, 0);
- AppendMenu (m, MF_ENABLED, IDM_ABOUT, "About PuTTY");
+ AppendMenu (m, MF_ENABLED, IDM_ABOUT, "&About PuTTY");
}
/*
lasttime = thistime;
}
-static int WINAPI WndProc (HWND hwnd, UINT message,
- WPARAM wParam, LPARAM lParam) {
+static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
+ WPARAM wParam, LPARAM lParam) {
HDC hdc;
static int ignore_size = FALSE;
static int ignore_clip = FALSE;
case WM_CREATE:
break;
case WM_CLOSE:
- if (!cfg.warn_on_close ||
+ if (!cfg.warn_on_close || session_closed ||
MessageBox(hwnd, "Are you sure you want to close this session?",
"PuTTY Exit Confirmation",
MB_ICONWARNING | MB_OKCANCEL) == IDOK)
init_fonts();
sfree(logpal);
ldisc = (cfg.ldisc_term ? &ldisc_term : &ldisc_simple);
+ back->special (cfg.ldisc_term ? TS_LECHO : TS_RECHO);
if (pal)
DeleteObject(pal);
logpal = NULL;
if (cfg.close_on_exit)
PostQuitMessage(0);
else {
+ session_closed = TRUE;
MessageBox(hwnd, "Connection closed by remote host",
"PuTTY", MB_OK | MB_ICONINFORMATION);
SetWindowText (hwnd, "PuTTY (inactive)");
ignore_size = TRUE; /* don't panic on next WM_SIZE msg */
break;
case WM_ENTERSIZEMOVE:
- EnableSizeTip(1);
- break;
+ EnableSizeTip(1);
+ break;
case WM_EXITSIZEMOVE:
- EnableSizeTip(0);
- break;
+ EnableSizeTip(0);
+ break;
case WM_SIZING:
{
int width, height, w, h, ew, eh;
height = r->bottom - r->top - extra_height;
w = (width + font_width/2) / font_width; if (w < 1) w = 1;
h = (height + font_height/2) / font_height; if (h < 1) h = 1;
- UpdateSizeTip(hwnd, w, h);
+ UpdateSizeTip(hwnd, w, h);
ew = width - w * font_width;
eh = height - h * font_height;
if (ew != 0) {
else
return 0;
}
- break;
+ /* break; (never reached) */
case WM_SIZE:
if (wParam == SIZE_MINIMIZED) {
SetWindowText (hwnd,