I'm trying to hide UWP application from taskbar.
I found two way from this question for windows application but that's not works in UWP.
1.Delete WS_EX_TOOLWINDOW
and add WS_EX_APPWINDOW
to windows styles.
2.Delete it from taskbar with ITaskbarList::DeleteTab
.
I Have problem with handler. The MainWindowHandle
is empty! I know its because of the UWP, But how can I do it now?
Process[] p = Process.GetProcessesByName("Microsoft.StickyNotes");
IntPtr windowHandle = p[0].Handle;
var taskbarList = (ITaskbarList)new CoTaskbarList();
taskbarList.HrInit();
taskbarList.DeleteTab(windowHandle); //doesn't do anything
Unfortunately, You can't hide it. Running in foreground app cannot be hidden from task bar. UWP doesn't support it at all yet.
But you can use background tasks. Here's an answer for a similar problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With