A customer noticed that if they add the WS_
style to their window, then the IsIconic
function returns a nonzero value after the user presses Win+D. But if they remove the WS_
style, then then the IsIconic
function always returns FALSE
. What’s going on?
We learned some time ago that the Show Desktop command Win+D first minimizes all windows that can be minimized, and then moves the desktop window to the top of the z-order.
Therefore, the described behavior is expected: If the window has the WS_
style, then it can be minimized, so the Show Desktop command minimizes it, and the IsIconic
function reports that the window is indeed minimized. On the other hand, if the the style is missing, then the window cannot be minimized, so the IsIconic
function reports that the window is not minimized.
Bonus chatter: But why is the function called IsIconic
when it really reports on whether the window is minimized? Shouldn’t it be called IsMinimized
? What is an “iconic” window anyway? Is it a window that is widely recognized as representative for its era?
No. The reason is simple: Before the taskbar was invented, minimized windows were represented by an icon. So the name “is iconic” was correct at the time.
Way to make me feel old for actually remembering what the desktop was like before the taskbar. However, I don’t remember minimized windows being called “iconic”, so IsMinimized seems to be a better name for it than IsIconic even at the time.