I know Balloon notifications have been covered in WB, but am curious about using CLR for a notification. This code
ObjectClrOption('useany', 'System')
ObjectCLrOPtion('useany', 'PresentationFramework')
ObjectCLrOPtion('useany', 'PresentationCore')
ObjectCLrOPtion('useany', 'System.Windows.Forms')
ObjectCLrOPtion('useany', 'System.Drawing')
balloon = ObjectClrNew('System.Windows.Forms.NotifyIcon')
;for testing add your own path to icon
;icon = ObjectClrType('System.Drawing.icon',"c:\scripts\sd.ico")
icon = ObjectClrType('System.Windows.Forms.ToolTipIcon',1)
balloon.Visible = ObjectType("BOOL",@TRUE)
;balloon.BalloonTipText = "CurrentApplication"
balloon.ShowBalloonTip(10000, "Look At Me","CurrentApplication",icon)
balloon.Dispose()
Exit
doesn't error, but also doesn't work as this does in PS
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
$notify = new-object system.windows.forms.notifyicon
$notify.icon = [System.Drawing.SystemIcons]::Information
$notify.visible = $true
$notify.showballoontip(10000,'Current Operation','Script has been completed',[system.windows.forms.tooltipicon]::Info)
$notify.Dispose()
Obvious I am doing something wrong with WB code, what is it?
Just guessing but you may need to hang .Net notifications on .Net 'System.Windows.Forms' application.