ReactOS 0.4.16-dev-321-g63bb46a
CAddressBand Class Reference

#include <addressband.h>

Inheritance diagram for CAddressBand:
Collaboration diagram for CAddressBand:

Public Member Functions

 CAddressBand ()
 
virtual ~CAddressBand ()
 
STDMETHOD() GetBandInfo (DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO *pdbi) override
 
STDMETHOD() SetSite (IUnknown *pUnkSite) override
 
STDMETHOD() GetSite (REFIID riid, void **ppvSite) override
 
STDMETHOD() GetWindow (HWND *lphwnd) override
 
STDMETHOD() ContextSensitiveHelp (BOOL fEnterMode) override
 
STDMETHOD() CloseDW (DWORD dwReserved) override
 
STDMETHOD() ResizeBorderDW (const RECT *prcBorder, IUnknown *punkToolbarSite, BOOL fReserved) override
 
STDMETHOD() ShowDW (BOOL fShow) override
 
STDMETHOD() QueryStatus (const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) override
 
STDMETHOD() Exec (const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) override
 
STDMETHOD() UIActivateIO (BOOL fActivate, LPMSG lpMsg) override
 
STDMETHOD() HasFocusIO () override
 
STDMETHOD() TranslateAcceleratorIO (LPMSG lpMsg) override
 
STDMETHOD() OnWinEvent (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult) override
 
STDMETHOD() IsWindowOwner (HWND hWnd) override
 
STDMETHOD() FileSysChange (long param8, long paramC) override
 
STDMETHOD() Refresh (long param8) override
 
STDMETHOD() QueryService (REFGUID guidService, REFIID riid, void **ppvObject) override
 
STDMETHOD() OnFocusChangeIS (IUnknown *punkObj, BOOL fSetFocus) override
 
STDMETHOD() GetClassID (CLSID *pClassID) override
 
STDMETHOD() IsDirty () override
 
STDMETHOD() Load (IStream *pStm) override
 
STDMETHOD() Save (IStream *pStm, BOOL fClearDirty) override
 
STDMETHOD() GetSizeMax (ULARGE_INTEGER *pcbSize) override
 
LRESULT OnNotifyClick (WPARAM wParam, NMHDR *notifyHeader, BOOL &bHandled)
 
LRESULT OnTipText (UINT idControl, NMHDR *notifyHeader, BOOL &bHandled)
 
