简体   繁体   English

c + +:owlnext + vcl:新窗口缺少其父级

[英]c++: owlnext + vcl: New Window missing its Parent

I have a Application mostly written with the owl-libary. 我有一个主要用owl-libary编写的应用程序。

There I want open new vcl-windows out of the main owl-window. 在那里,我想从主猫头鹰窗口中打开新的vcl-windows。
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. 这很好用,尽管如果打开对话框窗口(即使使用ShowModal ),并且我将焦点放在另一个应用程序上,那么主窗口get会进入前景,但会被其后面的窗口阻塞。

I guess the Problem is the missing parent-setting. 我猜问题出在缺少父母的地方。

However, I can't convert owl's TWindow to vcl's TWinControl . 但是,我无法将owl的TWindow转换为vcl的TWinControl

Is there a trick to set a vcl's parent setting to a owl's TWindow -Object? 是否有技巧将vcl的parent设置设置为猫头鹰的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? 我在使用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... EDIT2:我认为父级为TDecoratedMDIFrame可能是一个问题,它是MDI容器,因此我的对话框被视为mdi-child而不是普通对话框...

TWinControl has a ParentWindow property for specifying a non-VCL parent window. TWinControl具有ParentWindow属性,用于指定非VCL父窗口。

Also, in modern VCL versions, you can specify a ParentWnd when displaying a VCL dialog. 另外,在现代VCL版本中,可以在显示VCL对话框时指定ParentWnd

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM