private GetIsHitTestVisibleInChrome ( IInputElement inputElement ) : bool | ||
inputElement | IInputElement | |
return | bool |
private IntPtr _HandleNCHitTest(WM uMsg, IntPtr wParam, IntPtr lParam, out bool handled) { IntPtr intPtr = IntPtr.Zero; handled = false; if (Utility.IsOSVistaOrNewer && this._chromeInfo.GlassFrameThickness != default(Thickness) && this._isGlassEnabled) { handled = NativeMethods.DwmDefWindowProc(this._hwnd, uMsg, wParam, lParam, out intPtr); } if (IntPtr.Zero == intPtr) { Point point = new Point((double)Utility.GET_X_LPARAM(lParam), (double)Utility.GET_Y_LPARAM(lParam)); Rect deviceRectangle = this._GetWindowRect(); HT ht = this._HitTestNca(DpiHelper.DeviceRectToLogical(deviceRectangle), DpiHelper.DevicePixelsToLogical(point)); if (ht != HT.CLIENT) { Point point2 = point; point2.Offset(-deviceRectangle.X, -deviceRectangle.Y); point2 = DpiHelper.DevicePixelsToLogical(point2); IInputElement inputElement = this._window.InputHitTest(point2); if (inputElement != null && WindowChrome.GetIsHitTestVisibleInChrome(inputElement)) { ht = HT.CLIENT; } } handled = true; intPtr = new IntPtr((int)ht); } return(intPtr); }
private IntPtr _HandleNCHitTest(WM uMsg, IntPtr wParam, IntPtr lParam, out bool handled) { var zero = IntPtr.Zero; handled = false; if (Utility.IsOSVistaOrNewer && _chromeInfo.GlassFrameThickness != new Thickness() && _isGlassEnabled) { handled = NativeMethods.DwmDefWindowProc(_hwnd, uMsg, wParam, lParam, out zero); } if (!(IntPtr.Zero == zero)) { return(zero); } var devicePoint = new Point(Utility.GET_X_LPARAM(lParam), Utility.GET_Y_LPARAM(lParam)); var deviceRectangle = _GetWindowRect(); var cLIENT = _HitTestNca(DpiHelper.DeviceRectToLogical(deviceRectangle), DpiHelper.DevicePixelsToLogical(devicePoint)); if (cLIENT != HT.CLIENT) { var point2 = devicePoint; point2.Offset(-deviceRectangle.X, -deviceRectangle.Y); point2 = DpiHelper.DevicePixelsToLogical(point2); var inputElement = _window.InputHitTest(point2); if (inputElement != null && WindowChrome.GetIsHitTestVisibleInChrome(inputElement)) { cLIENT = HT.CLIENT; } } handled = true; return(new IntPtr((int)cLIENT)); }
private IntPtr _HandleNCHitTest(WM uMsg, IntPtr wParam, IntPtr lParam, out bool handled) { IntPtr zero = IntPtr.Zero; handled = false; if (Utility.IsOSVistaOrNewer) { if (this._chromeInfo.GlassFrameThickness != new Thickness() && this._isGlassEnabled) { handled = Standard.NativeMethods.DwmDefWindowProc(this._hwnd, uMsg, wParam, lParam, out zero); } } if (IntPtr.Zero == zero) { Point point = new Point((double)Utility.GET_X_LPARAM(lParam), (double)Utility.GET_Y_LPARAM(lParam)); Rect rect = this._GetWindowRect(); HT hT = this._HitTestNca(DpiHelper.DeviceRectToLogical(rect), DpiHelper.DevicePixelsToLogical(point)); if (hT != HT.CLIENT) { Point logical = point; logical.Offset(-rect.X, -rect.Y); logical = DpiHelper.DevicePixelsToLogical(logical); IInputElement inputElement = this._window.InputHitTest(logical); if (inputElement != null && WindowChrome.GetIsHitTestVisibleInChrome(inputElement)) { hT = HT.CLIENT; } } handled = true; zero = new IntPtr((int)hT); } return(zero); }