ReactOS  0.4.14-dev-98-gb0d4763
CBandProxy Class Reference

#include <bandproxy.h>

Inheritance diagram for CBandProxy:
Collaboration diagram for CBandProxy:

Public Member Functions

 CBandProxy ()
 
 ~CBandProxy ()
 
HRESULT FindBrowserWindow (IUnknown **browser)
 
virtual HRESULT STDMETHODCALLTYPE SetSite (IUnknown *paramC)
 
virtual HRESULT STDMETHODCALLTYPE CreateNewWindow (long paramC)
 
virtual HRESULT STDMETHODCALLTYPE GetBrowserWindow (IUnknown **paramC)
 
virtual HRESULT STDMETHODCALLTYPE IsConnected ()
 
virtual HRESULT STDMETHODCALLTYPE NavigateToPIDL (LPCITEMIDLIST pidl)
 
virtual HRESULT STDMETHODCALLTYPE NavigateToURL (long paramC, long param10)
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 

Private Attributes

CComPtr< IUnknownfSite
 

Additional Inherited Members

- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 

Detailed Description

Definition at line 23 of file bandproxy.h.

Constructor & Destructor Documentation

◆ CBandProxy()

CBandProxy::CBandProxy ( )

Definition at line 30 of file bandproxy.cpp.

31 {
32 }

◆ ~CBandProxy()

CBandProxy::~CBandProxy ( )

Definition at line 34 of file bandproxy.cpp.

35 {
36 }

Member Function Documentation

◆ CreateNewWindow()

HRESULT STDMETHODCALLTYPE CBandProxy::CreateNewWindow ( long  paramC)
virtual

Definition at line 58 of file bandproxy.cpp.

