tryphotino / photino.NET

https://tryphotino.io
Apache License 2.0
885 stars 73 forks source link

Possibility to hide the window from the taskbar/dock #107

Open ThuCommix opened 1 year ago

ThuCommix commented 1 year ago

I'm providing my own interface for Spotify with an AvaloniaUI application, and everything is covered through APIs from Spotify except registering a local playback device and play through this. This is only possible with the websdk:

https://developer.spotify.com/documentation/web-playback-sdk/

However as the name suggests it only works in a browser and Avalonia does not support browser like controls (without bundling 200mb chromium) This is where this create project comes to play, I already tried it out and it works absolutely fine with registering the player and having playback BUT: I kinda need to hide the window because in itself it provides no feedback its just for registering the player and having soundout, the JS will be controlled with a websocket connection between the page its displaying and the main Avalonia application.

Is it maybe possible to add the feature that the window can be hidden from the taskbar/dock?

Thanks for reading :)

ottodobretsberger commented 1 year ago

Looks like there are some options to achieve that, talked about in these SO threads: https://stackoverflow.com/questions/33538264/win32-is-it-possible-to-show-the-window-but-to-hide-it-from-taskbar https://stackoverflow.com/questions/2157712/remove-application-from-taskbar-with-c-sharp-wrapper https://stackoverflow.com/questions/2285860/change-win32-window-style

An implementation example can be found here: https://www.codeproject.com/Articles/191/Creating-an-application-with-no-taskbar-icon and here: https://www.codeproject.com/articles/6720/how-to-hide-a-window-in-taskbar#:~:text=To%20hide%20all%20windows%20in%20a%20process%20you,interface%20to%20remove%20the%20window%20from%20the%20taskbar.

With additional documentation here: https://learn.microsoft.com/en-us/windows/win32/winmsg/extended-window-styles

For Mac there is an approach here: https://stackoverflow.com/questions/23313571/hiding-the-dock-icon-without-hiding-the-menu-bar/23314366#23314366

For Linux on GTK based UI: https://stackoverflow.com/questions/51323238/x11-create-a-window-without-showing-up-on-taskbar

Seems like something we could put on our radar to tackle in the future, unless someone would like to give it a shot and provide a PR :-)