简体   繁体   English

来自 C# 应用程序的 VB6 应用程序上的 SetParent()

[英]SetParent() on a VB6 application from a C# app

I am trying to use the win32 API to set the parent of an application to a panel in my C# application.我正在尝试使用 win32 API 将应用程序的父级设置为我的 C# 应用程序中的面板。

When I inspect it using Spy++ the application loads in 2 main forms ThunderRT6Main and ThunderRT6MDIForm both with the same title.当我使用 Spy++ 检查它时,应用程序以 2 个主要形式加载ThunderRT6MainThunderRT6MDIForm两者都具有相同的标题。

I have found the handle of both of these and tried to call SetParent on them both but the window does nothing and does not move anywhere...我找到了这两个的句柄并试图对它们调用SetParent但窗口什么也不做也不会移动到任何地方......

Is there something funky I need to do when invoking SetParent() on a VB6 app?在 VB6 应用程序上调用SetParent()时我需要做一些时髦的事情吗?

ThunderRT6Main is the hidden owner of every top level form in VB6. ThunderRT6Main是 VB6 中每个顶级表单的隐藏所有者。 It sets the application icon, the one you see in the Applications tab of Task Manager.它设置应用程序图标,即您在任务管理器的“应用程序”选项卡中看到的图标。 You can read this interesting article你可以阅读这篇有趣的文章

A window can have a parent or an owner but not both 一个窗口可以有一个父级或一个所有者,但不能同时有

Basicly you might need WS_CHILD set before calling SetParent .基本上,您可能需要在调用SetParent之前设置WS_CHILD

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

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