diff --git a/SoundSwitch.UI.Menu/Form/QuickMenu.cs b/SoundSwitch.UI.Menu/Form/QuickMenu.cs index 45142ad122..cc75a6a22c 100644 --- a/SoundSwitch.UI.Menu/Form/QuickMenu.cs +++ b/SoundSwitch.UI.Menu/Form/QuickMenu.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using System.Windows.Forms; using SoundSwitch.UI.Menu.Component; +using SoundSwitch.UI.Menu.Util; using SoundSwitch.UI.Menu.Util.Timer; namespace SoundSwitch.UI.Menu.Form @@ -30,26 +31,12 @@ public record MenuClickedEvent(IconMenuItem.DataContainer Item); public event EventHandler SelectionChanged; protected override bool ShowWithoutActivation => true; - - /// - /// Override the parameters used to create the window handle. - /// Ensure that the window will be top-most and do not activate or take focus. - /// - protected override CreateParams CreateParams - { - get - { - CreateParams p = base.CreateParams; - // p.ExStyle |= 0x08000000; // WS_EX_NOACTIVATE - p.ExStyle |= 0x00000008; // WS_EX_TOPMOST - return p; - } - } - + internal QuickMenu() { InitializeComponent(); _hideDisposeMethod = HideDispose; + TopMost = true; } /// @@ -116,6 +103,7 @@ public void SetData(IEnumerable.DataContainer> payloads) if (!_isLocationSet) { + Region = Region.FromHrgn(RoundedCorner.CreateRoundRectRgn(0, 0, Width, Height , 20, 20)); Show(); SetLocationToCursor(); _isLocationSet = true;