59 {
60  return E_NOTIMPL;
61 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ FindBrowserWindow()

HRESULT CBandProxy::FindBrowserWindow ( IUnknown **  browser)

Definition at line 38 of file bandproxy.cpp.

39 {
40  IWebBrowser2* webBrowser;
41  HRESULT hResult;
42 
43  if (browser == NULL)
44  return E_POINTER;
45  hResult = IUnknown_QueryService(fSite, SID_IWebBrowserApp, IID_PPV_ARG(IWebBrowser2, &webBrowser));
46  if (FAILED_UNEXPECTEDLY(hResult))
47  return hResult;
48  *browser = webBrowser;
49  return S_OK;
50 }
#define IID_PPV_ARG(Itype, ppType)
HRESULT WINAPI IUnknown_QueryService(IUnknown *, REFGUID, REFIID, LPVOID *)
Definition: ordinal.c:1448
CComPtr< IUnknown > fSite
Definition: bandproxy.h:29
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define S_OK
Definition: intsafe.h:59
#define SID_IWebBrowserApp
#define E_POINTER
Definition: winerror.h:2365

Referenced by GetBrowserWindow(), IsConnected(), and NavigateToPIDL().

◆ GetBrowserWindow()

HRESULT STDMETHODCALLTYPE CBandProxy::GetBrowserWindow ( IUnknown **  paramC)
virtual

Definition at line 63 of file bandproxy.cpp.

64 {
65  if (paramC == NULL)
66  return E_POINTER;
67  return FindBrowserWindow(paramC);
68 }
smooth NULL
Definition: ftsmooth.c:416
HRESULT FindBrowserWindow(IUnknown **browser)
Definition: bandproxy.cpp:38
#define E_POINTER
Definition: winerror.h:2365

◆ IsConnected()

HRESULT STDMETHODCALLTYPE CBandProxy::IsConnected ( )
virtual

Definition at line 70 of file bandproxy.cpp.

71 {
72  CComPtr<IUnknown> webBrowser;
73  HRESULT hResult;
74 
75  hResult = FindBrowserWindow(&webBrowser);
76  if (FAILED_UNEXPECTEDLY(hResult) || webBrowser.p == NULL)
77  return S_FALSE;
78  return S_OK;
79 }
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
HRESULT FindBrowserWindow(IUnknown **browser)
Definition: bandproxy.cpp:38
#define S_OK
Definition: intsafe.h:59

◆ NavigateToPIDL()

HRESULT STDMETHODCALLTYPE CBandProxy::NavigateToPIDL ( LPCITEMIDLIST  pidl)
virtual

Definition at line 81 of file bandproxy.cpp.

82 {
83  CComPtr<IOleWindow> oleWindow;
84  CComPtr<IServiceProvider> serviceProvider;
85  CComPtr<IUnknown> webBrowserUnknown;
86  CComPtr<IWebBrowser2> webBrowser;
87  HWND browserWindow;
89  CComVariant emptyVariant;
90  unsigned int arraySize;
91  HRESULT hResult;
92 
93  hResult = FindBrowserWindow(&webBrowserUnknown);
94  if (FAILED_UNEXPECTEDLY(hResult))
95  return hResult;
96  hResult = webBrowserUnknown->QueryInterface(IID_PPV_ARG(IWebBrowser2, &webBrowser));
97  if (FAILED_UNEXPECTEDLY(hResult))
98  return hResult;
99  hResult = webBrowser->put_Visible(TRUE);
100  hResult = webBrowser->QueryInterface(IID_PPV_ARG(IServiceProvider, &serviceProvider));
101  if (SUCCEEDED(hResult))
102  {
103  hResult = serviceProvider->QueryService(SID_STopLevelBrowser,
104  IID_PPV_ARG(IOleWindow, &oleWindow));
105  if (SUCCEEDED(hResult))
106  {
107  hResult = oleWindow->GetWindow(&browserWindow);
108  if (IsIconic(browserWindow))
109  ShowWindow(browserWindow, SW_RESTORE);
110  }
111  }
112  arraySize = ILGetSize(pidl);
113  V_VT(&args) = VT_ARRAY | VT_UI1;
114  V_ARRAY(&args) = SafeArrayCreateVector(VT_UI1, 0, arraySize);
115  if (V_ARRAY(&args) == NULL)
116  return E_OUTOFMEMORY;
117  memcpy(V_ARRAY(&args)->pvData, pidl, arraySize);
118  hResult = webBrowser->Navigate2(&args, &emptyVariant, &emptyVariant, &emptyVariant, &emptyVariant);
119  if (FAILED_UNEXPECTEDLY(hResult))
120  return hResult;
121  return S_OK;
122 }
#define TRUE
Definition: types.h:120
#define V_ARRAY(A)
Definition: oleauto.h:222
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define SW_RESTORE
Definition: winuser.h:773
BOOL WINAPI IsIconic(_In_ HWND)
#define IID_PPV_ARG(Itype, ppType)
Definition: match.c:390
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3748
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
SAFEARRAY *WINAPI SafeArrayCreateVector(VARTYPE vt, LONG lLbound, ULONG cElements)
Definition: safearray.c:679
#define V_VT(A)
Definition: oleauto.h:211
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
HRESULT FindBrowserWindow(IUnknown **browser)
Definition: bandproxy.cpp:38
#define S_OK
Definition: intsafe.h:59
#define ILGetSize
Definition: shellclasses.h:638
#define args
Definition: format.c:66
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ NavigateToURL()

HRESULT STDMETHODCALLTYPE CBandProxy::NavigateToURL ( long  paramC,
long  param10 
)
virtual

Definition at line 124 of file bandproxy.cpp.

125 {
126  return E_NOTIMPL;
127 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ SetSite()

HRESULT STDMETHODCALLTYPE CBandProxy::SetSite ( IUnknown paramC)
virtual

Definition at line 52 of file bandproxy.cpp.

53 {
54  fSite = paramC;
55  return S_OK;
56 }
CComPtr< IUnknown > fSite
Definition: bandproxy.h:29
#define S_OK
Definition: intsafe.h:59

Member Data Documentation

◆ fSite

CComPtr<IUnknown> CBandProxy::fSite
private

Definition at line 29 of file bandproxy.h.

Referenced by FindBrowserWindow(), and SetSite().


The documentation for this class was generated from the following files: