Use .Net WindowForm in a MDI application written in VB6.

V

vodiox

We have a MDI application write in VB6. It's a complex application so
it is not reasonable to rewrite the entire the program in .net, now.

We have developed some .Net WindowForm and now we want to use them in
the MDI application. We tried to use SetParent WinAPI to make the
WindowForm a
mdichild (setting WS_CHILD and unsetting WS_POPUP with SetWindowLong
API).

The problem is that the .Net WindowForms are always on top respect
other VB6 MDI Child.
VB6 Forms can't move to the front of .net WindowForm in MDI Space.
We tried playing around with the TopMost properties of a form and that
didn't work (setting TopMost property and using SetWindowPos WinAPI).
We also tried playing around with the z-order and that didn't work
either.

Anyone can help us.
 
H

Herfried K. Wagner [MVP]

* (e-mail address removed) (vodiox) scripsit:
We have a MDI application write in VB6. It's a complex application so
it is not reasonable to rewrite the entire the program in .net, now.

We have developed some .Net WindowForm and now we want to use them in
the MDI application. We tried to use SetParent WinAPI to make the
WindowForm a
mdichild (setting WS_CHILD and unsetting WS_POPUP with SetWindowLong
API).

This won't make the form to be a real MDI child.
 
V

vodiox

Hi Herfried.

OK, this won't make the form to be a real MDI child.

Is it possible to make a .Net WindowForm to be a real MDI child in VB6 ?
 
H

Herfried K. Wagner [MVP]

V

vodiox

* (e-mail address removed) (vodiox) scripsit:

I have never played around with that. You will find the documentation
of the necessary calls here (I don't know if it will work because the
form is part of another process):

<http://msdn.microsoft.com/library/e...rface/Windowing/MultipleDocumentInterface.asp>

Herfried,
Thanks for your help.

The link to documentation was indispensable to solve my problem.

My problem is that the .Net WindowForms are always on top
respect other VB6 MDI Child and not that SetParent WinAPI don't create real
MDI child, now.

To solve this

I substitute
. . .
SetParent(hwndChild,hwndParent)
. . .
with
. . .
l_RealParent = GetWindow(hwndParent,GW_CHILD);
SetParent(hwndChild,l_RealParent);
. . .

Vielen Dank für Eure Hilfe.
 

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