Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Winforms and VFP
Message
 
To
07/01/2005 04:17:57
Eyvind W. Axelsen
Profdoc Norge As
Oslo, Norway
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00974826
Message ID:
00975031
Views:
18
Thanks, it works, here the C# version:
[System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint="SetParent")] 
public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);

// In the form
SetParent( (IntPtr)this.Handle, (IntPtr)this.vfpParentHandle );
Only one more question, my winform alway appear on top of any VFP native windows contained in _screen, is there any way to change this ?



>>>I am trying to make a winform stick to a VFP _screen handle, but i can't figure out how to do it.
>>>
>>>Basically the VFP app starts my winform app with "run /n" and sends it's whnd as an argument. I'd like to use the VFP windows handle i received to host my winform just as it was a native VFP form. Is this possible ?
>>
>>All I can say is that I think it is possible. I remember this thread before. There is a Win API call that lets you make an hwind a child of another hwind.
>>
>>Sorry I don't have the exact details.
>>
>>BOb
>
>Try the SetParent API call:
>
>
>DECLARE INTEGER SetParent IN user32 INTEGER hWndChild, INTEGER hWndNewParent
>SetParent(netFormHWnd, _screen.HWnd)
>
>
>
>netFormHwnd is the handle to your .NET window. To find this handle you could for example use the FindWindow API function.
>
>Regards,
>
>Eyvind.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform