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