mirror of
https://github.com/reactos/reactos.git
synced 2025-06-25 03:09:43 +00:00
[shell32]
- Fix auto complete init method based on Wine. Autocomplete shell tests should no longer crash now. - Brought to you by Claudiu Mihail. svn path=/trunk/; revision=53871
This commit is contained in:
parent
1b664f1b5f
commit
d3cccfe25f
2 changed files with 13 additions and 1 deletions
|
@ -45,6 +45,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||||
CAutoComplete::CAutoComplete()
|
CAutoComplete::CAutoComplete()
|
||||||
{
|
{
|
||||||
enabled = TRUE;
|
enabled = TRUE;
|
||||||
|
initialized = FALSE;
|
||||||
options = ACO_AUTOAPPEND;
|
options = ACO_AUTOAPPEND;
|
||||||
wpOrigEditProc = NULL;
|
wpOrigEditProc = NULL;
|
||||||
hwndListBox = NULL;
|
hwndListBox = NULL;
|
||||||
|
@ -105,7 +106,15 @@ HRESULT WINAPI CAutoComplete::Init(HWND hwndEdit, IUnknown *punkACL, LPCOLESTR p
|
||||||
if (options & ACO_RTLREADING)
|
if (options & ACO_RTLREADING)
|
||||||
FIXME(" ACO_RTLREADING not supported\n");
|
FIXME(" ACO_RTLREADING not supported\n");
|
||||||
|
|
||||||
hwndEdit = hwndEdit;
|
if (!hwndEdit || !punkACL)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
if (this->initialized)
|
||||||
|
{
|
||||||
|
WARN("Autocompletion object is already initialized\n");
|
||||||
|
/* This->hwndEdit is set to NULL when the edit window is destroyed. */
|
||||||
|
return this->hwndEdit ? E_FAIL : E_UNEXPECTED;
|
||||||
|
}
|
||||||
|
|
||||||
if (!SUCCEEDED (punkACL->QueryInterface(IID_IEnumString, (LPVOID *)&enumstr)))
|
if (!SUCCEEDED (punkACL->QueryInterface(IID_IEnumString, (LPVOID *)&enumstr)))
|
||||||
{
|
{
|
||||||
|
@ -113,6 +122,8 @@ HRESULT WINAPI CAutoComplete::Init(HWND hwndEdit, IUnknown *punkACL, LPCOLESTR p
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->hwndEdit = hwndEdit;
|
||||||
|
this->initialized = TRUE;
|
||||||
wpOrigEditProc = (WNDPROC)SetWindowLongPtrW(hwndEdit, GWLP_WNDPROC, (LONG_PTR) ACEditSubclassProc);
|
wpOrigEditProc = (WNDPROC)SetWindowLongPtrW(hwndEdit, GWLP_WNDPROC, (LONG_PTR) ACEditSubclassProc);
|
||||||
SetWindowLongPtrW(hwndEdit, GWLP_USERDATA, (LONG_PTR)this);
|
SetWindowLongPtrW(hwndEdit, GWLP_USERDATA, (LONG_PTR)this);
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ class CAutoComplete :
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
BOOL enabled;
|
BOOL enabled;
|
||||||
|
BOOL initialized;
|
||||||
HWND hwndEdit;
|
HWND hwndEdit;
|
||||||
HWND hwndListBox;
|
HWND hwndListBox;
|
||||||
WNDPROC wpOrigEditProc;
|
WNDPROC wpOrigEditProc;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue