From d08f4b56b43420108cc79eefa1825e2b5e6575c3 Mon Sep 17 00:00:00 2001 From: somewhatlurker <52014015+somewhatlurker@users.noreply.github.com> Date: Sun, 25 Aug 2019 17:17:40 +1000 Subject: [PATCH] launcher: set config window owner to existing form (improves window management) --- source-code/source/plugins/Launcher/ConfigOption.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/source-code/source/plugins/Launcher/ConfigOption.h b/source-code/source/plugins/Launcher/ConfigOption.h index fa35082..8cd1589 100644 --- a/source-code/source/plugins/Launcher/ConfigOption.h +++ b/source-code/source/plugins/Launcher/ConfigOption.h @@ -161,6 +161,7 @@ public: form->MinimizeBox = false; form->ShowInTaskbar = false; form->ShowIcon = false; + //form->TopMost = true; form->BackColor = Drawing::Color::FromArgb(64, 64, 64); form->ForeColor = Drawing::Color::White; @@ -192,14 +193,20 @@ public: // MessageBox::Show(form->Controls[0]->Handle.ToString()); //Application::OpenForms[0]->Enabled = false; + form->Owner = Application::OpenForms[0]; + if (form->Visible) + form->Hide(); form->Show(); } System::Void FormClosing(System::Object^ sender, FormClosingEventArgs^ e) { - form->Hide(); - //Application::OpenForms[0]->Enabled = true; - e->Cancel = true; + if (e->CloseReason == CloseReason::UserClosing) + { + form->Hide(); + //Application::OpenForms[0]->Enabled = true; + e->Cancel = true; + } } System::Void OkClick(System::Object^ sender, System::EventArgs^ e)