Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by BlueOctave · Feb 17, 2017 at 08:29 AM · unity 5notificationminimize

Make application close to the tray.

Hello, I would like to create an application that alerts me of changes done on my server. I want the application to always close/be in my system tray even when I press the close button and I also want it to display a small pop-up window when a notification happens. Could anyone point me in the direction of decent .dlls or native code that could allow this to happen?

I want my app to minimize into here: alt text

capture.png (14.8 kB)
Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Orion_78 · Jun 09, 2017 at 09:58 AM 0
Share

Hello ! Same question here... (I am not looking for "closing to the tray" but more $$anonymous$$i$$anonymous$$e to the tray, but still) I found this http://www.developer.com/net/csharp/article.php/3336751 but it works for a Form class...

avatar image Orion_78 · Jun 09, 2017 at 10:02 AM 0
Share

same here

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Orion_78 · Jun 09, 2017 at 10:17 AM

Here it is, a way to add a system tray icon : https://alanbondo.wordpress.com/2008/06/22/creating-a-system-tray-app-with-c/

You can completely hide the application with -batchmode (https://forum.unity3d.com/threads/impossible-to-start-a-game-as-a-windows-service.67398/)... keep digging

Here is a way to convert Texture2D to Icon (from https://gist.github.com/zonaryFUND/71b54517056929fa31e0), usefull since System.Drawing.Icon.ExtractAssociatedIcon didn't work for me

 public System.Drawing.Icon ConvertTextureToIcon(Texture2D iconTexture)
     {
         System.IO.MemoryStream memStream = new System.IO.MemoryStream(iconTexture.EncodeToPNG());
         memStream.Seek(0, System.IO.SeekOrigin.Begin);
         System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(memStream);
        return System.Drawing.Icon.FromHandle(bitmap.GetHicon());
     }
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Fragmental · Oct 02, 2018 at 06:22 PM 0
Share

I tried this, using the code from https://alanbondo.wordpress.com/, and if I use System.Windows.Forms.dll from mono, I end up with an extra window. If I use System.Windows.Forms.dll from .Net I can get the 2nd window to hide properly, but with both of them, the unity app window is black until I close the second window, and the system tray. With the .Net dll the unity app window closes too. Also, sometimes it will crash.

I think there is a conflict between some part of Unity and System.Windows.Forms. That might mean that using this method is impossible, but someone with a better knowledge of .Net or $$anonymous$$ono might know better.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Local Notification without unity libraries 0 Answers

MissingMethodException - Parse and iOS 64-bit 1 Answer

Parse push notification on Unity 0 Answers

How to implement customized character into my next scene? 0 Answers

Disable and Enable UI text in function 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges