Share via

How to remove the duplicate application icons on taskbar in kiosk mode?

Liang, Ming 101 Reputation points
2026-03-11T00:30:55.6933333+00:00

We have a WinUI 3 application that runs in kiosk mode.(Implemented using Shell Launcher v2)

Here is how to reproduce duplicate application icons on taskbar:

Steps:

  1. Turn on kiosk mode in application.
  2. Logon user. (Application start running in kiosk mode)
  3. Set power&sleep: screen will turn off after 1 minute, sleep after 1 minute.
  4. In windows settings Account tab: set sign-in option windows will require you to sign in again after 1 minute.
  5. Waiting for 10 minutes, then logon user account. The application is restarted and there is a application icon on the taskbar.

If you repeat the step 5 again, you will find two application icons on the taskbar. These two icons can be removed by signing out or restart the system. Is there anyway to remove these duplicate icons programmatically(like API call to force the shell to refresh)? Thanks.

Windows development | WinUI

Answer accepted by question author
  1. Jack Dang (WICLOUD CORPORATION) 16,595 Reputation points Microsoft External Staff Moderator
    2026-03-11T03:59:12.64+00:00

    Hi @Liang, Ming ,

    Thanks for reaching out.

    When the system sleeps and the user is required to sign in again, Shell Launcher v2 launches the kiosk app again as part of the logon process. In some cases the previous taskbar registration isn’t fully cleaned up by the shell, so when the new instance starts, the shell creates another taskbar entry instead of reusing the existing one, which is why the icons accumulate until a full sign-out or system restart resets the shell state.

    Unfortunately, there isn’t a supported Windows API that allows an application to directly force the taskbar to refresh or remove stale icons. The taskbar is managed by Windows Explorer, and applications generally don’t have a way to programmatically clear or rebuild those entries.

    That said, there are a couple of things worth checking on the application side that can sometimes prevent duplicate icons from appearing:

    • Ensure the app uses a consistent AppUserModelID across launches. Windows groups taskbar buttons based on this ID, and if it changes between launches the shell may treat each restart as a separate application.
    • Confirm the app is not unintentionally creating multiple windows during initialization (which can also result in multiple taskbar buttons).
    • If possible, ensure only a single instance of the application is allowed to run.

    If you found my response helpful or informative in any way, I would greatly appreciate it if you could follow this guidance provide feedback. 

    Thank you.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.