tryphotino / photino.NET

https://tryphotino.io
Apache License 2.0
911 stars 74 forks source link

System tray task #224

Open Jaffoo opened 3 days ago

Jaffoo commented 3 days ago

How do I create a system tray task?

raddevus commented 2 days ago

FYI - System Tray is not in scope, see the closed issue: https://github.com/tryphotino/photino.NET/issues/171

Jaffoo commented 2 days ago

FYI - System Tray is not in scope, see the closed issue: #171

I find it, but how can I hide the window? The Photino does not support hidden windows.

raddevus commented 1 day ago

In your Program.cs when the main window is being created & instantiated you can try the following.

Set the size of the window to 0 x 0 with the SetSize(0,0) call.

// at the bottom of Program.cs right before the event loop is started (before WaitForClose() is called
        .Load("wwwroot/index.html"); // Can be used with relative path strings or "new URI()" instance to load a website.
window.SetSize(0,0);          
window.WaitForClose(); // Starts the application event loop

This is a workaround, but it will cause the window to be 0 pixels by 0 pixels and if the user clicks on the taskbar icon then no window will show. Not perfect, but may get you to your solution.