Skip to content

Commit

Permalink
Windows: Make alert message box use MB_TASKMODAL
Browse files Browse the repository at this point in the history
This flag pauses the current running thread, allowing for the user to see the
alert and acknowledge it before the thread continues (and e.g. crashes :)).

Thanks to @SuperUserNameMan for finding it.
Ref: https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505(v=vs.85).aspx
  • Loading branch information
akien-mga authored Jul 26, 2016
1 parent a155342 commit fd659e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion platform/windows/os_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@ void OS_Windows::vprint(const char* p_format, va_list p_list, bool p_stderr) {
void OS_Windows::alert(const String& p_alert,const String& p_title) {

if (!is_no_window_mode_enabled())
MessageBoxW(NULL,p_alert.c_str(),p_title.c_str(),MB_OK|MB_ICONEXCLAMATION);
MessageBoxW(NULL, p_alert.c_str(), p_title.c_str(), MB_OK | MB_ICONEXCLAMATION | MB_TASKMODAL);
else
print_line("ALERT: "+p_alert);
}
Expand Down

0 comments on commit fd659e8

Please sign in to comment.