2011-05-15 15:55:49 +00:00
|
|
|
|
/*
|
|
|
|
|
* AutoComplete interfaces implementation.
|
|
|
|
|
*
|
|
|
|
|
* Copyright 2004 Maxime Belleng<EFBFBD> <maxime.bellenge@laposte.net>
|
|
|
|
|
* Copyright 2009 Andrew Hill
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _AUTOCOMPLETE_H_
|
|
|
|
|
#define _AUTOCOMPLETE_H_
|
|
|
|
|
|
|
|
|
|
class CAutoComplete :
|
|
|
|
|
public CComCoClass<CAutoComplete, &CLSID_AutoComplete>,
|
|
|
|
|
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
2016-03-29 08:27:26 +00:00
|
|
|
|
public IAutoComplete2,
|
|
|
|
|
public IAutoCompleteDropDown,
|
|
|
|
|
public IEnumString
|
2011-05-15 15:55:49 +00:00
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
BOOL enabled;
|
2011-09-27 11:58:19 +00:00
|
|
|
|
BOOL initialized;
|
2011-05-15 15:55:49 +00:00
|
|
|
|
HWND hwndEdit;
|
|
|
|
|
HWND hwndListBox;
|
|
|
|
|
WNDPROC wpOrigEditProc;
|
|
|
|
|
WNDPROC wpOrigLBoxProc;
|
|
|
|
|
WCHAR *txtbackup;
|
|
|
|
|
WCHAR *quickComplete;
|
|
|
|
|
CComPtr<IEnumString> enumstr;
|
|
|
|
|
AUTOCOMPLETEOPTIONS options;
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
CAutoComplete();
|
|
|
|
|
~CAutoComplete();
|
|
|
|
|
|
|
|
|
|
static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
|
|
|
static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
|
|
|
|
2017-04-17 09:35:08 +00:00
|
|
|
|
void CreateListbox();
|
|
|
|
|
|
2011-05-15 15:55:49 +00:00
|
|
|
|
// IAutoComplete2
|
|
|
|
|
virtual HRESULT WINAPI Enable(BOOL fEnable);
|
|
|
|
|
virtual HRESULT WINAPI Init(HWND hwndEdit, IUnknown *punkACL, LPCOLESTR pwzsRegKeyPath, LPCOLESTR pwszQuickComplete);
|
|
|
|
|
virtual HRESULT WINAPI GetOptions(DWORD *pdwFlag);
|
|
|
|
|
virtual HRESULT WINAPI SetOptions(DWORD dwFlag);
|
|
|
|
|
|
2016-03-29 08:27:26 +00:00
|
|
|
|
// IAutoCompleteDropDown
|
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE GetDropDownStatus(DWORD *pdwFlags, LPWSTR *ppwszString);
|
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE ResetEnumerator();
|
|
|
|
|
|
|
|
|
|
// IEnumString methods
|
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE Next(ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched);
|
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE Skip(ULONG celt);
|
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE Reset();
|
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE Clone(IEnumString **ppenum);
|
|
|
|
|
|
2011-05-15 15:55:49 +00:00
|
|
|
|
DECLARE_REGISTRY_RESOURCEID(IDR_AUTOCOMPLETE)
|
|
|
|
|
DECLARE_NOT_AGGREGATABLE(CAutoComplete)
|
|
|
|
|
|
|
|
|
|
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
|
|
|
|
|
|
|
|
|
BEGIN_COM_MAP(CAutoComplete)
|
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IAutoComplete, IAutoComplete)
|
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IAutoComplete2, IAutoComplete2)
|
2016-03-29 08:27:26 +00:00
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IAutoCompleteDropDown, IAutoCompleteDropDown)
|
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IEnumString, IEnumString)
|
2011-05-15 15:55:49 +00:00
|
|
|
|
END_COM_MAP()
|
|
|
|
|
};
|
|
|
|
|
|
2014-01-25 17:24:24 +00:00
|
|
|
|
#endif /* _AUTOCOMPLETE_H_ */
|