[CropAndLock]Fix crash on reparent SetPosition fail (#28763)

This commit is contained in:
Jaime Bernardo
2023-09-25 16:06:55 +01:00
committed by GitHub
parent d8ffa36bc6
commit 28bd0686cc

View File

@@ -131,7 +131,10 @@ void ReparentCropAndLockWindow::CropAndLock(HWND windowToCrop, RECT cropRect)
SetWindowLongPtrW(m_currentTarget, GWL_STYLE, targetStyle); SetWindowLongPtrW(m_currentTarget, GWL_STYLE, targetStyle);
auto x = -cropRect.left; auto x = -cropRect.left;
auto y = -cropRect.top; auto y = -cropRect.top;
winrt::check_bool(SetWindowPos(m_currentTarget, nullptr, x, y, 0, 0, SWP_NOSIZE | SWP_FRAMECHANGED | SWP_NOZORDER)); if (0 == SetWindowPos(m_currentTarget, nullptr, x, y, 0, 0, SWP_NOSIZE | SWP_FRAMECHANGED | SWP_NOZORDER))
{
MessageBoxW(nullptr, L"CropAndLock couldn't properly reparent the target window. It might not handle reparenting well.", L"CropAndLock", MB_ICONERROR);
}
} }
void ReparentCropAndLockWindow::Hide() void ReparentCropAndLockWindow::Hide()