5

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
Community
  • 1
  • 1
Ali Akbar Azizi
  • 3,272
  • 3
  • 25
  • 44

1 Answers1

1

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.

zx485
  • 28,498
  • 28
  • 50
  • 59
xfox111
  • 98
  • 8