Closed Tide closed 2 years ago
Yes it’s possible. In fact it’s what the minimize to tray button does
I see that minimize to tray is calling Hide(). I want to show the window but not the taskbar icon. I found this post https://stackoverflow.com/a/9404749 describing a way to do it but I have had no luck so far.
I also found this https://docs.microsoft.com/en-us/windows/win32/shell/taskbar and it has a section called "Managing Taskbar Buttons" that says "The Shell will remove a window's button from the taskbar only if the window's style supports visible taskbar buttons. If you want to dynamically change a window's style to one that does not support visible taskbar buttons, you must hide the window first (by calling ShowWindow with SW_HIDE), change the window style, and then show the window."
This post as well is showing something about the toolwindow as well https://stackoverflow.com/a/3261489
After learning more about WinUI3 and other things I figured out "IsShownInSwitchers" is the same as "ShowInTaskbar" was before. That combined with your library does what I am looking for.
Thanks for your work on this.
Is adding in a ShowInTaskbar property like the one in WPF possible? I see in your demo that the taskbar icon goes away when minimizing to tray. This is perfect for my application. The only part I need to add is to have it not show the taskbar icon when the window is showing.
Thanks, Tide