X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/7374c7790ee32f36855e4257eb15d2fe43e277ea..b08600c44afcea44391d6a351e5b4107a1d8309d:/windows/window.c diff --git a/windows/window.c b/windows/window.c index 42aa7fb7..4855de54 100644 --- a/windows/window.c +++ b/windows/window.c @@ -409,7 +409,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) i--; p[i] = '\0'; do_defaults(p + 1, &cfg); - if (!*cfg.host && !do_config()) { + if (!cfg_launchable(&cfg) && !do_config()) { cleanup_exit(0); } } else if (*p == '&') { @@ -554,7 +554,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) cmdline_run_saved(&cfg); - if (!*cfg.host && !do_config()) { + if (!cfg_launchable(&cfg) && !do_config()) { cleanup_exit(0); } @@ -836,9 +836,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) sfree(handles); - if (GetMessage(&msg, NULL, 0, 0) != 1) - break; - do { + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message == WM_QUIT) goto finished; /* two-level break */ @@ -852,7 +850,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) */ if (must_close_session) close_session(); - } while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)); + } /* The messages seem unreliable; especially if we're being tricky */ term_set_focus(term, GetForegroundWindow() == hwnd);