Skip to content

Commit

Permalink
[CropAndLock]Fix crash on reparent SetPosition fail (#28763)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimecbernardo committed Sep 25, 2023
1 parent d8ffa36 commit 28bd068
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ void ReparentCropAndLockWindow::CropAndLock(HWND windowToCrop, RECT cropRect)
SetWindowLongPtrW(m_currentTarget, GWL_STYLE, targetStyle);
auto x = -cropRect.left;
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()
Expand Down

0 comments on commit 28bd068

Please sign in to comment.