Reputation: 3227
I'm using NotifyIcon class to show the popup. How can I disable default sound when I'm showing error popup using windows notification area? I need to play my own sound, from resources, but I don't know how to temporarily disable sound which is defined in windows theme.
My code sample:
public void Notify()
{
if (_icon != null)
return;
if (!Settings.Default.EnableTrayNotifications)
return;
_icon = CreateNotifyIcon(LoadIcon());
_icon.Visible = true;
_icon.ShowBalloonTip(Settings.Default.MinimumNotificationInterval);
}
private NotifyIcon CreateNotifyIcon(Stream iconStream)
{
var icon = new NotifyIcon
{
Icon = new Icon(iconStream),
BalloonTipIcon = ToolTipIcon.Error,
BalloonTipTitle = "Sometext",
BalloonTipText = "Sometext"
};
icon.BalloonTipClicked += (s,a) => ShowWindow();
icon.BalloonTipClosed += (s,a) => Cleanup();
return icon;
}
Thanks for cooperation.
Upvotes: 3
Views: 2200