On Mon, 30 Nov 2020 18:20:08 -0800 (PST) LIANG ZHOU wrote:
LZ> Sorry for the unclear statements. In my option, a message box should not
LZ> show any title bar icon in any circumstance, unless it is told to do that.
LZ> I never run into this problem when using the native system API, both on
LZ> Windows and macOS.
I'm almost certain that the icon is selected automatically by the system
depending on the parent window, i.e. you should see exactly the same
behaviour if you use task dialog directly from Win32 API.
LZ> My app is a system tray one with a hidden main window. When users click a
LZ> context menu item from the system tray icon, i need to show a info message
LZ> box sometimes. When the message box is shown from the main hidden window,
LZ> it always show a small info icon on the title bar. But this problem never
LZ> happens when it's shown from non-main windows. Thanks!
You should probably be able to give your message box a non-main window as
parent (if necessary creating a dummy hidden window just for it, I guess).
But I honestly thought the problem was something more serious, e.g. showing
a wrong icon or not showing the expected icon. IMHO showing the icon in the
title bar is really not a big deal and it seems perfectly normal to me,
this is what all normal windows do and many dialogs (e.g. "File open") do
this too.