Skip to content

fix: Process Manager counts a Store app as the app it is, and a window Windows keeps hidden makes nothing an app - #2936

Merged
laurentiu021 merged 1 commit into
mainfrom
fix/store-apps-count-as-apps
Oct 21, 2026
Merged

laurentiu021 merged 1 commit into
mainfrom
fix/store-apps-count-as-apps

Conversation

@laurentiu021

Copy link
Copy Markdown
Owner

Closes #2869.

What I could see here, with a read-only walk of the top-level windows while Settings and Calculator were open but not on screen: each had an ApplicationFrameWindow owned by ApplicationFrameHost with its title and no CoreWindow inside, and each app had a top-level Windows.UI.Core.CoreWindow of its own, cloaked by the shell. So the old map credited both apps through those windows, and also credited ApplicationFrameHost through the first frame, which is how it came to be listed as an app. Windows cloaked by their own app passed too: explorer helper windows and a hidden tool window. With an app on screen its CoreWindow sits inside the frame, which is the case the issue describes, where the frame was all there was to credit; I did not bring a window up on this PC to watch that, so the tests feed both shapes.

The changes:

  • QueryMainWindowsByPid collects each visible top-level window with its owner, class, DWM cloak flags (DwmGetWindowAttribute(DWMWA_CLOAKED)) and, for a frame, the CoreWindow inside it (FindWindowExW), and the new MainWindowsOf decides. GetClassNameW and FindWindowExW bind their wide entry points; DwmGetWindowAttribute has no A/W pair.
  • A frame is credited to the process of the CoreWindow inside it, and that window is the one the hung check reads: the frame's process keeps answering when the app stops. A frame with nothing inside, or only a window of its own host, credits nothing, so ApplicationFrameHost is no longer an app.
  • A window cloaked by its app (DWM_CLOAKED_APP) or inside a cloaked one (DWM_CLOAKED_INHERITED) is skipped. One the shell cloaks (DWM_CLOAKED_SHELL) still counts: a window on another virtual desktop, and a Store app's own window while it is not on screen, are both cloaked that way.
  • Run through the real enumeration here, the map lost ApplicationFrameHost and the hidden tool window and kept Calculator and Settings.

Not changed: the touch keyboard's host, TextInputHost, has a top-level CoreWindow the shell cloaks, as a Store app's is while not on screen, so it still counts as an app. Telling the two apart needs more than the window shows.

Docs

README, Process Manager: "Show only apps" counts a Store app as itself, and a hidden window does not make a program an app.

Tests

  • New in ProcessManagerServiceTests: a Store app's frame with the app's window inside makes the app an app, and the hung check reads that window, through SnapshotAsync; MainWindowsOf credits the frame to the app and not to its host, credits nothing for a frame with no app inside or with its own host's window, skips windows cloaked by their app or inside a cloaked one, keeps a window the shell cloaks, and takes the topmost unowned window over a dialog.
  • Red before the fix, green after, each undone on its own: a frame treated as a window of its host; cloaked windows counted; every cloaked window skipped, the shell's too; and a frame hosting its own host's window credited.
  • Run locally, twice: ProcessManagerServiceTests, ProcessManagerViewModelTests, ProcessManagerSettledTabTests, ArchitectureTests and InclusiveTermsTests (354), and the integration ProcessManagerKillTests and FileLockKillTests (4). All four projects build with 0 warnings, and dotnet format --verify-no-changes is clean.

…w Windows keeps hidden makes nothing an app

- ProcessManagerService.MainWindowsOf decides each process's main window from the visible top-level windows that
  QueryMainWindowsByPid collects, now with their class, cloak flags and, for an ApplicationFrameWindow, the
  Windows.UI.Core.CoreWindow inside it.
- A frame is credited to the process of the CoreWindow inside it, with that window as the one the hung check reads, and
  a frame with no app inside credits nothing, so ApplicationFrameHost is no longer an app.
- A window cloaked by its own app, or inside a cloaked one, is skipped; one the shell cloaks, on another virtual desktop
  or a Store app's while it is not on screen, still counts.
@laurentiu021
laurentiu021 merged commit 92ae31a into main Oct 21, 2026
6 checks passed
@laurentiu021
laurentiu021 deleted the fix/store-apps-count-as-apps branch October 21, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Process Manager — "Show only apps" hides open Store apps such as Settings and Calculator, which can never read "Not responding"

1 participant