I want to handle the System.Windows.Forms.NotifyIcon's BalloonTipClicked. That is to say, I want to handle the event when the tip is clicked. My code is below, however I can't catch the event. Please help !
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Timers")
## This is the location of your download files
$notification = "E:\TDdownload"
$notification = New-Object System.Windows.Forms.NotifyIcon
$notification.Icon = "C:\Users\Sefler\Desktop\PerfCenterCpl.ico"
$notification.BalloonTipIcon = "Info"
$notification.BalloonTipText = "Windows will now try to clean "+ $fileLocation +" as scheduled."
$notification.BalloonTipTitle = "Windows auto maintaince"
$notification.Visible = $True
$notification.ShowBalloonTip(15000)
## Register a click event
register-objectevent $notification BalloonTipClicked -sourceIdentifier notification_event
## Wait for the onClick event
wait-event -timeout 15