Last active
April 30, 2019 12:54
-
-
Save elliott-beach/798c69ca61b6948664104e9b6d689dd9 to your computer and use it in GitHub Desktop.
Show a desktop notification from FiddlerScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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