private HitTest NCHitTest (Hwnd hwnd, int x, int y)
{
// The hit test is sent in screen coordinates
IntPtr dummy;
int screen_x, screen_y;
XTranslateCoordinates (DisplayHandle, hwnd.WholeWindow, RootWindow, x, y, out screen_x, out screen_y, out dummy);
return (HitTest) NativeWindow.WndProc (hwnd.client_window, Msg.WM_NCHITTEST, IntPtr.Zero,
(IntPtr) (screen_y << 16 | screen_x & 0xFFFF));
}