Problem
I need to resize no border form,But when ChromiumWebBrowser's dock is fill, CEF will eat mouse related information, dragging the form becomes very insensitive.
I observed Google Chrome, when the mouse outside the form can be dragged to change the size of the form, how can I achieve the same effect as Google Chrome.
Update
I need drag to change form's size,and Draggable borderless window in CefSharp a lot of private code, I can't know how to implement it.for example, ChromeWidgetMessageInterceptor.SetupLoop,in the cefsharp source code, ChromeWidgetMessageInterceptor does not have SetupLoop.
Update2 Add the screenshot and the code
const int WM_MOUSEMOVE = 0x0200;
const int WM_MOUSELEAVE = 0x02A3;
const int WM_LBUTTONDOWN = 0x0201;
//
switch (message.Msg)
{
case WM_MOUSEMOVE:
var clientCursorPos = GetMousePoint(MousePosition);
var newE = new MouseEventArgs(MouseButtons.None, 0, clientCursorPos.X, clientCursorPos.Y, 0);
this.InvokeOnParent(delegate { this.OnMouseMove(newE); });
break;
case WM_LBUTTONDOWN:
if (Cursor != Cursors.Default)
{
//this.InvokeOnParent(delegate { this.ResizeForm(this.ResizeDir); });
this.InvokeOnParent(delegate
{
if (DesignMode) return;
var dir = -1;
switch (this.ResizeDir)
{
case ResizeDirection.BottomLeft:
dir = HTBOTTOMLEFT;
break;
case ResizeDirection.Left:
dir = HTLEFT;
break;
case ResizeDirection.Right:
dir = HTRIGHT;
break;
case ResizeDirection.BottomRight:
dir = HTBOTTOMRIGHT;
break;
case ResizeDirection.Bottom:
dir = HTBOTTOM;
break;
}
ReleaseCapture();
if (dir != -1)
{
SendMessage(Handle, WM_NCLBUTTONDOWN, dir, 0);
}
});
}
break;
case WM_MOUSELEAVE:
Console.WriteLine("WM_MOUSELEAVE");
break;
}
Mouse drag to change the size of the problem