tags:

views:

50

answers:

1

Aloha all!

I am trying to use the win32 API to set the parent of an application to a panel in my C# application.

I can get most applications to work... However I have one application which was written in VB6 which I am having problems with...

When I inspect it using spy++ the application loads in 2 main forms 'ThunderRT6Main' and 'ThunderRT6MDIForm' both with the same title.

I have found the handle of both of these and tried to call SetParent on them both but the window does nothing and does not move anywhere...

Is there something funky I need to do when invoking SetParent() on a VB6 app?

+1  A: 

ThunderRT6Main is the hidden owner of every top level form in VB6. It sets the application icon, the one you see in the Applications tab of Task Manager. You can read this interesting article

A window can have a parent or an owner but not both

Basicly you might need WS_CHILD set before calling SetParent.

wqw