469,140 Members | 1,128 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,140 developers. It's quick & easy.

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

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
Jan 31 '06 #1
2 1292
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.

Feb 1 '06 #2
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

"Alec Yu" wrote:
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.

Feb 6 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Seth Bourne | last post: by
3 posts views Thread by Claudia Fong | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.