LRESULT OnEraseBackground (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSize (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnWindowPosChanging (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
- 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 ()
 
HRESULT GetBandInfo ([in] DWORD dwBandID, [in] DWORD dwViewMode, [in, out] DESKBANDINFO *pdbi)
 
- Public Member Functions inherited from IDockingWindow
HRESULT ShowDW ([in] BOOL fShow)
 
HRESULT CloseDW ([in] DWORD dwReserved)
 
HRESULT ResizeBorderDW ([in] LPCRECT prcBorder, [in] IUnknown *punkToolbarSite, [in] BOOL fReserved)
 
HRESULT GetWindow ([out] HWND *phwnd)
 
HRESULT ContextSensitiveHelp ([in] BOOL fEnterMode)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
- Public Member Functions inherited from IObjectWithSite
HRESULT SetSite ([in] IUnknown *pUnkSite)
 
HRESULT GetSite ([in] REFIID riid, [out, iid_is(riid)] PVOID *ppvSite)
 
HRESULT IsDirty ()
 
HRESULT Load ([in, unique] IStream *pStm)
 
HRESULT Save ([in, unique] IStream *pStm, [in] BOOL fClearDirty)
 
HRESULT GetSizeMax ([out] ULARGE_INTEGER *pcbSize)
 
HRESULT GetClassID ([out] CLSID *pClassID)
 
HRESULT QueryStatus ([in, unique] const GUID *pguidCmdGroup, [in] ULONG cCmds, [in, out, size_is(cCmds)] OLECMD prgCmds[], [in, out, unique] OLECMDTEXT *pCmdText)
 
HRESULT Exec ([in, unique] const GUID *pguidCmdGroup, [in] DWORD nCmdID, [in] DWORD nCmdexecopt, [in, unique] VARIANT *pvaIn, [in, out, unique] VARIANT *pvaOut)
 
- Public Member Functions inherited from IServiceProvider
HRESULT QueryService ([in] REFGUID guidService, [in] REFIID riid, [out] void **ppvObject)
 
HRESULT RemoteQueryService ([in] REFGUID guidService, [in] REFIID riid, [out, iid_is(riid)] IUnknown **ppvObject)
 

Private Member Functions

void FocusChange (BOOL bFocus)
 
void CreateGoButton ()
 

Private Attributes

CComPtr< IDockingWindowSite > fSite
 
CComPtr< IAddressEditBox > fAddressEditBox
 
HWND fEditControl
 
HWND fGoButton
 
HWND fComboBox
 
bool fGoButtonShown
 
HIMAGELIST m_himlNormal
 
HIMAGELIST m_himlHot
 

Additional Inherited Members

- Public Types inherited from IOleWindow
typedef IOleWindowLPOLEWINDOW
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IObjectWithSite
typedef IObjectWithSiteLPOBJECTWITHSITE
 
- Public Types inherited from IPersistStream
typedef IPersistStreamLPPERSISTSTREAM
 
- Public Types inherited from IPersist
typedef IPersistLPPERSIST
 
- Public Types inherited from IOleCommandTarget
enum  OLECMDF {
  OLECMDF_SUPPORTED = 0x1 , OLECMDF_ENABLED = 0x2 , OLECMDF_LATCHED = 0x4 , OLECMDF_NINCHED = 0x8 ,
  OLECMDF_INVISIBLE = 0x10 , OLECMDF_DEFHIDEONCTXTMENU = 0x20
}
 
enum  OLECMDTEXTF { OLECMDTEXTF_NONE = 0 , OLECMDTEXTF_NAME = 1 , OLECMDTEXTF_STATUS = 2 }
 
enum  OLECMDEXECOPT { OLECMDEXECOPT_DODEFAULT = 0 , OLECMDEXECOPT_PROMPTUSER = 1 , OLECMDEXECOPT_DONTPROMPTUSER = 2 , OLECMDEXECOPT_SHOWHELP = 3 }
 
enum  OLECMDID {
  OLECMDID_OPEN = 1 , OLECMDID_NEW = 2 , OLECMDID_SAVE = 3 , OLECMDID_SAVEAS = 4 ,
  OLECMDID_SAVECOPYAS = 5 , OLECMDID_PRINT = 6 , OLECMDID_PRINTPREVIEW = 7 , OLECMDID_PAGESETUP = 8 ,
  OLECMDID_SPELL = 9 , OLECMDID_PROPERTIES = 10 , OLECMDID_CUT = 11 , OLECMDID_COPY = 12 ,
  OLECMDID_PASTE = 13 , OLECMDID_PASTESPECIAL = 14 , OLECMDID_UNDO = 15 , OLECMDID_REDO = 16 ,
  OLECMDID_SELECTALL = 17 , OLECMDID_CLEARSELECTION = 18 , OLECMDID_ZOOM = 19 , OLECMDID_GETZOOMRANGE = 20 ,
  OLECMDID_UPDATECOMMANDS = 21 , OLECMDID_REFRESH = 22 , OLECMDID_STOP = 23 , OLECMDID_HIDETOOLBARS = 24 ,
  OLECMDID_SETPROGRESSMAX = 25 , OLECMDID_SETPROGRESSPOS = 26 , OLECMDID_SETPROGRESSTEXT = 27 , OLECMDID_SETTITLE = 28 ,
  OLECMDID_SETDOWNLOADSTATE = 29 , OLECMDID_STOPDOWNLOAD = 30 , OLECMDID_ONTOOLBARACTIVATED = 31 , OLECMDID_FIND = 32 ,
  OLECMDID_DELETE = 33 , OLECMDID_HTTPEQUIV = 34 , OLECMDID_HTTPEQUIV_DONE = 35 , OLECMDID_ENABLE_INTERACTION = 36 ,
  OLECMDID_ONUNLOAD = 37 , OLECMDID_PROPERTYBAG2 = 38 , OLECMDID_PREREFRESH = 39 , OLECMDID_SHOWSCRIPTERROR = 40 ,
  OLECMDID_SHOWMESSAGE = 41 , OLECMDID_SHOWFIND = 42 , OLECMDID_SHOWPAGESETUP = 43 , OLECMDID_SHOWPRINT = 44 ,
  OLECMDID_CLOSE = 45 , OLECMDID_ALLOWUILESSSAVEAS = 46 , OLECMDID_DONTDOWNLOADCSS = 47 , OLECMDID_UPDATEPAGESTATUS = 48 ,
  OLECMDID_PRINT2 = 49 , OLECMDID_PRINTPREVIEW2 = 50 , OLECMDID_SETPRINTTEMPLATE = 51 , OLECMDID_GETPRINTTEMPLATE = 52 ,
  OLECMDID_PAGEACTIONBLOCKED = 55 , OLECMDID_PAGEACTIONUIQUERY = 56 , OLECMDID_FOCUSVIEWCONTROLS = 57 , OLECMDID_FOCUSVIEWCONTROLSQUERY = 58 ,
  OLECMDID_SHOWPAGEACTIONMENU = 59 , OLECMDID_ADDTRAVELENTRY = 60 , OLECMDID_UPDATETRAVELENTRY = 61 , OLECMDID_UPDATEBACKFORWARDSTATE = 62 ,
  OLECMDID_OPTICAL_ZOOM = 63 , OLECMDID_OPTICAL_GETZOOMRANGE = 64 , OLECMDID_WINDOWSTATECHANGED = 65 , OLECMDID_ACTIVEXINSTALLSCOPE = 66 ,
  OLECMDID_UPDATETRAVELENTRY_DATARECOVERY = 67 , OLECMDID_SHOWTASKDLG = 68 , OLECMDID_POPSTATEEVENT = 69 , OLECMDID_VIEWPORT_MODE = 70 ,
  OLECMDID_LAYOUT_VIEWPORT_WIDTH = 71 , OLECMDID_VISUAL_VIEWPORT_EXCLUDE_BOTTOM = 72 , OLECMDID_USER_OPTICAL_ZOOM = 73 , OLECMDID_PAGEAVAILABLE = 74 ,
  OLECMDID_GETUSERSCALABLE = 75 , OLECMDID_UPDATE_CARET = 76 , OLECMDID_ENABLE_VISIBILITY = 77 , OLECMDID_MEDIA_PLAYBACK = 78
}
 
typedef IOleCommandTargetLPOLECOMMANDTARGET
 
typedef enum IOleCommandTarget::OLECMDF OLECMDF
 
typedef struct IOleCommandTarget::_tagOLECMD OLECMD
 
typedef struct IOleCommandTarget::_tagOLECMDTEXT OLECMDTEXT
 
typedef enum IOleCommandTarget::OLECMDTEXTF OLECMDTEXTF
 
typedef enum IOleCommandTarget::OLECMDEXECOPT OLECMDEXECOPT
 
typedef enum IOleCommandTarget::OLECMDID OLECMDID
 
- Public Types inherited from IServiceProvider
typedef IServiceProviderLPSERVICEPROVIDER
 
- 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 addressband.h.

Constructor & Destructor Documentation

◆ CAddressBand()

CAddressBand::CAddressBand ( )

Definition at line 40 of file addressband.cpp.

41{
45 fGoButtonShown = false;
46}
bool fGoButtonShown
Definition: addressband.h:43
HWND fEditControl
Definition: addressband.h:40
HWND fGoButton
Definition: addressband.h:41
HWND fComboBox
Definition: addressband.h:42
#define NULL
Definition: types.h:112

◆ ~CAddressBand()

CAddressBand::~CAddressBand ( )
virtual

Definition at line 48 of file addressband.cpp.

49{
50}

Member Function Documentation

◆ CloseDW()

HRESULT STDMETHODCALLTYPE CAddressBand::CloseDW ( DWORD  dwReserved)
override

Implements IDockingWindow.

Definition at line 198 of file addressband.cpp.

199{
200 ShowDW(FALSE);
201
202 if (IsWindow())
204
205 m_hWnd = NULL;
206
207 CComPtr<IShellService> pservice;
208 HRESULT hres = fAddressEditBox->QueryInterface(IID_PPV_ARG(IShellService, &pservice));
209 if (SUCCEEDED(hres ))
210 pservice->SetOwner(NULL);
211
213 if (fSite) fSite.Release();
214
215 if (m_himlNormal)
217
218 if (m_himlHot)
220
221 return S_OK;
222}
void Release()
Definition: atlcomcli.h:170
HIMAGELIST m_himlHot
Definition: addressband.h:45
CComPtr< IAddressEditBox > fAddressEditBox
Definition: addressband.h:39
STDMETHOD() ShowDW(BOOL fShow) override
CComPtr< IDockingWindowSite > fSite
Definition: addressband.h:38
HIMAGELIST m_himlNormal
Definition: addressband.h:44
#define FALSE
Definition: types.h:117
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hres
Definition: protocol.c:465
BOOL WINAPI IsWindow(_In_opt_ HWND)
BOOL WINAPI DestroyWindow(_In_ HWND)
#define IID_PPV_ARG(Itype, ppType)

◆ ContextSensitiveHelp()

HRESULT STDMETHODCALLTYPE CAddressBand::ContextSensitiveHelp ( BOOL  fEnterMode)
override

Implements IOleWindow.

Definition at line 193 of file addressband.cpp.

194{
195 return E_NOTIMPL;
196}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ CreateGoButton()

void CAddressBand::CreateGoButton ( )
private

Definition at line 603 of file addressband.cpp.

604{
605 const TBBUTTON buttonInfo [] = { { 0, 1, TBSTATE_ENABLED, 0 } };
606 HINSTANCE shellInstance;
607
608 shellInstance = _AtlBaseModule.GetResourceInstance();
610 20, 0, RGB(255, 0, 255), IMAGE_BITMAP, LR_CREATEDIBSECTION);
612 20, 0, RGB(255, 0, 255), IMAGE_BITMAP, LR_CREATEDIBSECTION);
613
617 0, 0, 0, 0, m_hWnd, NULL, _AtlBaseModule.GetModuleInstance(), NULL);
620 if (m_himlNormal)
622 if (m_himlHot)
625 reinterpret_cast<WPARAM>(_AtlBaseModule.GetResourceInstance()), IDS_GOBUTTONLABEL);
626 SendMessage(fGoButton, TB_ADDBUTTONSW, 1, (LPARAM) &buttonInfo);
627}
#define IDS_GOBUTTONLABEL
Definition: resource.h:122
HIMAGELIST WINAPI ImageList_LoadImageW(HINSTANCE hi, LPCWSTR lpbmp, INT cx, INT cGrow, COLORREF clrMask, UINT uType, UINT uFlags)
Definition: imagelist.c:2208
#define RGB(r, g, b)
Definition: precomp.h:71
#define WS_CHILD
Definition: pedump.c:617
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:989
#define TBSTYLE_LIST
Definition: commctrl.h:993
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1134
#define TB_ADDSTRINGW
Definition: commctrl.h:1132
#define TB_SETIMAGELIST
Definition: commctrl.h:1150
#define CCS_NODIVIDER
Definition: commctrl.h:2253
#define TOOLBARCLASSNAMEW
Definition: commctrl.h:943
#define TBSTATE_ENABLED
Definition: commctrl.h:974
#define TBSTYLE_FLAT
Definition: commctrl.h:992
#define CCS_NOPARENTALIGN
Definition: commctrl.h:2251
#define CCS_NORESIZE
Definition: commctrl.h:2250
#define TB_SETHOTIMAGELIST
Definition: commctrl.h:1154
#define TB_ADDBUTTONSW
Definition: commctrl.h:1266
#define TB_SETMAXTEXTROWS
Definition: commctrl.h:1162
#define IDB_GOBUTTON_NORMAL
Definition: undocshell.h:831
#define IDB_GOBUTTON_HOT
Definition: undocshell.h:832
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define CreateWindowEx
Definition: winuser.h:5767
#define IMAGE_BITMAP
Definition: winuser.h:211
#define LR_CREATEDIBSECTION
Definition: winuser.h:1101
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define SendMessage
Definition: winuser.h:5855
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by OnSize(), OnWindowPosChanging(), OnWinEvent(), and SetSite().

