Hi
When migrating af huge windows system from VB6 to C#, it has to be done in small step
in order to be feasible
The system I'm working on is an MDI system in VB6. We would like to be able to migrate a few windows at a time
Thus we need to be able to make a WinForm an MDI child of a VB6 MDI form
It is easy enough to invoke the WinForm from VB6. This is done by COM enabling it, and providing public functions for starting it
When I want to make it an MDI child I get into servere trouble.
The best effort I have made so far makes use of WinAPI calls like thi
lhwndParent = GetWindow(mdiFrm.hwnd, GW_CHILD
SetParent lhwnd, lhwndParen
SetWindowLong lhwnd, GWL_STYLE,
((GetWindowLong(lhwnd, GWL_STYLE) Or WS_CHILD Or WS_SYSMENU) And Not WS_POPUP
Were lhwnd is the handle to the WinForms window
And mdiFrm.hwnd is the handle to the VB6 MDI form
This makes the WinForm act like an MDI child
However som very important aspects are missing
1. When activating the MDI child the title bar is greyed (in reality only the VB6 MDI form is activated
2. The Child doesn't appear in the Windows list in the menu bar of the VB6 MDI
3. Tab keys and arrow keys doesn't work on the MDI child (this is the worst one in our system
4. When maximized the child doesn't "share" its titlebar with the MDI parent
So how can I make the WinForm a true MDI child of the VB6 application
If this is not possible then how do I fake this behaviour ? Any Ideas
(Hope this is the right newsgroup for posting this message
Regards nieder
DotNetJunkies User - 01 Jul 2004 13:43 GMT
Thanks for the useful post.
Do you have any more verbose sample source code to do this sort of thing?
I'm quite new to using winapi calls in VB and thus am getting a bit lost.
Regards,
J. Mercer
---
DotNetJunkies User - 23 Sep 2004 15:11 GMT
I am realy struggling to get you suggestion working. But not succeeded yet. Could you please pass on the exact source code?
Thanks in advance.
VH
---