Comments on: Give The Power of Speech and Sound to Your PowerShell Scripts https://www.chinhdo.com/20100116/give-the-power-of-speech-and-sound-to-your-powershell-scripts/ Chinh's semi-random thoughts on software development, gadgets, and other things. Sun, 15 Mar 2020 04:02:34 +0000 hourly 1 https://wordpress.org/?v=6.9.1 By: Chinh Do https://www.chinhdo.com/20100116/give-the-power-of-speech-and-sound-to-your-powershell-scripts/comment-page-1/#comment-78203 Tue, 20 Apr 2010 23:29:44 +0000 https://www.chinhdo.com/20100120/give-the-power-of-speech-and-sound-to-your-powershell-scripts/#comment-78203 Hi BRW:

This is a very useful tip, thanks! If you don’t mind, I will update my article with your code later.

Chinh

]]>
By: BRW https://www.chinhdo.com/20100116/give-the-power-of-speech-and-sound-to-your-powershell-scripts/comment-page-1/#comment-78200 Tue, 20 Apr 2010 15:03:13 +0000 https://www.chinhdo.com/20100120/give-the-power-of-speech-and-sound-to-your-powershell-scripts/#comment-78200 If you are going to create the notify object, its also a good idea to remove it.

I have some code below with an example.

Using –> $objNotifyIcon.Dispose

I wrote this code for PowerShell v1.0 and also some of my function names do not follow the correct verb-noun naming conventions.

########################
function ShowNotify_Icon([string]$msg)
{
$objNotifyIcon.BalloonTipIcon = ‘Info’
$objNotifyIcon.Icon = ‘D:\Create_Notify_Icon\graph.ico’
$objNotifyIcon.BalloonTipTitle = ‘Processing …’
$objNotifyIcon.BalloonTipText = $msg
$objNotifyIcon.Visible = $True
$objNotifyIcon.ShowBalloonTip(9000)
Sleep(9)
}#ShowNotify_Icon

########################
function HideNotify_Icon([string]$msg)
{
$objNotifyIcon.BalloonTipText = $msg
$objNotifyIcon.ShowBalloonTip(9000)
Sleep(9)
$objNotifyIcon.Visible = $false
}#HideNotify_Icon

########################
#Start Here : )
[void][System.Reflection.Assembly]::LoadWithPartialName(“System.Windows.Forms”)
$objNotifyIcon = New-Object System.Windows.Forms.NotifyIcon

ShowNotify_Icon(‘This operation is starting . . .’)

HideNotify_Icon(‘This operation has completed . . .’)

$objNotifyIcon.Dispose
#main

]]>