+
+/*****************************************************************************
+ * Control: control facility for the vout
+ *****************************************************************************/
+static int Control( vout_thread_t *p_vout, int i_query, va_list args )
+{
+ double f_arg;
+ RECT rect_window;
+ POINT point;
+
+ switch( i_query )
+ {
+ case VOUT_SET_ZOOM:
+ if( p_vout->p_sys->hparent )
+ return vout_ControlWindow( p_vout,
+ (void *)p_vout->p_sys->hparent, i_query, args );
+
+ f_arg = va_arg( args, double );
+
+ /* Update dimensions */
+ rect_window.top = rect_window.left = 0;
+ rect_window.right = p_vout->i_window_width * f_arg;
+ rect_window.bottom = p_vout->i_window_height * f_arg;
+ AdjustWindowRect( &rect_window, WS_OVERLAPPEDWINDOW|WS_SIZEBOX, 0 );
+
+ SetWindowPos( p_vout->p_sys->hwnd, 0, 0, 0,
+ rect_window.right - rect_window.left,
+ rect_window.bottom - rect_window.top, SWP_NOMOVE );
+
+ return VLC_SUCCESS;
+
+ case VOUT_REPARENT:
+ /* Change window style, borders and title bar */
+ vlc_mutex_lock( &p_vout->p_sys->lock );
+ p_vout->p_sys->hparent = 0;
+ vlc_mutex_unlock( &p_vout->p_sys->lock );
+
+ /* Retrieve the window position */
+ point.x = point.y = 0;
+ ClientToScreen( p_vout->p_sys->hwnd, &point );
+
+ SetParent( p_vout->p_sys->hwnd, GetDesktopWindow() );
+ SetWindowLong( p_vout->p_sys->hwnd, GWL_STYLE,
+ WS_CLIPCHILDREN | WS_OVERLAPPEDWINDOW |
+ WS_SIZEBOX | WS_VISIBLE );
+ SetWindowPos( p_vout->p_sys->hwnd, 0, point.x, point.y, 0, 0,
+ SWP_NOSIZE|SWP_NOZORDER|SWP_FRAMECHANGED );
+
+ return vout_vaControlDefault( p_vout, i_query, args );
+
+ case VOUT_CLOSE:
+ return VLC_SUCCESS;
+
+ case VOUT_SET_STAY_ON_TOP:
+ if( p_vout->p_sys->hparent )
+ return vout_ControlWindow( p_vout,
+ (void *)p_vout->p_sys->hparent, i_query, args );
+
+ p_vout->p_sys->b_on_top_change = VLC_TRUE;
+ return VLC_SUCCESS;
+
+ default:
+ return vout_vaControlDefault( p_vout, i_query, args );
+ }
+}