Using C++Builder and opening a vcl subform with ShowModal()
results with no taskbar entry and minimize doesn't minimize to taskbar (it's placed in lower left of the desktop).
Is there a setting I should enable for that to occur?
TIA!!
Only a top-level unowned window that has the WS_EX_APPWINDOW
style applied to it will automatically appear on the Taskbar.
By default, sub-forms are owned by either the active TForm
, the TApplication::MainForm
, or the TApplication
window, depending on various criteria at the time the sub-form is displayed. Thus, why they do not appear on the Taskbar.
If you want a sub-form to appear on the Taskbar, you can either:
override its virtual CreateParams()
method to set the TCreateParams::WndParent
field to 0
(or to the desktop HWND
returned by GetDesktopWindow()
), and to add the WS_EX_APPWINDOW
style to the TCreateParams::ExStyle
field.
alternatively, use ITaskbarList::AddTab()
to manually add a button to the Taskbar and associate it with the HWND
returned by the sub-form's Handle
property.