From 5c053bb5ebd1c2a43ddb5afd0fc72d420eb25a2b Mon Sep 17 00:00:00 2001 From: Frank Skare Date: Sat, 13 Jul 2019 03:24:15 +0200 Subject: [PATCH] fix borderless window not minimizable from taskbar --- Changelog.md | 4 ++++ mpv.net/WinForms/MainForm.cs | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/Changelog.md b/Changelog.md index 7596fb4..d5c9642 100644 --- a/Changelog.md +++ b/Changelog.md @@ -11,6 +11,10 @@ - in the learn window of the input editor support was added for mouse left, mouse left double, mouse mid, mouse forward, mouse back - libmpv updated to shinchiro 2019-07-07 +- when border is none it wasn't possible to minimize the window from + the task bar because this is the WinForms default behavier. This + was fixed by calling Spy++ to the rescue and adding WS_MINIMIZEBOX + in CreateParams ### 4.6 diff --git a/mpv.net/WinForms/MainForm.cs b/mpv.net/WinForms/MainForm.cs index 8ad37b0..01cc7d5 100644 --- a/mpv.net/WinForms/MainForm.cs +++ b/mpv.net/WinForms/MainForm.cs @@ -350,6 +350,14 @@ namespace mpvnet Msg.ShowError(e.ExceptionObject.ToString()); } + protected override CreateParams CreateParams { + get { + CreateParams cp = base.CreateParams; + cp.Style |= 0x00020000 /* WS_MINIMIZEBOX */; + return cp; + } + } + protected override void WndProc(ref Message m) { //System.Diagnostics.Debug.WriteLine(m);