◆ Exec()

HRESULT STDMETHODCALLTYPE CAddressBand::Exec ( const GUID pguidCmdGroup,
DWORD  nCmdID,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
override

Implements IOleCommandTarget.

Definition at line 248 of file addressband.cpp.

250{
251 // incomplete
252 return E_NOTIMPL;
253}

◆ FileSysChange()

HRESULT STDMETHODCALLTYPE CAddressBand::FileSysChange ( long  param8,
long  paramC 
)
override

Definition at line 400 of file addressband.cpp.

401{
402 CComPtr<IAddressBand> addressBand;
403 HRESULT hResult;
404
405 hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IAddressBand, &addressBand));
406 if (FAILED_UNEXPECTEDLY(hResult))
407 return hResult;
408 return addressBand->FileSysChange(param8, paramC);
409}
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121

◆ FocusChange()

void CAddressBand::FocusChange ( BOOL  bFocus)
private

Definition at line 52 of file addressband.cpp.

53{
54// m_bFocus = bFocus;
55
56 //Inform the input object site that the focus has changed.
57 if (fSite)
58 {
59#if 0
60 fSite->OnFocusChangeIS((IDockingWindow *)this, bFocus);
61#endif
62 }
63}

◆ GetBandInfo()

HRESULT STDMETHODCALLTYPE CAddressBand::GetBandInfo ( DWORD  dwBandID,
DWORD  dwViewMode,
DESKBANDINFO pdbi 
)
override

