Making a non .NET window a parent of a .NET one.

  • Thread starter Thread starter Colin Jack
  • Start date Start date
C

Colin Jack

Hi,

I am working on a project where by a .NET framework DLL links into a non
..NET application and adds functionality to it. Part of the functionality we
are adding is displayed through a .NET form.

The problem I am having is that I cannot find a way to make my .NET form a
child window of the main application. I have tried using APIs such as:

[DllImport("user32.dll")]
static extern long SetParent(long hWndChild, long hWndNewParent);

However this API, and some of the others, dont seem to work even if you are
just dealing with two .NET forms.

Anyway I was wondering if anyone could point me in the right direction as
I'm sure there must be a way to do it ?

Thanks,

Colin
 
Colin,
[DllImport("user32.dll")]
static extern long SetParent(long hWndChild, long hWndNewParent);

However this API, and some of the others, dont seem to work even if you are
just dealing with two .NET forms.

Try it like this instead.

[DllImport("user32.dll")]
static extern IntPtr SetParent(IntPtr hWndChild, IntPtr
hWndNewParent);



Mattias
 

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

Back
Top