# Windows SDK C# wrapper Keep on Top

**URL:** <https://devforum.zoom.us/t/windows-sdk-c-wrapper-keep-on-top/27019>\
**Category:** Windows\
**Created:** [August 13, 2020, 9:17am UTC](https://devforum.zoom.us/t/windows-sdk-c-wrapper-keep-on-top/27019 "2020-08-13T09:17:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HyoSeong](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hyoseong/32/10657_2.png) [@HyoSeong](https://devforum.zoom.us/u/HyoSeong)\
**Post date:** [August 13, 2020, 9:17am UTC](https://devforum.zoom.us/t/windows-sdk-c-wrapper-keep-on-top/27019/1 "2020-08-13T09:17:35Z")

</div>

I modified zoom\_sdk\_dotnet\_wrap to use DisableTopMostAttr4SettingDialog function,  
but it didn’t work.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/d/dfae9ea20d8bf508f9733af2bd8344cd8960864a.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/e/e5410989ef62d9bdbe15d30087c5deef71bf53b0.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/d/d40713e2ebf9625a1a7cf987def8ae05ca2c3cc9.png)

How can I Keep on Top the zoom SDK client?

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [August 15, 2020, 12:51am UTC](https://devforum.zoom.us/t/windows-sdk-c-wrapper-keep-on-top/27019/2 "2020-08-15T00:51:37Z")

</div>

Hi @HyoSeong,

Thanks for the post. Are you trying to set the meeting window always on top? Are you calling this interface before or after joining a meeting?

---

<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:48am UTC](https://devforum.zoom.us/t/windows-sdk-c-wrapper-keep-on-top/27019/3 "2020-08-27T02:48:10Z")

</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;

```

```auto
// To get the main window handler

 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)
                        {
                           ...
                           
                        }

...

// In this example I move the window to the desired place and force it to be top most window

 var sw = CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap();
                            var status = sw.GetMeetingStatus();
                            if (status == MeetingStatus.MEETING_STATUS_INMEETING)
                            {

                                MoveWindow((IntPtr)(((HWNDDotNet)handlerfirstViewZoom).value), dimensionPanel.X, dimensionPanel.Y + 30, dimensionPanel.W, dimensionPanel.H + 200, true);
                                // Call this way:
                                SetWindowPos((IntPtr)(((HWNDDotNet)handlerfirstViewZoom).value), HWND_TOPMOST, dimensionPanel.X, dimensionPanel.Y + 30, dimensionPanel.W, dimensionPanel.H + 200, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
                            }
```