Implements IDeskBand.

Definition at line 65 of file addressband.cpp.

66{
67 if (!m_hWnd || !pdbi) return E_FAIL; /* Verify window exists */
68 if (pdbi->dwMask & DBIM_MINSIZE)
69 {
71 pdbi->ptMinSize.x = 100;
72 else
73 pdbi->ptMinSize.x = 150;
74 pdbi->ptMinSize.y = 22;
75 }
76 if (pdbi->dwMask & DBIM_MAXSIZE)
77 {
78 pdbi->ptMaxSize.x = 0;
79 pdbi->ptMaxSize.y = 0;
80 }
81 if (pdbi->dwMask & DBIM_INTEGRAL)
82 {
83 pdbi->ptIntegral.x = 0;
84 pdbi->ptIntegral.y = 0;
85 }
86 if (pdbi->dwMask & DBIM_ACTUAL)
87 {
89 pdbi->ptActual.x = 100;
90 else
91 pdbi->ptActual.x = 150;
92 pdbi->ptActual.y = 22;
93 }
94 if (pdbi->dwMask & DBIM_TITLE)
95 {
96 if (!LoadStringW(_AtlBaseModule.GetResourceInstance(), IDS_ADDRESSBANDLABEL, pdbi->wszTitle, _countof(pdbi->wszTitle)))
98 }
99
100 if (pdbi->dwMask & DBIM_MODEFLAGS)
101 pdbi->dwModeFlags = DBIMF_UNDELETEABLE;
102 if (pdbi->dwMask & DBIM_BKCOLOR)
103 pdbi->crBkgnd = 0;
104 return S_OK;
105}
#define E_FAIL
Definition: ddrawi.h:102
#define IDS_ADDRESSBANDLABEL
Definition: resource.h:126
#define _countof(array)
Definition: sndvol32.h:70
LONG y
Definition: windef.h:330
LONG x
Definition: windef.h:329
COLORREF crBkgnd
Definition: shobjidl.idl:2499
WCHAR wszTitle[256]
Definition: shobjidl.idl:2497
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)

◆ GetClassID()

HRESULT STDMETHODCALLTYPE CAddressBand::GetClassID ( CLSID pClassID)
override

Implements IPersist.

Definition at line 432 of file addressband.cpp.

433{
434 if (pClassID == NULL)
435 return E_POINTER;
436 *pClassID = CLSID_SH_AddressBand;
437 return S_OK;
438}
#define E_POINTER
Definition: winerror.h:2365

◆ GetSite()

HRESULT STDMETHODCALLTYPE CAddressBand::GetSite ( REFIID  riid,
void **  ppvSite 
)
override

Definition at line 178 of file addressband.cpp.

179{
180 if (fSite == NULL)
181 return E_FAIL;
182 return fSite->QueryInterface(riid, ppvSite);
183}
REFIID riid
Definition: atlbase.h:39

◆ GetSizeMax()

HRESULT STDMETHODCALLTYPE CAddressBand::GetSizeMax ( ULARGE_INTEGER pcbSize)
override

Implements IPersistStream.

Definition at line 457 of file addressband.cpp.

458{
459 // incomplete
460 return E_NOTIMPL;
461}

◆ GetWindow()

HRESULT STDMETHODCALLTYPE CAddressBand::GetWindow ( HWND lphwnd)
override

Implements IOleWindow.

Definition at line 185 of file addressband.cpp.

186{
187 if (lphwnd == NULL)
188 return E_POINTER;
189 *lphwnd = m_hWnd;
190 return S_OK;
191}

◆ HasFocusIO()

HRESULT STDMETHODCALLTYPE CAddressBand::HasFocusIO ( )
override

Definition at line 255 of file addressband.cpp.

256{
258 return S_OK;
259 return S_FALSE;
260}
#define S_FALSE
Definition: winerror.h:2357
HWND WINAPI GetFocus(void)
Definition: window.c:1865
#define CB_GETDROPPEDSTATE
Definition: winuser.h:1948

