Subversion Repositories Aucun

Compare Revisions

Ignore whitespace Rev 195 → Rev 196

/branches/selfserve/shellie/BrowserLockDown.cpp
6,21 → 6,19
 
// CBrowserLockDown
 
STDMETHODIMP CBrowserLockDown::ShowContextMenu(ULONG dwID, tagPOINT * ppt, IUnknown * pcmdtReserved, IDispatch * pdispReserved)
STDMETHODIMP CBrowserLockDown::ShowContextMenu(DWORD dwID, DWORD x, DWORD y, IUnknown *pcmdtReserved, IDispatch *pdispReserved, HRESULT *dwRetVal)
{
if(GetAsyncKeyState(VK_CONTROL) < 0)
return S_FALSE;
*dwRetVal = S_FALSE;
else
*dwRetVal = S_OK;
 
return S_OK;
}
 
STDMETHODIMP CBrowserLockDown::GetHostInfo(_DOCHOSTUIINFO * pInfo)
STDMETHODIMP CBrowserLockDown::GetHostInfo(DWORD *pdwFlags, DWORD *pdwDoubleClick)
{
if (pInfo == NULL)
return E_POINTER;
 
pInfo->cbSize = sizeof _DOCHOSTUIINFO;
pInfo->dwFlags = 0
*pdwFlags = 0
//| DOCHOSTUIFLAG_DIALOG
| DOCHOSTUIFLAG_DISABLE_HELP_MENU
//| DOCHOSTUIFLAG_NO3DBORDER
44,65 → 42,65
//| DOCHOSTUIFLAG_NOPICS
;
 
pInfo->dwDoubleClick = DOCHOSTUIDBLCLK_DEFAULT;
*pdwDoubleClick = DOCHOSTUIDBLCLK_DEFAULT;
return S_OK;
}
 
STDMETHODIMP CBrowserLockDown::ShowUI(ULONG dwID, IOleInPlaceActiveObject * pActiveObject, IOleCommandTarget * pCommandTarget, IOleInPlaceFrame * pFrame, IOleInPlaceUIWindow * pDoc)
STDMETHODIMP CBrowserLockDown::ShowUI(DWORD dwID, IUnknown *pActiveObject, IUnknown *pCommandTarget, IUnknown *pFrame, IUnknown *pDoc, HRESULT *dwRetVal)
{
return S_OK;
}
 
STDMETHODIMP CBrowserLockDown::HideUI()
STDMETHODIMP CBrowserLockDown::HideUI(void)
{
return S_OK;
}
 
STDMETHODIMP CBrowserLockDown::UpdateUI()
STDMETHODIMP CBrowserLockDown::UpdateUI(void)
{
return S_OK;
}
 
STDMETHODIMP CBrowserLockDown::EnableModeless(BOOL fEnable)
STDMETHODIMP CBrowserLockDown::EnableModeless(VARIANT_BOOL fEnable)
{
return S_OK;
}
 
STDMETHODIMP CBrowserLockDown::OnDocWindowActivate(BOOL fActivate)
STDMETHODIMP CBrowserLockDown::OnDocWindowActivate(VARIANT_BOOL fActivate)
{
return S_OK;
}
 
STDMETHODIMP CBrowserLockDown::OnFrameWindowActivate(BOOL fActivate)
STDMETHODIMP CBrowserLockDown::OnFrameWindowActivate(VARIANT_BOOL fActivate)
{
return S_OK;
}
 
STDMETHODIMP CBrowserLockDown::ResizeBorder(const RECT * prcBorder, IOleInPlaceUIWindow * pUIWindow, BOOL fRameWindow)
STDMETHODIMP CBrowserLockDown::ResizeBorder(long left, long top, long right, long bottom, IUnknown *pUIWindow, VARIANT_BOOL fFrameWindow)
{
return S_OK;
}
 
STDMETHODIMP CBrowserLockDown::TranslateAccelerator(MSG * lpmsg, const GUID * pguidCmdGroup, DWORD nCmdID)
STDMETHODIMP CBrowserLockDown::TranslateAccelerator(DWORD hWnd, DWORD nMessage, DWORD wParam, DWORD lParam, BSTR bstrGuidCmdGroup, DWORD nCmdID, HRESULT *dwRetVal)
{
return E_NOTIMPL;
}
 
STDMETHODIMP CBrowserLockDown::GetOptionKeyPath(LPWSTR * pchKey, ULONG dw)
STDMETHODIMP CBrowserLockDown::GetOptionKeyPath(BSTR *pbstrKey, DWORD dw)
{
if (pchKey != NULL)
pchKey = 0;
//if (pchKey != NULL)
// pchKey = 0;
return S_FALSE;
return E_NOTIMPL;
}
 
STDMETHODIMP CBrowserLockDown::GetDropTarget(IDropTarget * pDropTarget, IDropTarget * * ppDropTarget)
STDMETHODIMP CBrowserLockDown::GetDropTarget(IUnknown *pDropTarget, IUnknown **ppDropTarget)
{
return E_NOTIMPL;
}
 
