Make dialogs modal and topmost
This commit is contained in:
1 parent
760d8a632e
commit
8bbab637b5
3 files changed
+11
-2
No files matched your search
@@ -56,6 +56,8 @@ build\Release\ParavisInstaller.exe
|
|||||||
|
|
||||||
## Примечания
|
## Примечания
|
||||||
|
|
||||||
|
- Все предупреждения и подтверждения — модальные: блокируют главное окно и
|
||||||
|
показываются поверх него.
|
||||||
- `Data.pf` ищется рядом с exe, как и в AutoIt-версии. `/wim=` остаётся
|
- `Data.pf` ищется рядом с exe, как и в AutoIt-версии. `/wim=` остаётся
|
||||||
служебным/тестовым переопределением.
|
служебным/тестовым переопределением.
|
||||||
- Командные строки DISM собираются без внешней пары кавычек `cmd /c "..."`,
|
- Командные строки DISM собираются без внешней пары кавычек `cmd /c "..."`,
|
||||||
|
|||||||
+7
-1
@@ -721,10 +721,16 @@ int App::ShowMessage(UINT flags, const wchar_t* title, const std::wstring& text)
|
|||||||
modal = true;
|
modal = true;
|
||||||
GoState(false);
|
GoState(false);
|
||||||
DimControls(true);
|
DimControls(true);
|
||||||
|
EnableWindow(hwnd, FALSE);
|
||||||
|
UpdateWindow(hwnd);
|
||||||
|
SetForegroundWindow(hwnd);
|
||||||
|
|
||||||
int result = MessageBoxW(hwnd, text.c_str(), title, flags);
|
int result = MessageBoxW(hwnd, text.c_str(), title,
|
||||||
|
flags | MB_SETFOREGROUND | MB_TOPMOST);
|
||||||
DebugLog(L"MsgBox exit title=%s result=%d", title, result);
|
DebugLog(L"MsgBox exit title=%s result=%d", title, result);
|
||||||
|
|
||||||
|
EnableWindow(hwnd, TRUE);
|
||||||
|
SetForegroundWindow(hwnd);
|
||||||
modal = previous;
|
modal = previous;
|
||||||
clickGuard = GetTickCount64();
|
clickGuard = GetTickCount64();
|
||||||
if (!busy) {
|
if (!busy) {
|
||||||
|
|||||||
+2
-1
@@ -986,7 +986,8 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR, int)
|
|||||||
SetForegroundWindow(existing);
|
SetForegroundWindow(existing);
|
||||||
} else {
|
} else {
|
||||||
MessageBoxW(nullptr, L"Paravis installer уже запущен.",
|
MessageBoxW(nullptr, L"Paravis installer уже запущен.",
|
||||||
L"Paravis installer", MB_ICONINFORMATION | MB_OK);
|
L"Paravis installer",
|
||||||
|
MB_ICONINFORMATION | MB_OK | MB_SETFOREGROUND | MB_TOPMOST);
|
||||||
}
|
}
|
||||||
CloseHandle(instanceMutex);
|
CloseHandle(instanceMutex);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in new issue
Block a user