Tray Icon Application

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 6 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
eric_m
Posts: 2
Last visit: Wed Mar 07, 2018 11:15 am

Tray Icon Application

Post by eric_m »

I'd like to write a script that would display basic system info in a tooltip when a user hovers over an icon in the tray. I've built this script without Powershell Studio. The trouble I'm having is building it in PS Studio to only show in the tray and not the taskbar. I also would like to add some right click functionality such as "send email with this info". Has anyone done anything like this before? Even a good jumping off point would be welcome.
User avatar
eric_m
Posts: 2
Last visit: Wed Mar 07, 2018 11:15 am

Re: Tray Icon Application

Post by eric_m »

Also I have read the post here https://www.sapien.com/blog/2017/07/10/ ... owershell/ but it would nice to add some items to the context menu.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Tray Icon Application

Post by jvierra »

I don't have any examples but the documentation is here:
https://msdn.microsoft.com/en-us/librar ... yIcon.aspx

If you search you will find hundreds of examples.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Tray Icon Application

Post by davidc »

If you have any feature requests, be sure to enter them here:

https://www.sapien.com/requests
David
SAPIEN Technologies, Inc.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Tray Icon Application

Post by jvierra »

I found an old demo of the NotifyIcon that shows pretty near all techniques for displaying an icon. The behavior is partly controlled by the version of your OS so keep that in mind.
Attachments
Demo-IconNotify.psf
(56.05 KiB) Downloaded 235 times
This topic is 6 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked