Hi,@Robinson I can’t reproduce your problem with the UserControl example here.
Result:
Are the two windows you want to set in the same DPI awareness modes? According to SetParent:
Unexpected behavior or errors may occur if hWndNewParent and hWndChild are running in different DPI awareness modes.
Does SetParent
return successfully? If it fails, what error code does GetLastError
return?
If the above situations still do not help you solve the problem, please provide a minimal sample that can reproduce the problem so that we can help you investigate this problem in depth.
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.