STDMETHODIMP CBrowserLockDown::GetExternal(IDispatch * * ppDispatch)
STDMETHODIMP CBrowserLockDown::GetExternal(IDispatch **ppDispatch)
{
if(ppDispatch)
*ppDispatch = 0;
110,12 → 108,13
return E_NOTIMPL;
}
 
STDMETHODIMP CBrowserLockDown::TranslateUrl(ULONG dwTranslate, OLECHAR * pchURLIn, OLECHAR ** ppchURLOut)
STDMETHODIMP CBrowserLockDown::TranslateUrl(DWORD dwTranslate, BSTR bstrURLIn, BSTR *pbstrURLOut)
{
return S_FALSE;
}
 
STDMETHODIMP CBrowserLockDown::FilterDataObject(IDataObject * pDO, IDataObject * * ppDORet)
STDMETHODIMP CBrowserLockDown::FilterDataObject(IUnknown *pDO, IUnknown **ppDORet)
{
return S_FALSE;
}
 
/branches/selfserve/shellie/MainFrm.cpp
32,16 → 32,6
 
TCHAR resurl[MAX_PATH+5];
 
CComObject<CBrowserLockDown> *pUIH = NULL;
HRESULT hr = CComObject<CBrowserLockDown>::CreateInstance (&pUIH);
if (SUCCEEDED(hr))
{
// Make our custom DocHostUIHandler the window.external handler
CComQIPtr<IDocHostUIHandlerDispatch> pIUIH = pUIH;
hr = m_view.SetExternalUIHandler(pIUIH) ;
}
ATLASSERT(SUCCEEDED(hr)) ;
 
if((GetSettingText(L"SOFTWARE\\Paralint.com\\Shellie\\Shell", L"URL", resurl, sizeof resurl / sizeof *resurl) != S_OK)
|| !*resurl)
{
59,6 → 49,16
pLoop->AddMessageFilter(this);
pLoop->AddIdleHandler(this);
 
CComObject<CBrowserLockDown> *pUIH = NULL;
HRESULT hr = CComObject<CBrowserLockDown>::CreateInstance (&pUIH);
if (SUCCEEDED(hr))
{
// Make our custom DocHostUIHandler the window.external handler
CComQIPtr<IDocHostUIHandlerDispatch> pIUIH = pUIH;
hr = m_view.SetExternalUIHandler(pIUIH) ;
}
ATLASSERT(SUCCEEDED(hr)) ;
 
SetWindowPos(0, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), SWP_NOZORDER|SWP_SHOWWINDOW);
 
return 0;
/branches/selfserve/shellie/BrowserLockDown.h
43,152 → 43,22
}
 
public:
/*
// IDocHostUIHandler
//STDMETHOD(ShowContextMenu)(ULONG dwID, tagPOINT * ppt, IUnknown * pcmdtReserved, IDispatch * pdispReserved);
//HRESULT STDMETHODCALLTYPE ShowContextMenu(DWORD dwID, DWORD x, DWORD y, IUnknown *pcmdtReserved, IDispatch *pdispReserved, HRESULT *dwRetVal )
STDMETHOD(GetHostInfo)(_DOCHOSTUIINFO * pInfo);
STDMETHOD(ShowUI)(ULONG dwID, IOleInPlaceActiveObject * pActiveObject, IOleCommandTarget * pCommandTarget, IOleInPlaceFrame * pFrame, IOleInPlaceUIWindow * pDoc);
STDMETHOD(HideUI)();
STDMETHOD(UpdateUI)();
STDMETHOD(EnableModeless)(BOOL fEnable);
STDMETHOD(OnDocWindowActivate)(BOOL fActivate);
STDMETHOD(OnFrameWindowActivate)(BOOL fActivate);
STDMETHOD(ResizeBorder)(const RECT * prcBorder, IOleInPlaceUIWindow * pUIWindow, BOOL fRameWindow);
STDMETHOD(TranslateAccelerator)(MSG * lpmsg, const GUID * pguidCmdGroup, DWORD nCmdID);
STDMETHOD(GetOptionKeyPath)(LPWSTR * pchKey, ULONG dw);
STDMETHOD(GetDropTarget)(IDropTarget * pDropTarget, IDropTarget * * ppDropTarget);
STDMETHOD(GetExternal)(IDispatch * * ppDispatch);
STDMETHOD(TranslateUrl)(ULONG dwTranslate, OLECHAR * pchURLIn, OLECHAR * * ppchURLOut);
STDMETHOD(FilterDataObject)(IDataObject * pDO, IDataObject * * ppDORet);
/*/
// Do not show the context menu
STDMETHOD (ShowContextMenu) (
DWORD dwID,
DWORD x,
DWORD y,
IUnknown *pcmdtReserved,
IDispatch *pdispReserved,
HRESULT *dwRetVal)
;
// Mark all the other methods as not implemented
 
