Skip to content

Commit c6e1c6b

Browse files
committed
fix(Banner): Avoid issue where the banner wouldn't be shown
Use the normal WinForm props instead of overriding CreateParams Fixes #960
1 parent 04ccef7 commit c6e1c6b

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

SoundSwitch/Framework/Banner/BannerForm.cs

+15-14
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,27 @@ public BannerForm()
4343
var screen = AppModel.Instance.NotifyUsingPrimaryScreen ? Screen.PrimaryScreen : Screen.FromPoint(Cursor.Position);
4444
StartPosition = FormStartPosition.Manual;
4545
Bounds = screen.Bounds;
46+
TopMost = true;
4647

4748
Location = new Point(screen.Bounds.X + 50, screen.Bounds.Y + 60);
4849
}
4950

5051
protected override bool ShowWithoutActivation => true;
5152

52-
/// <summary>
53-
/// Override the parameters used to create the window handle.
54-
/// Ensure that the window will be top-most and do not activate or take focus.
55-
/// </summary>
56-
protected override CreateParams CreateParams
57-
{
58-
get
59-
{
60-
CreateParams p = base.CreateParams;
61-
p.ExStyle |= 0x08000000; // WS_EX_NOACTIVATE
62-
p.ExStyle |= 0x00000008; // WS_EX_TOPMOST
63-
return p;
64-
}
65-
}
53+
// /// <summary>
54+
// /// Override the parameters used to create the window handle.
55+
// /// Ensure that the window will be top-most and do not activate or take focus.
56+
// /// </summary>
57+
// protected override CreateParams CreateParams
58+
// {
59+
// get
60+
// {
61+
// CreateParams p = base.CreateParams;
62+
// p.ExStyle |= 0x08000000; // WS_EX_NOACTIVATE
63+
// p.ExStyle |= 0x00000008; // WS_EX_TOPMOST
64+
// return p;
65+
// }
66+
// }
6667

6768
/// <summary>
6869
/// Called internally to configure pass notification parameters

0 commit comments

Comments
 (0)