Skip to content

Commit 5c9dfa7

Browse files
authored
Merge pull request #134 from cairoshell/hide-deleted-tasks
Don't add deleted tasks
2 parents d95e746 + 4248a09 commit 5c9dfa7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ManagedShell.WindowsTasks/ApplicationWindow.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,10 @@ public bool CanAddToTaskbar
360360
bool isToolWindow = (extendedWindowStyles & (int)NativeMethods.ExtendedWindowStyles.WS_EX_TOOLWINDOW) != 0;
361361
bool isAppWindow = (extendedWindowStyles & (int)NativeMethods.ExtendedWindowStyles.WS_EX_APPWINDOW) != 0;
362362
bool isNoActivate = (extendedWindowStyles & (int)NativeMethods.ExtendedWindowStyles.WS_EX_NOACTIVATE) != 0;
363+
bool isDeleted = NativeMethods.GetProp(Handle, "ITaskList_Deleted") != IntPtr.Zero;
363364
IntPtr ownerWin = NativeMethods.GetWindow(Handle, NativeMethods.GetWindow_Cmd.GW_OWNER);
364365

365-
return isWindow && isVisible && (ownerWin == IntPtr.Zero || isAppWindow) && (!isNoActivate || isAppWindow) && !isToolWindow;
366+
return isWindow && isVisible && (ownerWin == IntPtr.Zero || isAppWindow) && (!isNoActivate || isAppWindow) && !isToolWindow && !isDeleted;
366367
}
367368
}
368369

0 commit comments

Comments
 (0)