[VB.NET2003] how to host a COM application form inside a winform

G

Guest

Hi,

I would like to host the form of a COM application (like Excel or other) in
a winform.
Is there a library to do that or a custom control for vs.net2003 ?

Thx
 
A

Alec Yu

As long as you have the window handle of the form of a Win32/.NET
application,
you can use Win32 API SetParent() to dock it in your Win32/.NET
application.

Sure you must have the window handle of the host window, and of course
you have;
It can be obtained by System.Windows.Forms.Control.Handle property for
a .NET app.
 
G

Guest

Thx Alec

I've found the solution :

Dim hInt as IntPtr = FindWindow(MyClass, vbNullString)
If hIntelliplus.ToInt32 <> 0 Then
hParent = SetParent(hInt, Me.Handle)
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top