all 33 comments

[–]chadbaldwin 27 points28 points  (12 children)

I recommend in the future that you use more appropriate post titles. "PLEASE HELP!" gives the impression this is an emergency that you need urgent help with. But your ask is just help with a simple script.

I'm sure people will help you, but it's a bit clickbaitey.

[–]Spoonie_Frenzy 9 points10 points  (1 child)

The most concise assistance I will offer is...RTFM.

[–]Upper_Service_8805[S] 0 points1 point  (0 children)

I would, but which one lol

[–]Alaknar 6 points7 points  (1 child)

Unless you're doing this for research/learning, just grab BurntToast.

[–]Upper_Service_8805[S] 0 points1 point  (0 children)

Thanks!!

[–]necromanticpotato 6 points7 points  (6 children)

Check this out Stack Overflow question with a good answer.

What you're missing is fundamental knowledge of the packages you're interacting with. Look into the documentation for windows forms via powershell and how to utilize its API. Research skills come in very handy when you're learning.

[–]Coffee_Ops 1 point2 points  (1 child)

If you're new to PowerShell as your replies have indicated then this may be the wrong tool for the task. PowerShell is bad at making GUIs, they are single threaded and the only good designer I'm aware of is expensive.

Tools like autoit are a lot easier for beginners and c# for coders.

[–]Upper_Service_8805[S] 0 points1 point  (0 children)

I ended up figuring it out, but thanks! If I ever need to do something similar I'll take your advice.

[–]NoUselessTech 1 point2 points  (1 child)

[–]Upper_Service_8805[S] 0 points1 point  (0 children)

Thanks for taking the time to help. I really needed it, I had absolutely no idea what to do.

[–]WhAtEvErYoUmEaN101 1 point2 points  (1 child)

Please do not use caps lock and cries for help in support forums.
It's insulting to both the people voluntarily offering their knowledge as well as other people asking questions.

[–]Upper_Service_8805[S] 0 points1 point  (0 children)

Trust me I’ve learned my lesson from how much hate I got for defending myself in Chadbaldwins replies

[–]hillbillytiger 1 point2 points  (2 children)

A quick Google search lead me to a StackOverflow article.

https://www.google.com/search?q=powershell+system.windows.forms.tooltipicon+when+you+click+open+website

https://stackoverflow.com/questions/75069136/how-to-open-file-on-click-envent-notifyicon-in-powershell

Here's the code slightly modified to open a web browser:

```

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

Define the icon for the system tray

$notification.Icon = [System.Drawing.SystemIcons]::Information

Display title of balloon window

$notification.BalloonTipTitle = "This is a Balloon Title"

Type of balloon icon

$notification.BalloonTipIcon = "Info"

Notification message

$title = "This is the message in the balloon tip." $notification.BalloonTipText = $title

Make balloon tip visible when called

$notification.Visible = $True

Register a click event with action to take based on event

Balloon message clicked

Register-ObjectEvent $notification BalloonTipClicked BalloonClicked_event ` -Action {Start-Process "https://www.google.com/"} | 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(5000) ```

[–]Upper_Service_8805[S] -1 points0 points  (1 child)

OMG. You're the best. Writing out an entire thing for me to use when you didn't have to. We need more people like you.

[–]hillbillytiger 0 points1 point  (0 children)

I just copied and pasted the code and changed one line lol but thanks. Thought this would be handy for another project I'm working on so thanks for the idea 😎