From fe00a2928c5f490be2d8f70a03af5529dfbaad7f Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 11 Mar 2022 19:11:35 +0000 Subject: [PATCH] Windows: diagnose failure to create the terminal window. It only fails in very unusual circumstances, but that's all the more reason to give a useful report when it does! --- windows/window.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/windows/window.c b/windows/window.c index c1cd0c4c..39a7ca34 100644 --- a/windows/window.c +++ b/windows/window.c @@ -575,6 +575,10 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) wgs.term_hwnd = CreateWindowExW( exwinmode, uappname, uappname, winmode, CW_USEDEFAULT, CW_USEDEFAULT, guess_width, guess_height, NULL, NULL, inst, NULL); + if (!wgs.term_hwnd) { + modalfatalbox("Unable to create terminal window: %s", + win_strerror(GetLastError())); + } memset(&dpi_info, 0, sizeof(struct _dpi_info)); init_dpi_info(); sfree(uappname);