STDMETHOD (GetHostInfo) (
DWORD *pdwFlags,
DWORD *pdwDoubleClick)
{
return E_NOTIMPL;
}
 
 
STDMETHOD (ShowUI) (
DWORD dwID,
IUnknown *pActiveObject,
IUnknown *pCommandTarget,
IUnknown *pFrame,
IUnknown *pDoc,
HRESULT *dwRetVal)
{
return E_NOTIMPL;
}
 
 
STDMETHOD (HideUI) (void)
{
return E_NOTIMPL;
}
 
 
STDMETHOD (UpdateUI) (void)
{
return E_NOTIMPL;
}
 
STDMETHOD (EnableModeless) (
VARIANT_BOOL fEnable)
{
return E_NOTIMPL;
}
 
 
STDMETHOD (OnDocWindowActivate) (
VARIANT_BOOL fActivate)
{
return E_NOTIMPL;
}
 
 
STDMETHOD (OnFrameWindowActivate) (
VARIANT_BOOL fActivate)
{
return E_NOTIMPL;
}
 
 
STDMETHOD (ResizeBorder) (
long left,
long top,
long right,
long bottom,
IUnknown *pUIWindow,
VARIANT_BOOL fFrameWindow)
{
return E_NOTIMPL;
}
 
 
STDMETHOD (TranslateAccelerator) (
DWORD hWnd,
DWORD nMessage,
DWORD wParam,
DWORD lParam,
BSTR bstrGuidCmdGroup,
DWORD nCmdID,
HRESULT *dwRetVal)
{
return E_NOTIMPL;
}
 
 
STDMETHOD (GetOptionKeyPath) (
BSTR *pbstrKey,
DWORD dw)
{
return E_NOTIMPL;
}
 
 
STDMETHOD (GetDropTarget) (
IUnknown *pDropTarget,
IUnknown **ppDropTarget)
{
return E_NOTIMPL;
}
 
 
STDMETHOD (GetExternal) (
IDispatch **ppDispatch)
{
return E_NOTIMPL;
}
 
 
STDMETHOD (TranslateUrl) (
DWORD dwTranslate,
BSTR bstrURLIn,
BSTR *pbstrURLOut)
{
return E_NOTIMPL;
}
 
 
STDMETHOD (FilterDataObject) (
IUnknown *pDO,
IUnknown **ppDORet)
{
return E_NOTIMPL;
}
//*/
STDMETHOD(ShowContextMenu)(DWORD dwID, DWORD x, DWORD y, IUnknown *pcmdtReserved, IDispatch *pdispReserved, HRESULT *dwRetVal);
STDMETHOD(GetHostInfo)(DWORD *pdwFlags, DWORD *pdwDoubleClick);
STDMETHOD(ShowUI)(DWORD dwID, IUnknown *pActiveObject, IUnknown *pCommandTarget, IUnknown *pFrame, IUnknown *pDoc, HRESULT *dwRetVal);
STDMETHOD(HideUI)(void);
STDMETHOD(UpdateUI)(void);
STDMETHOD(EnableModeless)(VARIANT_BOOL fEnable);
STDMETHOD(OnDocWindowActivate)(VARIANT_BOOL fActivate);
STDMETHOD(OnFrameWindowActivate)(VARIANT_BOOL fActivate);
STDMETHOD(ResizeBorder)(long left, long top, long right, long bottom, IUnknown *pUIWindow, VARIANT_BOOL fFrameWindow);
STDMETHOD(TranslateAccelerator)(DWORD hWnd, DWORD nMessage, DWORD wParam, DWORD lParam, BSTR bstrGuidCmdGroup, DWORD nCmdID, HRESULT *dwRetVal);
STDMETHOD(GetOptionKeyPath)(BSTR *pbstrKey, DWORD dw);
STDMETHOD(GetDropTarget)(IUnknown *pDropTarget, IUnknown **ppDropTarget);
STDMETHOD(GetExternal)(IDispatch **ppDispatch);
STDMETHOD(TranslateUrl)(DWORD dwTranslate, BSTR bstrURLIn, BSTR *pbstrURLOut);
STDMETHOD(FilterDataObject)(IUnknown *pDO, IUnknown **ppDORet);
};
 
//OBJECT_ENTRY_AUTO(__uuidof(BrowserLockDown), CBrowserLockDown)
/branches/selfserve/shellie/shellie.h
4,10 → 4,10
 
 
/* File created by MIDL compiler version 7.00.0500 */
/* at Wed Jun 02 23:26:00 2010
/* at Wed Jun 02 23:48:03 2010
*/
/* Compiler settings for .\Shellie.idl:
Oicf, W1, Zp8, env=Win32 (32b run)
Oicf, W1, Zp8, env=Win64 (32b run)
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level: