i have a window that i want to minimize (to the taskbar), so i call ShowWindow
:
ShowWindow(Handle, SW_MINIMIZE);
Except that rather than minimizing itself (to the taskbar), the window is iconified:
The window is unparented:
How do i minimize a window to the taskbar?
Update:
Following some advice from 2002, i try setting the WS_EX_APPWINDOW
window style and/or ensuring the window has no owner:
Unfortunately, that changes the behavior of my (Delphi) application because there is now two taskbar icons for my application, rather than one:
This, of course, is an artifact of Delphi (5); and because i was trying to solve another issue.
But that shouldn't affect this question. i'm calling the ShowWindow(..., SW_MINIMIZE)
API, and rather than minimize the window Windows is iconifying the application.
How do i minimize a window to the taskbar?
Windows
or with justWindows-7
, since the question only applies to Windows operating systems with a taskbar: Windows 95-Windows 7 – Pietrekform.WindowState := wsMinimized
, which in turn is callsShowWindow(..., SW_MINIMIZE)
. But i didn't want anyone blaming some 3rd party wrapper, or confuse the issue. The question is what is causing Windows to iconify a window, rather than minimize it. The answer is: "because it has an owner, and doesn't haveWS_EX_APPWINDOW
style". If you want an owned window to minimize to the taskbar you have to create it withWS_EX_APPWINDOW
- that's what the style is there for. As for your "oh please": oh please. – Pietrek