# Position and Resize the main window. Standard UI

**URL:** <https://devforum.zoom.us/t/position-and-resize-the-main-window-standard-ui/26948>\
**Category:** Windows\
**Created:** [August 12, 2020, 3:15pm UTC](https://devforum.zoom.us/t/position-and-resize-the-main-window-standard-ui/26948 "2020-08-12T15:15:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajc0006](https://avatars.discourse-cdn.com/v4/letter/a/f9ae1b/32.png) [@ajc0006](https://devforum.zoom.us/u/ajc0006)\
**Post date:** [August 12, 2020, 3:15pm UTC](https://devforum.zoom.us/t/position-and-resize-the-main-window-standard-ui/26948/1 "2020-08-12T15:15:37Z")

</div>

**Description**

I am using the UI Standard.  
I want to control the size and position of the main window.

At the moment I can only control the initial position of the window (left and top).  
I have not been able to control the width and height of the window.  
Is this possible to do?

**Which version?**  
Windows SDK: v5.0.24433.0616

I’m using C# wrapper last version

var a1 = ZOOM\_SDK\_DOTNET\_WRAP.CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap();

```
        var x1 = System.Windows.SystemParameters.PrimaryScreenWidth - 255; // width
        var y1 = System.Windows.SystemParameters.FullPrimaryScreenHeight - 20; // height
        var c = a1.GetMeetingConfiguration();
    
        WndPosition wp = new WndPosition();
        wp.left = (int)x1;
        wp.top = 0;
      
        c.SetMeetingUIPos(wp);
```

---

<div class="post-metadata">

**Author:** ![ajc0006](https://avatars.discourse-cdn.com/v4/letter/a/f9ae1b/32.png) [@ajc0006](https://devforum.zoom.us/u/ajc0006)\
**Post date:** [August 27, 2020, 2:14am UTC](https://devforum.zoom.us/t/position-and-resize-the-main-window-standard-ui/26948/2 "2020-08-27T02:14:48Z")

</div>

I directly used the windows user32 library in order to position the main window in C#  
…

[DllImport(“user32.dll”, SetLastError = true)]  
static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);

```
    [DllImport("user32.dll", SetLastError = true)]
    internal static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);

    [DllImport("user32.dll")]
    internal static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
    internal static readonly IntPtr HWND_TOPMOST = new IntPtr(-1);
    const UInt32 SWP_NOSIZE = 0x0001;
    const UInt32 SWP_NOMOVE = 0x0002;
    const UInt32 SWP_SHOWWINDOW = 0x0040;

```

…

public ValueType handlerfirstViewZoom = new HWNDDotNet();  
public ValueType handlersecondViewZoom = new HWNDDotNet();

var a1 = ZOOM\_SDK\_DOTNET\_WRAP.CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap();  
var controla = a1.GetUIController();

var errWindow = controla.GetMeetingUIWnd(ref handlerfirstViewZoom, ref handlersecondViewZoom);  
if (errWindow == SDKError.SDKERR\_SUCCESS)  
{

}

…

// To position the main window side by side with my form.  
// Do it in the Move and ResizeEnd events of the form.

if (((HWNDDotNet)handlerfirstViewZoom).value != 0)  
{  
MoveWindow((IntPtr)(((HWNDDotNet)handlerfirstViewZoom).value), 0, this.Top, this.Left + 9, this.Height, true);  
}

//

---

<div class="post-metadata">

**Author:** ![fpujol](https://avatars.discourse-cdn.com/v4/letter/f/df705f/32.png) [@fpujol](https://devforum.zoom.us/u/fpujol)\
**Post date:** [May 27, 2021, 2:33am UTC](https://devforum.zoom.us/t/position-and-resize-the-main-window-standard-ui/26948/3 "2021-05-27T02:33:45Z")

</div>

Hey @ajc0006 !!

Your code helped me to embed zoom into my C# app. Thanks for that!

But Im facing a bug when the user double clicks the zoom window:

> [@Disabling left Button Double Click to Switch FullScreen Mode](https://devforum.zoom.us/t/disabling-left-button-double-click-to-switch-fullscreen-mode/51108):
>
> Hello Everyone!! I am having trouble in disabling the double click function to enter or exit the Full Screen Mode: CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetMeetingConfiguration().EnableLButtonDBClick4SwitchFullScreenMode(false); This line of code seems to work fine while there is only one participant in the meeting. But as soon as one or more participants join, the double click becomes functional again and I can’t disable it. I tried adding this line also every time a user joi…

Have you been facing that bug? If you did, can you share your solution?  
Thanks a lot!!

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [May 28, 2021, 10:17pm UTC](https://devforum.zoom.us/t/position-and-resize-the-main-window-standard-ui/26948/4 "2021-05-28T22:17:00Z")

</div>

Hey @fpujol,

Please see my comment on that post. Thanks! 🙂

Michael

---

<div class="post-metadata">

**Author:** ![fpujol](https://avatars.discourse-cdn.com/v4/letter/f/df705f/32.png) [@fpujol](https://devforum.zoom.us/u/fpujol)\
**Post date:** [May 29, 2021, 5:51pm UTC](https://devforum.zoom.us/t/position-and-resize-the-main-window-standard-ui/26948/5 "2021-05-29T17:51:30Z")

</div>

Done!  
Thanks to you!

Fernando

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [June 1, 2021, 8:12pm UTC](https://devforum.zoom.us/t/position-and-resize-the-main-window-standard-ui/26948/6 "2021-06-01T20:12:38Z")

</div>

@fpujol,

Awesome, will follow up with you there.

Thanks!  
Michael
