471,607 Members | 2,475 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,607 software developers and data experts.

[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 1362
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 XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.