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

Description
I’m using the C# wrapper and was trying to figure out how to embed the ZOOM meeting window into the WPF app.

From what I understood I need to get the window handle using GetMeetingUIWnd(). However when I look at the C# wrapper. It seems to be only an interface with no implementation.

Update I found this Question

And I’m facing the same issue where my Handlers are also null after being called in the IN MEETING Status

 case ZOOM_SDK_DOTNET_WRAP.MeetingStatus.MEETING_STATUS_INMEETING:
                        {
                       ValueType firstHwd = null;
                        ValueType secondHwd = null;
                        IMeetingUIControllerDotNetWrap meetingUI = CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetUIController();
                        ZOOM_SDK_DOTNET_WRAP.SDKError error = meetingUI.GetMeetingUIWnd(ref firstHwd, ref secondHwd);

                    //TODO: let's check if error is fine and then get the WIndows Handle UI. Error is okay
                    Console.WriteLine("We are seeing Handle");
                    Console.WriteLine(error);
                    Console.WriteLine(firstHwd.ToString());
                    Console.WriteLine(secondHwd.ToString());
                }
                break;
            default://todo
                break;

The Questions

  1. Is there a way to get the Windows UI handle using C# that I’m not aware of? Am I doing this wrong?
  2. Why does Windows UI handle needs two views passed to it instead of one?
  3. Is there any advice on how I would import Zoom Window into my application?

Which Client Desktop SDK version?
v5.4.54802.0124

Device (please complete the following information):

  • Dell XPS 15 9560
  • Windows 10 120H2

Other Resources I’ve checked

I have already checked the resources and answers given to these questions. None of them were clear-cut on what to do.

Hey @ekaram,

Thanks for using the dev forum!

I have looked into this and have some suggestions. Yes, GetMeetingUIWnd is intended to retrieve the main meeting window. The reason there is a “firstView” and a “secondView” is because the firstView will be the meeting window in your primary monitor, and the secondView will be the meeting window on a second monitor if you have one. The secondView will be NULL is there is no second monitor. As for why the firstView is returning NULL, I am suspecting the wrapper does not fully implement the C++ version. The C# wrapper is not actively maintained by Zoom, and therefore does not have 100% of the functionality that the original version does.

Thanks!
Michael

Thanks, Michael!!
Any advice on how I might do the following?

Hey @ekaram,

Hmm, I am trying to figure that out, but it looks like that function is not used by the demo app. Are you using the default Zoom UI? Or are you trying to set up a custom UI?

Michael

I want to try to get something like this.

So We would like the default Zoom UI in a part of our application

Hey @ekaram,

I take it you have already got the meeting showing correct? As in, you are trying to call GetMeetingUIWnd after the window has already successfully presented?

Michael

Yup
This is called when we are in the meeting. We don’t mind setting up a zoom Call with ZOom staff to make information better

Hey @ekaram,

Sorry about the delay, it has been unusually busy lately. Anyways, I finally got some time to test this. I used the c++ demo application and called this method in the same place you did. After the call, the firstWnd parameter was not NULL. So, my suspicion is that the wrapper does not correctly implement this function the way it should. I went to download the latest C# wrapper but it looks like we have a bug on the Zoom Marketplace that is listing the December release instead of the most recent release. :sweat_smile: However, what I was going to test was if the C# wrapper has a broken implementation of this function.

There is a very similar method to this one in the wrapper for the same class called ShowParticipantsListWnd which also takes in a window handle. Would you mind starting a meeting and then after the meeting is displayed call that function to see if that function works? This will tell us if the meeting window function is broken. If that method doesnt work, can you see if any other UIController methods are working. If none of them are, it is likely that the class was wrapped incorrectly in the wrapper.

Thanks!
Michael

1 Like

When using ShowParticipantsListWnd

case ZOOM_SDK_DOTNET_WRAP.MeetingStatus.MEETING_STATUS_INMEETING:
                    {

                        // Load the meeting partipants now
                        // Would be best to update the observable list. Instead of tying a new one https://gist.github.com/tymorrow/9397870
                        ParticipantManager.instance.GetParticipantsInMeeting();
                        //would be best to show the Ui When we are in the meeting here. This is the view we actually care about
                        hAP_MainWindow.Show();
                        

                        
                        ValueType firstHwd = null;
                        ValueType secondHwd = null;
                        IMeetingUIControllerDotNetWrap meetingUI = CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetUIController();
                        //ZOOM_SDK_DOTNET_WRAP.SDKError error = meetingUI.GetMeetingUIWnd(ref firstHwd, ref secondHwd);
                        SDKError error = meetingUI.ShowParticipantsListWnd(true, ref firstHwd);
                        //TODO: let's check if error is fine and then get the WIndows Handle UI. Error is okay
                        Console.WriteLine("We are seeing Handle");
                        Console.WriteLine(error);
                        Console.WriteLine(firstHwd);
                        Console.WriteLine(secondHwd);
                    }
                    break;

I still get null in this situation but I am able to open the participant list in this situation. I tried with ShowChatDlg but I get the following error when I pass the null value type. (SDKERR_INVALID_PARAMETER)

I went to download the latest C# wrapper but it looks like we have a bug on the Zoom Marketplace that is listing the December release instead of the most recent release.

Please note that I did not update the C# wrapper. Does marketplace know have the updated C# wrapper?

Hey @ekaram,

Thank you for testing that! That is very useful information.

This sounds like some type of reference bug in the wrapper. Would you be able to send over your code and sdk logs in an email to DeveloperSupport@zoom.us so that I can forward them to the engineers to investigate? Please provide a link to this post and mention my name.

As of this very moment no. We are in the process of updating the Zoom Marketplace and a bug has been created that removed the most recent C# wrapper. This should be fixed really soon.

Thanks!
Michael

Thanks Michael!! I just sent the email with the example code to see what we are having trouble with

I also linked this post and mentioned your name. I copied the outputs of the project into a TEXT file and sent it as well

Hey @ekaram,

Thank you for doing that! I have received them and will follow up with you there.

Thanks!
Michael

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

Hey @ekaram,

Thank you for providing this :slight_smile:

Michael

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.