Confirm exit if exiting while streaming/recording
If OBS is live/recording when the user presses the Exit, File/Exit, or the [X] Button a message box will open asking if the user wants to exit OBS while live/recording. This is useful to protect against accidentally closing OBS while streaming/recording. CLoses jp9000/OBS#448master
parent
afae723a9b
commit
a7f89d339e
|
@ -3593,7 +3593,25 @@ LRESULT CALLBACK OBS::OBSProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||
|
||||
case ID_FILE_EXIT:
|
||||
case ID_EXIT:
|
||||
PostQuitMessage(0);
|
||||
if (App->bRunning)
|
||||
{
|
||||
if (App->bRecording)
|
||||
{
|
||||
if (OBSMessageBox(hwnd, Str("CloseWhileActiveWarning.Message"), Str("CloseWhileActiveWarning.Title"), MB_ICONQUESTION | MB_YESNO) == IDYES)
|
||||
{
|
||||
PostQuitMessage(0);
|
||||
}
|
||||
}
|
||||
else if (App->bStreaming)
|
||||
{
|
||||
if (OBSMessageBox(hwnd, Str("CloseWhileActiveWarning.Message"), Str("CloseWhileActiveWarning.Title"), MB_ICONQUESTION | MB_YESNO) == IDYES)
|
||||
{
|
||||
PostQuitMessage(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
case ID_RECORDINGSFOLDER:
|
||||
|
@ -4503,7 +4521,25 @@ LRESULT CALLBACK OBS::OBSProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||
break;
|
||||
|
||||
case WM_CLOSE:
|
||||
PostQuitMessage(0);
|
||||
if (App->bRunning)
|
||||
{
|
||||
if (App->bRecording)
|
||||
{
|
||||
if (OBSMessageBox(hwnd, Str("CloseWhileActiveWarning.Message"), Str("CloseWhileActiveWarning.Title"), MB_ICONQUESTION | MB_YESNO) == IDYES)
|
||||
{
|
||||
PostQuitMessage(0);
|
||||
}
|
||||
}
|
||||
else if (App->bStreaming)
|
||||
{
|
||||
if (OBSMessageBox(hwnd, Str("CloseWhileActiveWarning.Message"), Str("CloseWhileActiveWarning.Title"), MB_ICONQUESTION | MB_YESNO) == IDYES)
|
||||
{
|
||||
PostQuitMessage(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
case WM_ENDSESSION:
|
||||
|
|
|
@ -552,3 +552,5 @@ Plugins.NoiseGate.AttackTime="Attack time (milliseconds):"
|
|||
Plugins.NoiseGate.HoldTime="Hold time (milliseconds):"
|
||||
Plugins.NoiseGate.ReleaseTime="Release time (milliseconds):"
|
||||
|
||||
CloseWhileActiveWarning.Title="OBS is currently active."
|
||||
CloseWhileActiveWarning.Message="OBS is currently active. Do you want to stop and exit OBS?"
|
||||
|
|
Loading…
Reference in New Issue