# 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:** 1\
**Showing post:** 2

<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);  
}

//

---

_[View the full topic](https://devforum.zoom.us/t/position-and-resize-the-main-window-standard-ui/26948)._
