简体   繁体   English

在表单中打开应用程序 - C#或VB.NET

[英]Opening an application inside a form - C# or VB.NET

I am writing an application and I would like to be able to display another application inside it. 我正在编写一个应用程序,我希望能够在其中显示另一个应用程序。 (Think like a windows form with a small box, or a tab that is displaying a totally seperate application.) (想象一下带有小盒子的窗体,或者显示完全独立应用的标签。)

Is that something that can be done? 这是可以做到的吗? If so, can anyone give some direction on how to go about doing it? 如果是这样,任何人都可以就如何去做一些指示吗?

I am looking for something in the C# or VB.NET world. 我正在寻找C#或VB.NET世界中的东西。

THANKS! 谢谢!

You need a hWnd (handle) of window from another application. 你需要来自另一个应用程序的hWnd(句柄)窗口。 Then you need a hWnd of container control in you application (System.Windows.Forms.Control.Handle property). 然后,您需要在应用程序中使用hWnd容器控件(System.Windows.Forms.Control.Handle属性)。

Then you need use a Win32API function SetParent , and that all you need. 然后你需要使用Win32API函数SetParent ,这就是你所需要的。 On the SetParent page is little sample, which should do what you need. 在SetParent页面上是一个小样本,它应该做你需要的。

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

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