How to put the ZOOM Meeting window into my WPF application and how to get the handle for zoom using c#

For those who want to find this later. the solution is the following

IMeetingUIControllerDotNetWrap uictrl_service = CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetUIController();
HWNDDotNet firstHwd = new HWNDDotNet();
HWNDDotNet secondHwd = new HWNDDotNet();
ValueType va_1 = firstHwd;
ValueType va_2 = secondHwd;
uictrl_service.GetMeetingUIWnd(ref va_1, ref va_2);
firstHwd = (HWNDDotNet)va_1;
Console.WriteLine("after call GetMeetingUIWnd: firstHwd.value = " + firstHwd.value);

now this will get you the UI WIndow handle
you can then follow the tutorial here
https://social.msdn.microsoft.com/Forums/en-US/3e599c8c-538c-4da0-87d4-de3eef26b1f7/embed-an-exe-into-a-stackpanel-of-a-wpf-form?forum=wpf

On how to embed into a specific place in your WPF

Make sure you include the necessary resources for your project to be able to use WindowsFormsHost

My Xaml part of concern look like this

        <WindowsFormsHost Margin="10"  Grid.Row="0" Name="ZoomPlace">
            <wf:Panel x:Name="CBox"/>
        </WindowsFormsHost>

The Embed function in the window class was as such

  public void embedZoom()
        {
            IMeetingUIControllerDotNetWrap uictrl_service = CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetUIController();
            ValueType va_1 = new HWNDDotNet();
            ValueType va_2 = new HWNDDotNet();
            uictrl_service.GetMeetingUIWnd(ref va_1, ref va_2);
            HWNDDotNet firstHwd = (HWNDDotNet)va_1;

            SetParent((System.IntPtr)firstHwd.value, CBox.Handle);
            Console.WriteLine("after call GetMeetingUIWnd: firstHwd.value = " + firstHwd.value);
            //SetParent(firstHwd.value,);

            SendMessage((System.IntPtr)firstHwd.value, WM_SYSCOMMAND, SC_MAXIMIZE, 0);

        }

hope this helps some one other than me

2 Likes