Hi
I managed to create a notification icon in the task bar that changes based on Status of VPN connection.
The icon will stay in the taskbar at all times, so I would like the user to be able to get the balloon tip again when the mouse goes over the icon or when the user clicks it.
So far I used code that shows a messagebox. It works fine but only once. Ideally it should be available at all times.
here is the code.
Thanks in advance for suggestions.
PROCESS {
if ($vstate -eq 1) {
$errlevel = "Information"
$constatetext = "VPN is Connected"
$constateicon = "imageres_106.ico"
}
else
{
$errlevel = "Warning"
$constatetext = "VPN is not Connected"
$constateicon = "imageres_107.ico"
}
Add-Type -AssemblyName System.Windows.Forms
if ($script:balloon -eq $null)
{
$script:balloon = New-Object System.Windows.Forms.NotifyIcon
}
$balloon.Icon = $constateicon
$balloon.BalloonTipIcon = $errlevel
$balloon.BalloonTipText = $constatetext
$balloon.BalloonTipTitle = "Citrix Secure Access VPN"
$balloon.Visible = $true
$balloon.ShowBalloonTip($Timeout)
register-objectevent $balloon Click Click_event `
-Action {[System.Windows.Forms.MessageBox]::Show(“Balloon message clicked”,”Information”);$notification.Visible = $False} | Out-Null
}bruno