diff --git a/src/main.cpp b/src/main.cpp index 7147005..3d77720 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -698,6 +698,12 @@ void ShowSelectPopup(HWND owner, int ctrlId, const std::vector& it int h = (int)items.size() * 30 + 6, wdt = (int)anchor.Width; HWND p = CreateWindowExW(WS_EX_TOOLWINDOW | WS_EX_TOPMOST, L"DictPopup", L"", WS_POPUP, tl.x, tl.y + 2, wdt, h, owner, nullptr, hInst, nullptr); + if (!p) { + wchar_t dbg[128]; + swprintf_s(dbg, L"Popup failed: w=%d h=%d x=%d y=%d err=%d", wdt, h, tl.x, tl.y, GetLastError()); + MessageBoxW(owner, dbg, L"Popup Error", MB_OK); + return; + } int corner = DWMWCP_ROUND; DwmSetWindowAttribute(p, DWMWA_WINDOW_CORNER_PREFERENCE, &corner, sizeof(corner)); ShowWindow(p, SW_SHOWNA); SetFocus(p); }