◆ IsDirty()

HRESULT STDMETHODCALLTYPE CAddressBand::IsDirty ( void  )
override

Implements IPersistStream.

Definition at line 440 of file addressband.cpp.

441{
442 return E_NOTIMPL;
443}

◆ IsWindowOwner()

HRESULT STDMETHODCALLTYPE CAddressBand::IsWindowOwner ( HWND  hWnd)
override

Definition at line 385 of file addressband.cpp.

386{
387 CComPtr<IWinEventHandler> winEventHandler;
388 HRESULT hResult;
389
390 if (fAddressEditBox)
391 {
392 hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IWinEventHandler, &winEventHandler));
393 if (FAILED_UNEXPECTEDLY(hResult))
394 return hResult;
395 return winEventHandler->IsWindowOwner(hWnd);
396 }
397 return S_FALSE;
398}
HWND hWnd
Definition: settings.c:17

◆ Load()

HRESULT STDMETHODCALLTYPE CAddressBand::Load ( IStream pStm)
override

Implements IPersistStream.

Definition at line 445 of file addressband.cpp.

446{
447 // incomplete
448 return E_NOTIMPL;
449}

◆ OnEraseBackground()

LRESULT CAddressBand::OnEraseBackground ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 491 of file addressband.cpp.

492{
493 POINT pt;
494 POINT ptOrig;
495 HWND parentWindow;
497
498 if (fGoButtonShown == false)
499 {
500 bHandled = FALSE;
501 return 0;
502 }
503 pt.x = 0;
504 pt.y = 0;
505 parentWindow = GetParent();
506 ::MapWindowPoints(m_hWnd, parentWindow, &pt, 1);
507 OffsetWindowOrgEx(reinterpret_cast<HDC>(wParam), pt.x, pt.y, &ptOrig);
508 result = SendMessage(parentWindow, WM_ERASEBKGND, wParam, 0);
509 SetWindowOrgEx(reinterpret_cast<HDC>(wParam), ptOrig.x, ptOrig.y, NULL);
510 if (result == 0)
511 {
512 bHandled = FALSE;
513 return 0;
514 }
515 return result;
516}
WPARAM wParam
Definition: combotst.c:138
#define pt(x, y)
Definition: drawing.c:79
GLuint64EXT * result
Definition: glext.h:11304
static HDC
Definition: imagelist.c:88
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG_PTR LRESULT
Definition: windef.h:209
BOOL WINAPI SetWindowOrgEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
Definition: coord.c:532
BOOL WINAPI OffsetWindowOrgEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
Definition: coord.c:912
#define WM_ERASEBKGND
Definition: winuser.h:1628
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
HWND WINAPI GetParent(_In_ HWND)

◆ OnFocusChangeIS()

HRESULT STDMETHODCALLTYPE CAddressBand::OnFocusChangeIS ( IUnknown punkObj,
BOOL  fSetFocus 
)
override

Definition at line 427 of file addressband.cpp.

428{
429 return E_NOTIMPL;
430}

◆ OnNotifyClick()

LRESULT CAddressBand::OnNotifyClick ( WPARAM  wParam,
NMHDR notifyHeader,
BOOL bHandled 
)

Definition at line 463 of file addressband.cpp.

464{
465 if (notifyHeader->hwndFrom == fGoButton)
466 {
467 fAddressEditBox->Execute(0);
468 }
469 return 0;
470}
HWND hwndFrom
Definition: winuser.h:3160

◆ OnSize()

LRESULT CAddressBand::OnSize ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 518 of file addressband.cpp.

519{
520 RECT goButtonBounds;
521 RECT buttonBounds;
522 long buttonWidth;
523 long buttonHeight;
524 RECT comboBoxBounds;
525 long newHeight;
526 long newWidth;
527
528 if (fGoButtonShown == false)
529 {
530 bHandled = FALSE;
531 return 0;
532 }
533
534 newHeight = HIWORD(lParam);
535 newWidth = LOWORD(lParam);
536
537 if (!fGoButton)
539
540 SendMessage(fGoButton, TB_GETITEMRECT, 0, reinterpret_cast<LPARAM>(&buttonBounds));
541 buttonWidth = buttonBounds.right - buttonBounds.left;
542 buttonHeight = buttonBounds.bottom - buttonBounds.top;
543
544 DefWindowProc(WM_SIZE, wParam, MAKELONG(newWidth - buttonWidth - 2, newHeight));
545 ::GetWindowRect(fComboBox, &comboBoxBounds);
546 ::SetWindowPos(fGoButton, NULL, newWidth - buttonWidth, (comboBoxBounds.bottom - comboBoxBounds.top - buttonHeight) / 2,
547 buttonWidth, buttonHeight, SWP_NOOWNERZORDER | SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOZORDER);
548
549 goButtonBounds.left = newWidth - buttonWidth;
550 goButtonBounds.top = 0;
551 goButtonBounds.right = newWidth - buttonWidth;
552 goButtonBounds.bottom = newHeight;
553 InvalidateRect(&goButtonBounds, TRUE);
554
556 return 0;
557}
void CreateGoButton()
LPARAM lParam
Definition: combotst.c:139
#define TRUE
Definition: types.h:120
#define LOWORD(l)
Definition: pedump.c:82
#define TB_GETITEMRECT
Definition: commctrl.h:1133
#define DefWindowProc
Definition: ros2win.h:31
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define HIWORD(l)
Definition: typedefs.h:247
#define CB_SETDROPPEDWIDTH
Definition: winuser.h:1965
#define SWP_NOACTIVATE
Definition: winuser.h:1245
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define WM_SIZE
Definition: winuser.h:1614
#define SWP_SHOWWINDOW
Definition: winuser.h:1251
#define SWP_NOOWNERZORDER
Definition: winuser.h:1252
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define SWP_NOZORDER
Definition: winuser.h:1250

◆ OnTipText()

LRESULT CAddressBand::OnTipText ( UINT  idControl,
NMHDR notifyHeader,
BOOL bHandled 
)

Definition at line 472 of file addressband.cpp.

473{
474 if (notifyHeader->hwndFrom == fGoButton)
475 {
476 WCHAR szText[MAX_PATH];
477 WCHAR szFormat[MAX_PATH];
478 LPNMTBGETINFOTIP pGIT = (LPNMTBGETINFOTIP)notifyHeader;
479
480 if (::GetWindowTextW(fEditControl, szText, _countof(szText)))
481 {
482 LoadStringW(_AtlBaseModule.GetResourceInstance(), IDS_GOBUTTONTIPTEMPLATE, szFormat, _countof(szFormat));
483 wnsprintf(pGIT->pszText, pGIT->cchTextMax, szFormat, szText);
484 }
485 else
486 *pGIT->pszText = 0;
487 }
488 return 0;
489}
#define IDS_GOBUTTONTIPTEMPLATE
Definition: resource.h:123
#define MAX_PATH
Definition: compat.h:34
#define LPNMTBGETINFOTIP
Definition: commctrl.h:1394
#define wnsprintf
Definition: shlwapi.h:1727
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1384
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ OnWindowPosChanging()

LRESULT CAddressBand::OnWindowPosChanging ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 559 of file addressband.cpp.

560{
561 RECT goButtonBounds;
562 RECT buttonBounds;
563 long buttonWidth;
564 long buttonHeight;
565 RECT comboBoxBounds;
566 WINDOWPOS positionInfoCopy;
567 long newHeight;
568 long newWidth;
569
570 if (!fGoButtonShown)
571 {
572 bHandled = FALSE;
573 return 0;
574 }
575
576 if (!fGoButton)
578
579 positionInfoCopy = *reinterpret_cast<WINDOWPOS *>(lParam);
580 newHeight = positionInfoCopy.cy;
581 newWidth = positionInfoCopy.cx;
582
583 SendMessage(fGoButton, TB_GETITEMRECT, 0, reinterpret_cast<LPARAM>(&buttonBounds));
584
585 buttonWidth = buttonBounds.right - buttonBounds.left;
586 buttonHeight = buttonBounds.bottom - buttonBounds.top;
587 positionInfoCopy.cx = newWidth - 2 - buttonWidth;
588 DefWindowProc(WM_WINDOWPOSCHANGING, wParam, reinterpret_cast<LPARAM>(&positionInfoCopy));
589 ::GetWindowRect(fComboBox, &comboBoxBounds);
590 ::SetWindowPos(fGoButton, NULL, newWidth - buttonWidth, (comboBoxBounds.bottom - comboBoxBounds.top - buttonHeight) / 2,
591 buttonWidth, buttonHeight, SWP_NOOWNERZORDER | SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOZORDER);
592
593 goButtonBounds.left = newWidth - buttonWidth;
594 goButtonBounds.top = 0;
595 goButtonBounds.right = newWidth - buttonWidth;
596 goButtonBounds.bottom = newHeight;
597 InvalidateRect(&goButtonBounds, TRUE);
598
600 return 0;
601}
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1664

◆ OnWinEvent()

HRESULT STDMETHODCALLTYPE CAddressBand::OnWinEvent ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
LRESULT theResult 
)
override

Definition at line 351 of file addressband.cpp.

353{
354 CComPtr<IWinEventHandler> winEventHandler;
355 HRESULT hResult;
356 RECT rect;
357
358 if (theResult)
359 *theResult = 0;
360
361 switch (uMsg)
362 {
363 case WM_WININICHANGE:
364 break;
365 case WM_COMMAND:
367 {
368 fGoButtonShown = !SHRegGetBoolUSValueW(L"Software\\Microsoft\\Internet Explorer\\Main", L"ShowGoButton", FALSE, TRUE);
369 SHRegSetUSValueW(L"Software\\Microsoft\\Internet Explorer\\Main", L"ShowGoButton", REG_SZ, fGoButtonShown ? (LPVOID)L"yes" : (LPVOID)L"no", fGoButtonShown ? 8 : 6, SHREGSET_FORCE_HKCU);
370 if (!fGoButton)
374 SendMessage(m_hWnd,WM_SIZE,0,MAKELPARAM(rect.right-rect.left,rect.bottom-rect.top));
375 // broadcast change notification to all explorer windows
376 }
377 break;
378 }
379 hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IWinEventHandler, &winEventHandler));
380 if (FAILED_UNEXPECTEDLY(hResult))
381 return hResult;
382 return winEventHandler->OnWinEvent(hWnd, uMsg, wParam, lParam, theResult);
383}
#define IDM_TOOLBARS_GOBUTTON
Definition: resource.h:36
LONG WINAPI SHRegSetUSValueW(LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwType, LPVOID pvData, DWORD cbData, DWORD dwFlags)
Definition: reg.c:673
BOOL WINAPI SHRegGetBoolUSValueW(LPCWSTR pszSubKey, LPCWSTR pszValue, BOOL fIgnoreHKCU, BOOL fDefault)
Definition: reg.c:770
#define REG_SZ
Definition: layer.c:22
#define L(x)
Definition: ntvdm.h:50
#define SHREGSET_FORCE_HKCU
Definition: shlwapi.h:312
& rect
Definition: startmenu.cpp:1413
#define SW_HIDE
Definition: winuser.h:771
#define MAKELPARAM(l, h)
Definition: winuser.h:4011
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1743
#define WM_WININICHANGE
Definition: winuser.h:1633
#define SW_SHOW
Definition: winuser.h:778

◆ QueryService()

HRESULT STDMETHODCALLTYPE CAddressBand::QueryService ( REFGUID  guidService,
REFIID  riid,
void **  ppvObject 
)
override

Implements IServiceProvider.

Definition at line 422 of file addressband.cpp.

423{
424 return E_NOTIMPL;
425}

◆ QueryStatus()

HRESULT STDMETHODCALLTYPE CAddressBand::QueryStatus ( const GUID pguidCmdGroup,
ULONG  cCmds,
OLECMD  prgCmds[],
OLECMDTEXT pCmdText 
)
override

Implements IOleCommandTarget.

Definition at line 242 of file addressband.cpp.

244{
245 return IUnknown_QueryStatus(fAddressEditBox, *pguidCmdGroup, cCmds, prgCmds, pCmdText);
246}
HRESULT WINAPI IUnknown_QueryStatus(IUnknown *lpUnknown, REFGUID pguidCmdGroup, ULONG cCmds, OLECMD *prgCmds, OLECMDTEXT *pCmdText)
Definition: ordinal.c:1048

◆ Refresh()

HRESULT STDMETHODCALLTYPE CAddressBand::Refresh ( long  param8)
override

Definition at line 411 of file addressband.cpp.

412{
413 CComPtr<IAddressBand> addressBand;
414 HRESULT hResult;
415
416 hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IAddressBand, &addressBand));
417 if (FAILED_UNEXPECTEDLY(hResult))
418 return hResult;
419 return addressBand->Refresh(param8);
420}

◆ ResizeBorderDW()

HRESULT STDMETHODCALLTYPE CAddressBand::ResizeBorderDW ( const RECT prcBorder,
IUnknown punkToolbarSite,
BOOL  fReserved 
)
override

Definition at line 224 of file addressband.cpp.

226{
227 return E_NOTIMPL;
228}

◆ Save()

HRESULT STDMETHODCALLTYPE CAddressBand::Save ( IStream pStm,
BOOL  fClearDirty 
)
override

Implements IPersistStream.

Definition at line 451 of file addressband.cpp.

452{
453 // incomplete
454 return E_NOTIMPL;
455}

◆ SetSite()

HRESULT STDMETHODCALLTYPE CAddressBand::SetSite ( IUnknown pUnkSite)
override

Implements IObjectWithSite.

Definition at line 107 of file addressband.cpp.

108{
109 CComPtr<IShellService> shellService;
110 HWND parentWindow;
111 HWND combobox;
112 HRESULT hResult;
113 IImageList *piml;
114
115 if (pUnkSite == NULL)
116 {
117 fSite.Release();
118 return S_OK;
119 }
120
121 fSite.Release();
122
123 hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IDockingWindowSite, &fSite));
124 if (FAILED_UNEXPECTEDLY(hResult))
125 return hResult;
126
127 // get window handle of parent
128 parentWindow = NULL;
129 hResult = IUnknown_GetWindow(fSite, &parentWindow);
130
131 if (!::IsWindow(parentWindow))
132 return E_FAIL;
133
134 // create combo box ex
137 0, 0, 500, 250, parentWindow, (HMENU)IDM_TOOLBARS_ADDRESSBAR, _AtlBaseModule.GetModuleInstance(), 0);
138 if (combobox == NULL)
139 return E_FAIL;
140 SubclassWindow(combobox);
141
144 {
145 SendMessageW(combobox, CBEM_SETIMAGELIST, 0, 0);
146 }
147 else
148 {
149 SendMessageW(combobox, CBEM_SETIMAGELIST, 0, reinterpret_cast<LPARAM>(piml));
150 }
151
154
155 fEditControl = reinterpret_cast<HWND>(SendMessage(CBEM_GETEDITCONTROL, 0, 0));
156 fComboBox = reinterpret_cast<HWND>(SendMessage(CBEM_GETCOMBOCONTROL, 0, 0));
157 hResult = CAddressEditBox_CreateInstance(IID_PPV_ARG(IAddressEditBox, &fAddressEditBox));
158 if (FAILED_UNEXPECTEDLY(hResult))
159 return hResult;
160
161 hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IShellService, &shellService));
162 if (FAILED_UNEXPECTEDLY(hResult))
163 return hResult;
164 hResult = fAddressEditBox->Init(combobox, fEditControl, 8, fSite /*(IAddressBand *)this*/);
165 if (FAILED_UNEXPECTEDLY(hResult))
166 return hResult;
167 hResult = shellService->SetOwner(fSite);
168 if (FAILED_UNEXPECTEDLY(hResult))
169 return hResult;
170
171 fGoButtonShown = SHRegGetBoolUSValueW(L"Software\\Microsoft\\Internet Explorer\\Main", L"ShowGoButton", FALSE, TRUE);
172 if (fGoButtonShown)
174
175 return hResult;
176}
HRESULT CAddressEditBox_CreateInstance(REFIID riid, void **ppv)
Definition: browseui.cpp:33
#define IDM_TOOLBARS_ADDRESSBAR
Definition: resource.h:31
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1336
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
#define WS_TABSTOP
Definition: pedump.c:634
#define WS_VISIBLE
Definition: pedump.c:620
#define CBEM_GETCOMBOCONTROL
Definition: commctrl.h:3837
#define WC_COMBOBOXEXW
Definition: commctrl.h:3786
#define CBEM_SETEXTENDEDSTYLE
Definition: commctrl.h:3840
#define CBEM_SETIMAGELIST
Definition: commctrl.h:3832
#define CBES_EX_NOSIZELIMIT
Definition: commctrl.h:3859
#define CBES_EX_CASESENSITIVE
Definition: commctrl.h:3860
#define CCS_NOMOVEY
Definition: commctrl.h:2248
#define CBEM_GETEDITCONTROL
Definition: commctrl.h:3838
#define SHIL_SMALL
Definition: shellapi.h:186
HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
Definition: shellord.c:2673
HRESULT hr
Definition: shlfolder.c:183
#define SubclassWindow(hwnd, lpfn)
Definition: windowsx.h:542
#define CBS_OWNERDRAWFIXED
Definition: winuser.h:289
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ ShowDW()

HRESULT STDMETHODCALLTYPE CAddressBand::ShowDW ( BOOL  fShow)
override

Implements IDockingWindow.

Definition at line 230 of file addressband.cpp.

231{
232 if (m_hWnd)
233 {
234 if (fShow)
236 else
238 }
239 return S_OK;
240}

Referenced by CloseDW().

◆ TranslateAcceleratorIO()

HRESULT STDMETHODCALLTYPE CAddressBand::TranslateAcceleratorIO ( LPMSG  lpMsg)
override

Definition at line 303 of file addressband.cpp.

304{
305 // Enable Address bar access key (Alt+D)
306 switch (lpMsg->message)
307 {
308 case WM_SYSKEYDOWN:
309 case WM_SYSCHAR:
310 {
311 WCHAR chAccess = GetAddressBarAccessKey(L'D');
312 if (lpMsg->wParam == chAccess)
313 {
316 return S_FALSE;
317 }
318 break;
319 }
320 }
321
322 if (lpMsg->hwnd == fEditControl)
323 {
324 switch (lpMsg->message)
325 {
326 case WM_SYSKEYDOWN:
327 case WM_SYSKEYUP:
328 case WM_SYSCOMMAND:
329 case WM_SYSDEADCHAR:
330 case WM_SYSCHAR:
331 return S_FALSE;
332 }
333
334 TranslateMessage(lpMsg);
335 DispatchMessage(lpMsg);
336 return S_OK;
337 }
338 return S_FALSE;
339}
static WCHAR GetAddressBarAccessKey(WCHAR chAccess)
UINT message
Definition: winuser.h:3118
HWND hwnd
Definition: winuser.h:3117
WPARAM wParam
Definition: winuser.h:3119
#define WM_SYSCOMMAND
Definition: winuser.h:1744
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_SYSCHAR
Definition: winuser.h:1724
#define WM_SYSDEADCHAR
Definition: winuser.h:1725
HWND WINAPI SetFocus(_In_opt_ HWND)
#define WM_SYSKEYUP
Definition: winuser.h:1723
#define EM_SETSEL
Definition: winuser.h:2021
#define DispatchMessage
Definition: winuser.h:5777
#define WM_SYSKEYDOWN
Definition: winuser.h:1722

◆ UIActivateIO()

HRESULT STDMETHODCALLTYPE CAddressBand::UIActivateIO ( BOOL  fActivate,
LPMSG  lpMsg 
)
override

Definition at line 341 of file addressband.cpp.

342{
343 if (fActivate)
344 {
345 IUnknown_OnFocusChangeIS(fSite, static_cast<IDeskBand *>(this), fActivate);
346 SetFocus();
347 }
348 return S_OK;
349}
HRESULT WINAPI IUnknown_OnFocusChangeIS(LPUNKNOWN lpUnknown, LPUNKNOWN pFocusObject, BOOL bFocus)
Definition: ordinal.c:4783

Member Data Documentation

◆ fAddressEditBox

CComPtr<IAddressEditBox> CAddressBand::fAddressEditBox
private

◆ fComboBox

HWND CAddressBand::fComboBox
private

Definition at line 42 of file addressband.h.

Referenced by CAddressBand(), OnSize(), OnWindowPosChanging(), and SetSite().

◆ fEditControl

HWND CAddressBand::fEditControl
private

Definition at line 40 of file addressband.h.

Referenced by CAddressBand(), HasFocusIO(), OnTipText(), SetSite(), and TranslateAcceleratorIO().

◆ fGoButton

HWND CAddressBand::fGoButton
private

◆ fGoButtonShown

bool CAddressBand::fGoButtonShown
private

◆ fSite

CComPtr<IDockingWindowSite> CAddressBand::fSite
private

Definition at line 38 of file addressband.h.

Referenced by CloseDW(), FocusChange(), GetSite(), SetSite(), and UIActivateIO().

◆ m_himlHot

HIMAGELIST CAddressBand::m_himlHot
private

Definition at line 45 of file addressband.h.

Referenced by CloseDW(), and CreateGoButton().

◆ m_himlNormal

HIMAGELIST CAddressBand::m_himlNormal
private

Definition at line 44 of file addressband.h.

Referenced by CloseDW(), and CreateGoButton().


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