Try using the
SetParent API to set the small window a child of your Preferences-window. The small window will now be inside the small window, so it will only appear when the actual window appears. You might need to set the TOP_MOST attribute on the window, so it doesn't hide behind various controls, use the
SetWindowPos API.
I haven't tried this, but it should work, give it a shot!
This isn't the Win32 way to do it, but this is pretty easy, and it's available for scripting.