Skip to content

Instantly share code, notes, and snippets.

@elliott-beach
Last active April 30, 2019 12:54
Show Gist options
  • Save elliott-beach/798c69ca61b6948664104e9b6d689dd9 to your computer and use it in GitHub Desktop.
Save elliott-beach/798c69ca61b6948664104e9b6d689dd9 to your computer and use it in GitHub Desktop.
Show a desktop notification from FiddlerScript
private function ShowPopup(message:String)
{
const notification = new System.Windows.Forms.NotifyIcon();
notification.Visible = true;
var icon = System.Drawing.SystemIcons.Information;
notification.Icon = icon;
notification.BalloonTipText = message;
const durationDisplayedInSeconds = 4;
notification.add_BalloonTipClosed(this.DisposeNotification);
notification.add_BalloonTipClicked(this.DisposeNotification);
notification.ShowBalloonTip(durationDisplayedInSeconds * 1000);
}
private function DisposeNotification(sender: Object, args: EventArgs)
{
var icon: System.Windows.Forms.NotifyIcon = sender;
icon.Dispose();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment