X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/21d2b241875c072a8700e838ae0da677a7b9d428..1d81a7b61a209e7ab114d4aadd4e9a8b318f83dc:/window.c diff --git a/window.c b/window.c index aac6ac6a..410c37ef 100644 --- a/window.c +++ b/window.c @@ -272,8 +272,17 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) char *p; int got_host = 0; - default_protocol = DEFAULT_PROTOCOL; - default_port = DEFAULT_PORT; + default_protocol = be_default_protocol; + /* Find the appropriate default port. */ + { + int i; + default_port = 0; /* illegal */ + for (i = 0; backends[i].backend != NULL; i++) + if (backends[i].protocol == default_protocol) { + default_port = backends[i].backend->default_port; + break; + } + } cfg.logtype = LGTYP_NONE; do_defaults(NULL, &cfg); @@ -906,7 +915,8 @@ void connection_fatal(void *frontend, char *fmt, ...) PostQuitMessage(1); else { session_closed = TRUE; - SetWindowText(hwnd, "PuTTY (inactive)"); + set_icon(NULL, "PuTTY (inactive)"); + set_title(NULL, "PuTTY (inactive)"); } } @@ -950,7 +960,8 @@ static void enact_pending_netevent(void) cfg.close_on_exit == COE_NORMAL) PostQuitMessage(0); else { session_closed = TRUE; - SetWindowText(hwnd, "PuTTY (inactive)"); + set_icon(NULL, "PuTTY (inactive)"); + set_title(NULL, "PuTTY (inactive)"); MessageBox(hwnd, "Connection closed by remote host", "PuTTY", MB_OK | MB_ICONINFORMATION); }