Skip to content

Commit

Permalink
fix(banner/quickmenu): Don't show notification or quick menu in the A…
Browse files Browse the repository at this point in the history
…LT+TAB menu

Fixes #1475
  • Loading branch information
Belphemur committed May 5, 2024
1 parent 686602d commit 5312f64
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions SoundSwitch.UI.Menu/Form/QuickMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ internal QuickMenu()
InitializeComponent();
_hideDisposeMethod = HideDispose;
TopMost = true;
FormBorderStyle = FormBorderStyle.None;
ShowInTaskbar = false;
}

protected override CreateParams CreateParams
{
get
{
var cp = base.CreateParams;
// turn on WS_EX_TOOLWINDOW style bit
// Used to hide the banner from alt+tab
// source: https://www.csharp411.com/hide-form-from-alttab/
cp.ExStyle |= 0x80;
return cp;
}
}

/// <summary>
Expand Down
15 changes: 15 additions & 0 deletions SoundSwitch/Framework/Banner/BannerForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,24 @@ public BannerForm()
StartPosition = FormStartPosition.Manual;
Bounds = screen.Bounds;
TopMost = true;
FormBorderStyle = FormBorderStyle.None;
ShowInTaskbar = false;
}

protected override bool ShowWithoutActivation => true;

protected override CreateParams CreateParams
{
get
{
var cp = base.CreateParams;
// turn on WS_EX_TOOLWINDOW style bit
// Used to hide the banner from alt+tab
// source: https://www.csharp411.com/hide-form-from-alttab/
cp.ExStyle |= 0x80;
return cp;
}
}

// /// <summary>
// /// Override the parameters used to create the window handle.
Expand Down

0 comments on commit 5312f64

Please sign in to comment.