I have a Application mostly written with the owl-libary.
There I want open new vcl-windows out of the main owl-window.
This works great, though if a dialog-window is opened (even with ShowModal
) and I focus another application, then the main-window get's into foreground but is blocked by the window behind it.
I guess the Problem is the missing parent-setting.
However, I can't convert owl's TWindow
to vcl's TWinControl
.
Is there a trick to set a vcl's parent
setting to a owl's TWindow
-Object?
Or could this be caused by something entirely different?
EDIT: I'm using...
void(TWindow* parent){
Form=new TForm((HWND)parent->Handle);
Form->ParentWindow=parent->Handle;
Form->BorderIcons >> biMinimize >> biMaximize << biSystemMenu; //No minimize, no maximize, but close
Form->BorderStyle = bsSingle;
Form->Position = poMainFormCenter;
...
Form->ShowModal();
...now. However, the new window is locked up and can not be clicked/closed/switched to. Is there something I missed in using ParentWindow?
EDIT2:
I think it might be a Problem that the parent is a TDecoratedMDIFrame
, which is a MDI-Container, so my dialog is treated like a mdi-child instead of a normal dialog...
TWinControl
has a ParentWindow
property for specifying a non-VCL parent window.
Also, in modern VCL versions, you can specify a ParentWnd
when displaying a VCL dialog.