I have a WPF project that has an application icon assigned in the "Resources" section of the Application settings. This icon appears in the top-left of this application's windows, despite me not configuring this explicitly. When I use Spy++ to inspect the windows, the window class has a null pointer for the window icon. How is the icon ending up in the windows, and how can I turn it off for specific windows without affecting other aspects of the window's caption? My goal is to have a window that is visually the same as a standard message box, with a standard caption with text and a close button, but no icon and no minimize/maximize buttons. When I follow the instructions laid out in other articles for hiding the window icon, though, the icon still appears. (Specifically, the extended style WS_EX_DLGMODALFRAME and using WM_SETICON to assign a null pointer to ICON_SMALL and ICON_BIG.) If I disable the system menu entirely, then the icon disappears but so does the close button. Why does a standard messagebox have no icon, but my window does implicitly get an icon? How can I turn it off?
Excuse the redactions: