-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAddressBarHostBand.h
87 lines (67 loc) · 2.6 KB
/
AddressBarHostBand.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#pragma once
#ifndef _ADDRESSBARHOSTBAND_H
#define _ADDRESSBARHOSTBAND_H
#include "stdafx.h"
#include "framework.h"
#include "resource.h"
#include "ClassicExplorer_i.h"
#include "dllmain.h"
#include "AddressBar.h"
class ATL_NO_VTABLE AddressBarHostBand :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<AddressBarHostBand, &CLSID_AddressBarHostBand>,
public IObjectWithSiteImpl<AddressBarHostBand>,
public IDeskBand,
public IDispEventImpl<1, AddressBarHostBand, &DIID_DWebBrowserEvents2, &LIBID_SHDocVw, 1, 1>,
public IInputObject,
public IInputObjectSite
{
protected: // Class members:
IInputObjectSite *m_pSite = NULL;
HWND m_parentWindow = NULL;
AddressBar m_addressBar;
CComPtr<IWebBrowser2> m_pWebBrowser = NULL;
friend class AddressBar;
public: // COM class setup:
DECLARE_REGISTRY_RESOURCEID_V2_WITHOUT_MODULE(IDR_CLASSICEXPLORER, AddressBarHostBand)
BEGIN_SINK_MAP(AddressBarHostBand)
SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_NAVIGATECOMPLETE2, OnNavigateComplete)
SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_ONQUIT, OnQuit)
END_SINK_MAP()
BEGIN_COM_MAP(AddressBarHostBand)
COM_INTERFACE_ENTRY(IOleWindow)
COM_INTERFACE_ENTRY(IObjectWithSite)
COM_INTERFACE_ENTRY_IID(IID_IDockingWindow, IDockingWindow)
COM_INTERFACE_ENTRY_IID(IID_IDeskBand, IDeskBand)
COM_INTERFACE_ENTRY_IID(IID_IInputObject, IInputObject)
END_COM_MAP()
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct()
{
return S_OK;
}
void FinalRelease() {}
public: // COM method implementations:
// implement IDeskBand:
STDMETHOD(GetBandInfo)(DWORD dwBandId, DWORD dwViewMode, DESKBANDINFO *pDbi);
// implement IObjectWithSite:
STDMETHOD(SetSite)(IUnknown *pUnkSite);
// implement IOleWindow:
STDMETHOD(GetWindow)(HWND *hWnd);
STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode);
// implement IDockingWindow:
STDMETHOD(CloseDW)(unsigned long dwReserved);
STDMETHOD(ResizeBorderDW)(const RECT *pRcBorder, IUnknown *pUnkToolbarSite, BOOL fReserved);
STDMETHOD(ShowDW)(BOOL fShow);
// implement DWebBrowserEvents2:
STDMETHOD(OnNavigateComplete)(IDispatch *pDisp, VARIANT *url);
STDMETHOD(OnQuit)(void);
// implement IInputObject:
STDMETHOD(HasFocusIO)(void);
STDMETHOD(TranslateAcceleratorIO)(MSG *pMsg);
STDMETHOD(UIActivateIO)(BOOL fActivate, MSG *pMsg);
// implement IInputObjectSite:
STDMETHOD(OnFocusChangeIS)(IUnknown *pUnkObj, BOOL fSetFocus);
};
OBJECT_ENTRY_AUTO(__uuidof(AddressBarHostBand), AddressBarHostBand);
#endif // _ADDRESSBARHOSTBAND_H