protected override sealed HandleRef BuildWindowCore(HandleRef hwndParent)
{
HWND hwndParent2 = new HWND(hwndParent.Handle);
_hwndChild = BuildWindowOverride(hwndParent2);
// Ideally, the window would have been created with the expected
// parent. But just in case, we set it explicitly.
NativeMethods.SetParent(_hwndChild, hwndParent2);
return new HandleRef(this, _hwndChild.DangerousGetHandle());
}