Some files have moved
[vlc/vlc-skelet.git] / activex / oleinplaceactiveobject.cpp
blob11b267227868696d616ea2c8e87500ab0574f347
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 *****************************************************************************/
23 #include "plugin.h"
24 #include "oleinplaceactiveobject.h"
26 using namespace std;
28 STDMETHODIMP VLCOleInPlaceActiveObject::GetWindow(HWND *pHwnd)
30 if( NULL == pHwnd )
31 return E_POINTER;
33 *pHwnd = NULL;
34 if( _p_instance->isInPlaceActive() )
36 if( NULL != (*pHwnd = _p_instance->getInPlaceWindow()) )
37 return S_OK;
39 return E_FAIL;
42 STDMETHODIMP VLCOleInPlaceActiveObject::EnableModeless(BOOL fEnable)
44 return S_OK;
47 STDMETHODIMP VLCOleInPlaceActiveObject::ContextSensitiveHelp(BOOL fEnterMode)
49 return E_NOTIMPL;
52 STDMETHODIMP VLCOleInPlaceActiveObject::TranslateAccelerator(LPMSG lpmsg)
54 HRESULT hr = S_FALSE;
55 LPOLEOBJECT oleObj;
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();
72 oleObj->Release();
74 return hr;
77 STDMETHODIMP VLCOleInPlaceActiveObject::OnFrameWindowActivate(BOOL fActivate)
79 return S_OK;
82 STDMETHODIMP VLCOleInPlaceActiveObject::OnDocWindowActivate(BOOL fActivate)
84 return S_OK;
87 STDMETHODIMP VLCOleInPlaceActiveObject::ResizeBorder(LPCRECT prcBorder, LPOLEINPLACEUIWINDOW pUIWindow, BOOL fFrameWindow)
89 return S_OK;