Make dialogs modal and topmost

This commit is contained in:
Paravis committed 2026-11-08 23:37:35 +03:00
1 parent 342690dfe9
commit aeae61245d
3 files changed
+20 -4

No files matched your search

+8 -1
View File
@@ -7,7 +7,14 @@ void App::ShowMessage(const std::wstring& text, UINT flags)
{
bool previous = modal;
modal = true;
MessageBoxW(hwnd, text.c_str(), L"Change BootLoader", flags);
EnableWindow(hwnd, FALSE);
InvalidateRect(hwnd, nullptr, FALSE);
UpdateWindow(hwnd);
SetForegroundWindow(hwnd);
MessageBoxW(hwnd, text.c_str(), L"Change BootLoader",
flags | MB_SETFOREGROUND | MB_TOPMOST);
EnableWindow(hwnd, TRUE);
SetForegroundWindow(hwnd);
modal = previous;
InvalidateRect(hwnd, nullptr, FALSE);
}