HIViewRef contentView;
if (HIViewFindByID (HIViewGetRoot ((WindowRef)ptr, kHIViewWindowContentID, &contentView) == noErr)
HIViewAddSubview (contentView, myPluginView);
HIViewRemoveFromSuperview (myPluginView);
Don't do anything with the window. It is not your window.
HIRect pluginBounds; HIViewGetFrame (myPluginView, &pluginBounds); pluginBounds.size.width = newWidth; pluginBounds.size.height = newHeight; HIViewSetFrame (myPluginView, &pluginBounds);
The host needs to listen to bounds changes on the Plug-In view and resize its window accordingly.