diff --git a/HeliosPlus/UIForms/MainForm.cs b/HeliosPlus/UIForms/MainForm.cs index 98fda4d..61834f1 100644 --- a/HeliosPlus/UIForms/MainForm.cs +++ b/HeliosPlus/UIForms/MainForm.cs @@ -11,6 +11,7 @@ using HeliosPlus.GameLibraries; using System.Threading; using System.Reflection; using HeliosPlus.Shared; +using System.Runtime.InteropServices; namespace HeliosPlus.UIForms { @@ -187,6 +188,7 @@ namespace HeliosPlus.UIForms private void openApplicationWindowToolStripMenuItem_Click(object sender, EventArgs e) { allowVisible = true; + Restore(); Show(); BringToFront(); } @@ -218,5 +220,18 @@ namespace HeliosPlus.UIForms Program.AppProgramSettings.MinimiseOnStart = false; } } + + [DllImport("user32.dll")] + private static extern int ShowWindow(IntPtr hWnd, uint Msg); + + private const uint SW_RESTORE = 0x09; + + public void Restore() + { + if (WindowState == FormWindowState.Minimized) + { + ShowWindow(Handle, SW_RESTORE); + } + } } }