The shell notification HSHELL_
means that there is a new top-level unowned visible window. Conversely, HSHELL_
means that a window is no longer a top-level unowned visible window. But these state changes can occur for reasons other than a window being created and destroyed. For example, if a top-level window hides itself, then that will generate a HSHELL_
notification, even though no window was destroyed.
Why don’t the names align with what they mean?
These notifications were named while wearing taskbar-colored glasses.
These notifications were created to assist the taskbar in keeping track of the windows in the system. The taskbar shows top-level unowned visible windows, so that’s what the notifications pay attention to. If you hide a top-level unowned window, it hasn’t been destroyed, but it may as well have been destroyed as far as the taskbar is concerned: The window disappears from the taskbar.
Conversely, when the window becomes visible again, it gains a taskbar button. As far as the taskbar is concerned, it may as well have been newly-created.
"These notifications were named while wearing taskbar-colored glasses."
I suppose that's part of the problem. But really, it goes deeper than that. Because even taking into account "taskbar-colored glasses", it's clear from your explanation that the task bar doesn't really actually know or care about windows being created and destroyed, but rather whether they are candidates for the task bar.
Better names would reflect the actual needs and behavior of the task bar. E.g. something like HSHELL_WINDOWTASKBARADD/HSHELL_WINDOWTASKBARREMOVE,...
20+ years ago when this was created, it was undocumented functionality, so I’m just glad it exists at all. What I really wish for though is HSHELL_WINDOWMOVED and/or HSHELL_WINDOWSIZED. There’s no way to update the position/aspect ratio of live window thumbnails unless you poll.