4 * Copyright 2009 Andrew Hill <ash77 at domain reactos.org>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 This class handles the combo box of the address band.
27 Add auto completion support
28 Subclass windows in Init method
29 Connect to browser connection point
30 Handle navigation complete messages to set edit box text
31 Handle listbox dropdown message and fill contents
32 Add drag and drop of icon in edit box
33 Handle enter in edit box to browse to typed path
34 Handle change notifies to update appropriately
35 Add handling of enter in edit box
36 Fix so selection in combo listbox navigates
37 Fix so editing text and typing enter navigates
40 CAddressEditBox::CAddressEditBox() :
41 fEditWindow(NULL
, this, 1),
42 fComboBoxExWindow(NULL
, this, 2)
46 CAddressEditBox::~CAddressEditBox()
50 HRESULT STDMETHODCALLTYPE
CAddressEditBox::SetOwner(IUnknown
*)
52 // connect to browser connection point
56 HRESULT STDMETHODCALLTYPE
CAddressEditBox::FileSysChange(long param8
, long paramC
)
61 HRESULT STDMETHODCALLTYPE
CAddressEditBox::Refresh(long param8
)
66 HRESULT STDMETHODCALLTYPE
CAddressEditBox::Init(HWND comboboxEx
, HWND editControl
, long param14
, IUnknown
*param18
)
68 fComboBoxExWindow
.SubclassWindow(comboboxEx
);
69 fEditWindow
.SubclassWindow(editControl
);
73 HRESULT STDMETHODCALLTYPE
CAddressEditBox::SetCurrentDir(long paramC
)
78 HRESULT STDMETHODCALLTYPE
CAddressEditBox::ParseNow(long paramC
)
83 HRESULT STDMETHODCALLTYPE
CAddressEditBox::Execute(long paramC
)
88 HRESULT STDMETHODCALLTYPE
CAddressEditBox::Save(long paramC
)
93 HRESULT STDMETHODCALLTYPE
CAddressEditBox::OnWinEvent(HWND hWnd
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
, LRESULT
*theResult
)
95 // handle fill of listbox here
99 HRESULT STDMETHODCALLTYPE
CAddressEditBox::IsWindowOwner(HWND hWnd
)
104 HRESULT STDMETHODCALLTYPE
CAddressEditBox::QueryStatus(const GUID
*pguidCmdGroup
, ULONG cCmds
, OLECMD prgCmds
[ ], OLECMDTEXT
*pCmdText
)
109 HRESULT STDMETHODCALLTYPE
CAddressEditBox::Exec(const GUID
*pguidCmdGroup
, DWORD nCmdID
, DWORD nCmdexecopt
, VARIANT
*pvaIn
, VARIANT
*pvaOut
)
114 HRESULT STDMETHODCALLTYPE
CAddressEditBox::GetTypeInfoCount(UINT
*pctinfo
)
119 HRESULT STDMETHODCALLTYPE
CAddressEditBox::GetTypeInfo(UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
124 HRESULT STDMETHODCALLTYPE
CAddressEditBox::GetIDsOfNames(REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
129 HRESULT STDMETHODCALLTYPE
CAddressEditBox::Invoke(DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
131 // on navigate complete, change edit section of combobox
135 HRESULT STDMETHODCALLTYPE
CAddressEditBox::GetClassID(CLSID
*pClassID
)
137 if (pClassID
== NULL
)
139 *pClassID
= CLSID_AddressEditBox
;
143 HRESULT STDMETHODCALLTYPE
CAddressEditBox::IsDirty()
148 HRESULT STDMETHODCALLTYPE
CAddressEditBox::Load(IStream
*pStm
)
153 HRESULT STDMETHODCALLTYPE
CAddressEditBox::Save(IStream
*pStm
, BOOL fClearDirty
)
158 HRESULT STDMETHODCALLTYPE
CAddressEditBox::GetSizeMax(ULARGE_INTEGER
*pcbSize
)
163 HRESULT
CreateAddressEditBox(REFIID riid
, void **ppv
)
165 CComObject
<CAddressEditBox
> *theMenuBar
;
171 ATLTRY (theMenuBar
= new CComObject
<CAddressEditBox
>);
172 if (theMenuBar
== NULL
)
173 return E_OUTOFMEMORY
;
174 hResult
= theMenuBar
->QueryInterface (riid
, (void **)ppv
);
175 if (FAILED (hResult
))