1 /*****************************************************************************
2 * oleinplaceactiveobject.cpp: ActiveX control for VLC
3 *****************************************************************************
4 * Copyright (C) 2005 the VideoLAN team
6 * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21 *****************************************************************************/
24 #include "oleinplaceactiveobject.h"
28 STDMETHODIMP
VLCOleInPlaceActiveObject::GetWindow(HWND
*pHwnd
)
34 if( _p_instance
->isInPlaceActive() )
36 if( NULL
!= (*pHwnd
= _p_instance
->getInPlaceWindow()) )
42 STDMETHODIMP
VLCOleInPlaceActiveObject::EnableModeless(BOOL fEnable
)
47 STDMETHODIMP
VLCOleInPlaceActiveObject::ContextSensitiveHelp(BOOL fEnterMode
)
52 STDMETHODIMP
VLCOleInPlaceActiveObject::TranslateAccelerator(LPMSG lpmsg
)
56 if( SUCCEEDED(QueryInterface(IID_IOleObject
, (LPVOID
*)&oleObj
)) )
58 LPOLECLIENTSITE clientSite
;
59 if( SUCCEEDED(oleObj
->GetClientSite(&clientSite
)) && (NULL
!= clientSite
) )
61 IOleControlSite
*controlSite
;
62 if( SUCCEEDED(clientSite
->QueryInterface(IID_IOleControlSite
, (LPVOID
*)&controlSite
)) )
64 hr
= controlSite
->TranslateAccelerator(lpmsg
,
65 ((GetKeyState(VK_SHIFT
) >> 15) & 1) |
66 ((GetKeyState(VK_CONTROL
) >> 14) & 2) |
67 ((GetKeyState(VK_MENU
) >> 13) & 4) );
68 controlSite
->Release();
70 clientSite
->Release();
77 STDMETHODIMP
VLCOleInPlaceActiveObject::OnFrameWindowActivate(BOOL fActivate
)
82 STDMETHODIMP
VLCOleInPlaceActiveObject::OnDocWindowActivate(BOOL fActivate
)
87 STDMETHODIMP
VLCOleInPlaceActiveObject::ResizeBorder(LPCRECT prcBorder
, LPOLEINPLACEUIWINDOW pUIWindow
, BOOL fFrameWindow
)