Hi,
I'm afraid you need to check how did you set the parameters for the SetParent() method in your project, to check if there is a possibility to set it to NULL, you can find there are some descriptions about SetParent() method that say:
Conversely, if hWndNewParent is not
NULL and the window was previously a child of the desktop, you should clear the
WS_POPUP style and set the
WS_CHILD style before calling SetParent.
Refer: SetParent function.
And check after undock, if the parent windows is the original or return to the desktop.
Regards,
Stanly
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to
MSDN Support, feel free to contact MSDNFSF@microsoft.com.