Use ref_ptr for embedded window (not really necessary, but better style)