שלום וברכה.
יש לי קוד שפועל בPowerShell להציג הודעה מוקפצת על המסך.
ואני רוצה להפעיל אותו מתוך אקסס.
איך אני עושה זאת?
תודה רבה
הקוד שלי הוא כך:
יש לי קוד שפועל בPowerShell להציג הודעה מוקפצת על המסך.
ואני רוצה להפעיל אותו מתוך אקסס.
איך אני עושה זאת?
תודה רבה
הקוד שלי הוא כך:
קוד:
#Load the required assemblies
[void] [System.Reflection.Assembly]::LoadWithPartialName(“System.Windows.Forms”)#Remove any registered events related to notifications
##Remove-Event BalloonClicked_event -ea SilentlyContinue
##Unregister-Event -SourceIdentifier BalloonClicked_event -ea silentlycontinue
##Remove-Event BalloonClosed_event -ea SilentlyContinue
##Unregister-Event -SourceIdentifier BalloonClosed_event -ea silentlycontinue#Create the notification object
$notification = New-Object System.Windows.Forms.NotifyIcon
$path = (Get-Process -id $pid).Path
$notification.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path)
$notification.BalloonTipTitle = “כותרת”
$notification.BalloonTipIcon = “Info”
$notification.BalloonTipText = “טקסט”
$notification.Visible = $True
## Register a click event with action to take based on event
#Balloon message clicked
register-objectevent $notification BalloonTipClicked BalloonClicked_event `
-Action {[System.Windows.Forms.MessageBox]::Show(“Balloon message Clicked”,”Information”);$notification.Visible = $False} | Out-Null
#Balloon message closed
register-objectevent $notification BalloonTipClosed BalloonClosed_event `
-Action {[System.Windows.Forms.MessageBox]::Show(“Balloon message closed”,”Information”);$notification.Visible = $False} | Out-Null
#Call the balloon notification
$notification.ShowBalloonTip(600)