winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
April 2019
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
803 discussions
Start a n
N
ew thread
Nikolay Sivov : dbgeng: Add IDebugDataSpaces stub.
by Alexandre Julliard
03 Apr '19
03 Apr '19
Module: wine Branch: master Commit: a47bb5dc839811f52219ebf6a3acf4cea679f138 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a47bb5dc839811f52219ebf6…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Apr 3 12:16:45 2019 +0300 dbgeng: Add IDebugDataSpaces stub. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbgeng/dbgeng.c | 236 +++++++++++++++++++++++++++++++++++++++++++++++++-- include/dbgeng.h | 40 +++++++++ 2 files changed, 271 insertions(+), 5 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=a47bb5dc839811f52219…
1
0
0
0
Nikolay Sivov : dbgeng: Add IDebugClient stub.
by Alexandre Julliard
03 Apr '19
03 Apr '19
Module: wine Branch: master Commit: 9b1b48c51432f7b9bd8be8d37d4738c1d756e46f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9b1b48c51432f7b9bd8be8d3…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Apr 3 12:16:44 2019 +0300 dbgeng: Add IDebugClient stub. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbgeng/dbgeng.c | 475 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 458 insertions(+), 17 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=9b1b48c51432f7b9bd8b…
1
0
0
0
Nikolay Sivov : include: Add IDebugClient interface definition.
by Alexandre Julliard
03 Apr '19
03 Apr '19
Module: wine Branch: master Commit: 82d059d9222b513cdfaef7a69469130e1127d61f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=82d059d9222b513cdfaef7a6…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Apr 3 12:16:43 2019 +0300 include: Add IDebugClient interface definition. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/Makefile.in | 1 + include/dbgeng.h | 163 ++++++++++++++++++++++++++++++++++++++++++++++++++++ include/winnt.h | 21 +++++++ 3 files changed, 185 insertions(+) diff --git a/include/Makefile.in b/include/Makefile.in index 2817c10..c478c34 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -143,6 +143,7 @@ SOURCES = \ dbccmd.idl \ dbcses.idl \ dbdsad.idl \ + dbgeng.h \ dbghelp.h \ dbinit.idl \ dbprop.idl \ diff --git a/include/dbgeng.h b/include/dbgeng.h new file mode 100644 index 0000000..03305cc --- /dev/null +++ b/include/dbgeng.h @@ -0,0 +1,163 @@ +/* + * Copyright 2019 Nikolay Sivov for CodeWeavers + * + * 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 + */ + +#include "objbase.h" + +#ifdef __cplusplus +extern "C" { +#endif + +DEFINE_GUID(IID_IDebugInputCallbacks, 0x9f50e42c, 0xf136, 0x499e, 0x9a, 0x97, 0x73, 0x03, 0x6c, 0x94, 0xed, 0x2d); +DEFINE_GUID(IID_IDebugOutputCallbacks, 0x4bf58045, 0xd654, 0x4c40, 0xb0, 0xaf, 0x68, 0x30, 0x90, 0xf3, 0x56, 0xdc); +DEFINE_GUID(IID_IDebugEventCallbacks, 0x337be28b, 0x5036, 0x4d72, 0xb6, 0xbf, 0xc4, 0x5f, 0xbb, 0x9f, 0x2e, 0xaa); +DEFINE_GUID(IID_IDebugClient, 0x27fe5639, 0x8407, 0x4f47, 0x83, 0x64, 0xee, 0x11, 0x8f, 0xb0, 0x8a, 0xc8); + +#define INTERFACE IDebugBreakpoint +DECLARE_INTERFACE_(IDebugBreakpoint, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + /* IDebugBreakpoint */ + /* FIXME */ +}; +#undef INTERFACE + +typedef IDebugBreakpoint* PDEBUG_BREAKPOINT; + +#define INTERFACE IDebugInputCallbacks +DECLARE_INTERFACE_(IDebugInputCallbacks, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + /* IDebugInputCallbacks */ + STDMETHOD(StartInput)(THIS_ ULONG buffer_size) PURE; + STDMETHOD(EndInput)(THIS) PURE; +}; +#undef INTERFACE + +#define INTERFACE IDebugOutputCallbacks +DECLARE_INTERFACE_(IDebugOutputCallbacks, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + /* IDebugOutputCallbacks */ + STDMETHOD(Output)(THIS_ ULONG mask, const char *text) PURE; +}; +#undef INTERFACE + +#ifdef WINE_NO_UNICODE_MACROS +#undef CreateProcess +#endif + +#define INTERFACE IDebugEventCallbacks +DECLARE_INTERFACE_(IDebugEventCallbacks, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + /* IDebugEventCallbacks */ + STDMETHOD(GetInterestMask)(THIS_ ULONG *mask) PURE; + STDMETHOD(Breakpoint)(THIS_ PDEBUG_BREAKPOINT breakpoint) PURE; + STDMETHOD(Exception)(THIS_ EXCEPTION_RECORD64 *exception, ULONG first_chance) PURE; + STDMETHOD(CreateThread)(THIS_ ULONG64 handle, ULONG64 data_offset, ULONG64 start_offset) PURE; + STDMETHOD(ExitThread)(THIS_ ULONG exit_code) PURE; + STDMETHOD(CreateProcess)(THIS_ ULONG64 image_handle, ULONG64 handle, ULONG64 base_offset, ULONG module_size, + const char *module_name, const char *image_name, ULONG checksum, ULONG timedatestamp, + ULONG64 initial_thread_handle, ULONG64 thread_data_offset, ULONG64 start_offset) PURE; + STDMETHOD(ExitProcess)(THIS_ ULONG exit_code) PURE; + STDMETHOD(LoadModule)(THIS_ ULONG64 image_handle, ULONG64 base_offset, ULONG module_size, const char *module_name, + const char *image_name, ULONG checksum, ULONG timedatestamp) PURE; + STDMETHOD(UnloadModule)(THIS_ const char *image_basename, ULONG64 base_offset) PURE; + STDMETHOD(SystemError)(THIS_ ULONG error, ULONG level) PURE; + STDMETHOD(SessionStatus)(THIS_ ULONG status) PURE; + STDMETHOD(ChangeDebuggeeState)(THIS_ ULONG flags, ULONG64 argument) PURE; + STDMETHOD(ChangeEngineState)(THIS_ ULONG flags, ULONG64 argument) PURE; + STDMETHOD(ChangeSymbolState)(THIS_ ULONG flags, ULONG64 argument) PURE; +}; +#undef INTERFACE + +#define INTERFACE IDebugClient +DECLARE_INTERFACE_(IDebugClient, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + /* IDebugClient */ + STDMETHOD(AttachKernel)(THIS_ ULONG flags, const char *options) PURE; + STDMETHOD(GetKernelConnectionOptions)(THIS_ char *buffer, ULONG buffer_size, ULONG *options_size) PURE; + STDMETHOD(SetKernelConnectionOptions)(THIS_ const char *options) PURE; + STDMETHOD(StartProcessServer)(THIS_ ULONG flags, const char *options, void *reserved) PURE; + STDMETHOD(ConnectProcessServer)(THIS_ const char *remote_options, ULONG64 *server) PURE; + STDMETHOD(DisconnectProcessServer)(THIS_ ULONG64 server) PURE; + STDMETHOD(GetRunningProcessSystemIds)(THIS_ ULONG64 server, ULONG *ids, ULONG count, ULONG *actual_count) PURE; + STDMETHOD(GetRunningProcessSystemIdByExecutableName)(THIS_ ULONG64 server, const char *exe_name, + ULONG flags, ULONG *id) PURE; + STDMETHOD(GetRunningProcessDescription)(THIS_ ULONG64 server, ULONG systemid, ULONG flags, char *exe_name, + ULONG exe_name_size, ULONG *actual_exe_name_size, char *description, ULONG description_size, + ULONG *actual_description_size) PURE; + STDMETHOD(AttachProcess)(THIS_ ULONG64 server, ULONG pid, ULONG flags) PURE; + STDMETHOD(CreateProcess)(THIS_ ULONG64 server, char *cmdline, ULONG flags) PURE; + STDMETHOD(CreateProcessAndAttach)(THIS_ ULONG64 server, char *cmdline, ULONG create_flags, + ULONG pid, ULONG attach_flags) PURE; + STDMETHOD(GetProcessOptions)(THIS_ ULONG *options) PURE; + STDMETHOD(AddProcessOptions)(THIS_ ULONG options) PURE; + STDMETHOD(RemoveProcessOptions)(THIS_ ULONG options) PURE; + STDMETHOD(SetProcessOptions)(THIS_ ULONG options) PURE; + STDMETHOD(OpenDumpFile)(THIS_ const char *filename) PURE; + STDMETHOD(WriteDumpFile)(THIS_ const char *filename, ULONG qualifier) PURE; + STDMETHOD(ConnectSession)(THIS_ ULONG flags, ULONG history_limit) PURE; + STDMETHOD(StartServer)(THIS_ const char *options) PURE; + STDMETHOD(OutputServers)(THIS_ ULONG output_control, const char *machine, ULONG flags) PURE; + STDMETHOD(TerminateProcesses)(THIS) PURE; + STDMETHOD(DetachProcesses)(THIS) PURE; + STDMETHOD(EndSession)(THIS_ ULONG flags) PURE; + STDMETHOD(GetExitCode)(THIS_ ULONG *code) PURE; + STDMETHOD(DispatchCallbacks)(THIS_ ULONG timeout) PURE; + STDMETHOD(ExitDispatch)(THIS_ IDebugClient *client) PURE; + STDMETHOD(CreateClient)(THIS_ IDebugClient **client) PURE; + STDMETHOD(GetInputCallbacks)(THIS_ IDebugInputCallbacks **callbacks) PURE; + STDMETHOD(SetInputCallbacks)(THIS_ IDebugInputCallbacks *callbacks) PURE; + STDMETHOD(GetOutputCallbacks)(THIS_ IDebugOutputCallbacks **callbacks) PURE; + STDMETHOD(SetOutputCallbacks)(THIS_ IDebugOutputCallbacks *callbacks) PURE; + STDMETHOD(GetOutputMask)(THIS_ ULONG *mask) PURE; + STDMETHOD(SetOutputMask)(THIS_ ULONG mask) PURE; + STDMETHOD(GetOtherOutputMask)(THIS_ IDebugClient *client, ULONG *mask) PURE; + STDMETHOD(SetOtherOutputMask)(THIS_ IDebugClient *client, ULONG mask) PURE; + STDMETHOD(GetOutputWidth)(THIS_ ULONG *columns) PURE; + STDMETHOD(SetOutputWidth)(THIS_ ULONG columns) PURE; + STDMETHOD(GetOutputLinePrefix)(THIS_ char *buffer, ULONG buffer_size, ULONG *prefix_size) PURE; + STDMETHOD(SetOutputLinePrefix)(THIS_ const char *prefix) PURE; + STDMETHOD(GetIdentity)(THIS_ char *buffer, ULONG buffer_size, ULONG *identity_size) PURE; + STDMETHOD(OutputIdentity)(THIS_ ULONG output_control, ULONG flags, const char *format) PURE; + STDMETHOD(GetEventCallbacks)(THIS_ IDebugEventCallbacks **callbacks) PURE; + STDMETHOD(SetEventCallbacks)(THIS_ IDebugEventCallbacks *callbacks) PURE; + STDMETHOD(FlushCallbacks)(THIS) PURE; +}; +#undef INTERFACE + +#ifdef __cplusplus +} +#endif diff --git a/include/winnt.h b/include/winnt.h index 28e87c7..29a7372 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -2419,6 +2419,27 @@ typedef struct _EXCEPTION_RECORD ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; } EXCEPTION_RECORD, *PEXCEPTION_RECORD; +typedef struct _EXCEPTION_RECORD32 +{ + DWORD ExceptionCode; + DWORD ExceptionFlags; + DWORD ExceptionRecord; + DWORD ExceptionAddress; + DWORD NumberParameters; + DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; +} EXCEPTION_RECORD32, *PEXCEPTION_RECORD32; + +typedef struct _EXCEPTION_RECORD64 +{ + DWORD ExceptionCode; + DWORD ExceptionFlags; + DWORD64 ExceptionRecord; + DWORD64 ExceptionAddress; + DWORD NumberParameters; + DWORD __unusedAlignment; + DWORD64 ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; +} EXCEPTION_RECORD64, *PEXCEPTION_RECORD64; + /* * The exception pointers structure passed to exception filters * in except() and the UnhandledExceptionFilter().
1
0
0
0
Gabriel Ivăncescu : comctl32/button: Implement BCM_GETSPLITINFO.
by Alexandre Julliard
03 Apr '19
03 Apr '19
Module: wine Branch: master Commit: 4e08a7e5d700a5796ccd4873a8c715748d09c5e8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4e08a7e5d700a5796ccd4873…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Mon Apr 1 15:19:39 2019 +0300 comctl32/button: Implement BCM_GETSPLITINFO. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 4b8a8f4..213ab29 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -466,6 +466,9 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L infoPtr->hwnd = hWnd; infoPtr->parent = cs->hwndParent; infoPtr->style = cs->style; + infoPtr->split_style = BCSS_STRETCH; + infoPtr->glyph = (HIMAGELIST)0x36; /* Marlett down arrow char code */ + infoPtr->glyph_size.cx = get_default_glyph_size(infoPtr); return DefWindowProcW(hWnd, uMsg, wParam, lParam); } @@ -880,6 +883,22 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L return TRUE; } + case BCM_GETSPLITINFO: + { + BUTTON_SPLITINFO *info = (BUTTON_SPLITINFO*)lParam; + + if (!info) return FALSE; + + if (info->mask & BCSIF_STYLE) + info->uSplitStyle = infoPtr->split_style; + if (info->mask & (BCSIF_GLYPH | BCSIF_IMAGE)) + info->himlGlyph = infoPtr->glyph; + if (info->mask & BCSIF_SIZE) + info->size = infoPtr->glyph_size; + + return TRUE; + } + case BM_GETCHECK: return infoPtr->state & 3;
1
0
0
0
Gabriel Ivăncescu : comctl32/button: Implement BCM_SETSPLITINFO.
by Alexandre Julliard
03 Apr '19
03 Apr '19
Module: wine Branch: master Commit: 82d39e181778f165a973c90a8e80c261a3926a20 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=82d39e181778f165a973c90a…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Mon Apr 1 15:19:38 2019 +0300 comctl32/button: Implement BCM_SETSPLITINFO. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 38c7d4c..4b8a8f4 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -86,6 +86,9 @@ typedef struct _BUTTON_INFO INT note_length; DWORD image_type; /* IMAGE_BITMAP or IMAGE_ICON */ BUTTON_IMAGELIST imagelist; + UINT split_style; + HIMAGELIST glyph; /* this is a font character code when split_style doesn't have BCSS_IMAGE */ + SIZE glyph_size; RECT text_margin; union { @@ -243,6 +246,21 @@ static inline WCHAR *get_button_text( const BUTTON_INFO *infoPtr ) return buffer; } +/* get the default glyph size for split buttons */ +static LONG get_default_glyph_size(const BUTTON_INFO *infoPtr) +{ + if (infoPtr->split_style & BCSS_IMAGE) + { + /* Size it to fit, including the left and right edges */ + int w, h; + if (!ImageList_GetIconSize(infoPtr->glyph, &w, &h)) w = 0; + return w + GetSystemMetrics(SM_CXEDGE) * 2; + } + + /* The glyph size relies on the default menu font's cell height */ + return GetSystemMetrics(SM_CYMENUCHECK); +} + static void init_custom_draw(NMCUSTOMDRAW *nmcd, const BUTTON_INFO *infoPtr, HDC hdc, const RECT *rc) { nmcd->hdr.hwndFrom = infoPtr->hwnd; @@ -834,6 +852,34 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L return TRUE; } + case BCM_SETSPLITINFO: + { + BUTTON_SPLITINFO *info = (BUTTON_SPLITINFO*)lParam; + + if (!info) return TRUE; + + if (info->mask & (BCSIF_GLYPH | BCSIF_IMAGE)) + { + infoPtr->split_style &= ~BCSS_IMAGE; + if (!(info->mask & BCSIF_GLYPH)) + infoPtr->split_style |= BCSS_IMAGE; + infoPtr->glyph = info->himlGlyph; + infoPtr->glyph_size.cx = infoPtr->glyph_size.cy = 0; + } + + if (info->mask & BCSIF_STYLE) + infoPtr->split_style = info->uSplitStyle; + if (info->mask & BCSIF_SIZE) + infoPtr->glyph_size = info->size; + + /* Calculate fitting value for cx if invalid (cy is untouched) */ + if (infoPtr->glyph_size.cx <= 0) + infoPtr->glyph_size.cx = get_default_glyph_size(infoPtr); + + /* Windows doesn't invalidate or redraw it, so we don't, either */ + return TRUE; + } + case BM_GETCHECK: return infoPtr->state & 3;
1
0
0
0
Gabriel Ivăncescu : comctl32/button: Implement BCM_SETDROPDOWNSTATE.
by Alexandre Julliard
03 Apr '19
03 Apr '19
Module: wine Branch: master Commit: 202a1c1ef048cf4f8f224bf36a3b514d548016e8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=202a1c1ef048cf4f8f224bf3…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Mon Apr 1 15:19:37 2019 +0300 comctl32/button: Implement BCM_SETDROPDOWNSTATE. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 0bd416d..38c7d4c 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -875,6 +875,17 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L } break; + case BCM_SETDROPDOWNSTATE: + new_state = wParam ? BST_DROPDOWNPUSHED : 0; + + if ((infoPtr->state ^ new_state) & BST_DROPDOWNPUSHED) + { + infoPtr->state &= ~BST_DROPDOWNPUSHED; + infoPtr->state |= new_state; + InvalidateRect(hWnd, NULL, FALSE); + } + break; + case BCM_SETTEXTMARGIN: { RECT *text_margin = (RECT *)lParam;
1
0
0
0
Gabriel Ivăncescu : comctl32/button: Center align split buttons' text by default.
by Alexandre Julliard
03 Apr '19
03 Apr '19
Module: wine Branch: master Commit: 725d3ff9f31a82ab69d0498167c3baca8ebc4b93 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=725d3ff9f31a82ab69d04981…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Mon Apr 1 15:19:36 2019 +0300 comctl32/button: Center align split buttons' text by default. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index f7497a1..0bd416d 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -215,6 +215,13 @@ static inline UINT get_button_type( LONG window_style ) return (window_style & BS_TYPEMASK); } +static inline BOOL button_centers_text( LONG window_style ) +{ + /* Push button's text is centered by default, same for split buttons */ + UINT type = get_button_type(window_style); + return type <= BS_DEFPUSHBUTTON || type == BS_SPLITBUTTON || type == BS_DEFSPLITBUTTON; +} + /* paint a button of any type */ static inline void paint_button( BUTTON_INFO *infoPtr, LONG style, UINT action ) { @@ -308,9 +315,7 @@ static UINT BUTTON_BStoDT( DWORD style, DWORD ex_style ) case BS_RIGHT: dtStyle |= DT_RIGHT; break; case BS_CENTER: dtStyle |= DT_CENTER; break; default: - /* Pushbutton's text is centered by default */ - if (get_button_type(style) <= BS_DEFPUSHBUTTON) dtStyle |= DT_CENTER; - /* all other flavours have left aligned text */ + if (button_centers_text(style)) dtStyle |= DT_CENTER; } if (ex_style & WS_EX_RIGHT) dtStyle = DT_RIGHT | (dtStyle & ~(DT_LEFT | DT_CENTER)); @@ -984,8 +989,7 @@ static void BUTTON_PositionRect(LONG style, const RECT *outerRect, RECT *innerRe if (!(style & BS_CENTER)) { - /* Push button's text is centered by default, all other types have left aligned text */ - if (get_button_type(style) <= BS_DEFPUSHBUTTON) + if (button_centers_text(style)) style |= BS_CENTER; else style |= BS_LEFT;
1
0
0
0
Gabriel Ivăncescu : shell32/autocomplete: Use LBS_NODATA for the dropdown listbox.
by Alexandre Julliard
03 Apr '19
03 Apr '19
Module: wine Branch: master Commit: e95dc7e03efabb786458179566d54164abc31586 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e95dc7e03efabb7864581795…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Apr 2 14:28:16 2019 +0300 shell32/autocomplete: Use LBS_NODATA for the dropdown listbox. This eliminates the overhead of populating the listbox completely and simplifies the code. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/autocomplete.c | 63 +++++++++++++++++---------------------------- 1 file changed, 23 insertions(+), 40 deletions(-) diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c index 3fde1e4..f0777ff 100644 --- a/dlls/shell32/autocomplete.c +++ b/dlls/shell32/autocomplete.c @@ -399,16 +399,11 @@ static BOOL select_item_with_return_key(IAutoCompleteImpl *ac, HWND hwnd) INT sel = SendMessageW(hwndListBox, LB_GETCURSEL, 0, 0); if (sel >= 0) { - UINT len = SendMessageW(hwndListBox, LB_GETTEXTLEN, sel, 0); - if ((text = heap_alloc((len + 1) * sizeof(WCHAR)))) - { - len = SendMessageW(hwndListBox, LB_GETTEXT, sel, (LPARAM)text); - set_text_and_selection(ac, hwnd, text, 0, len); - hide_listbox(ac, hwndListBox, TRUE); - ac->no_fwd_char = '\r'; /* RETURN char */ - heap_free(text); - return TRUE; - } + text = ac->listbox_strs[sel]; + set_text_and_selection(ac, hwnd, text, 0, strlenW(text)); + hide_listbox(ac, hwndListBox, TRUE); + ac->no_fwd_char = '\r'; /* RETURN char */ + return TRUE; } } hide_listbox(ac, hwndListBox, TRUE); @@ -417,6 +412,9 @@ static BOOL select_item_with_return_key(IAutoCompleteImpl *ac, HWND hwnd) static LRESULT change_selection(IAutoCompleteImpl *ac, HWND hwnd, UINT key) { + WCHAR *msg; + UINT len; + INT count = SendMessageW(ac->hwndListBox, LB_GETCOUNT, 0, 0); INT sel = SendMessageW(ac->hwndListBox, LB_GETCURSEL, 0, 0); if (key == VK_PRIOR || key == VK_NEXT) @@ -457,21 +455,11 @@ static LRESULT change_selection(IAutoCompleteImpl *ac, HWND hwnd, UINT key) sel = ((sel + 1) >= count) ? -1 : sel + 1; SendMessageW(ac->hwndListBox, LB_SETCURSEL, sel, 0); - if (sel >= 0) - { - WCHAR *msg; - UINT len = SendMessageW(ac->hwndListBox, LB_GETTEXTLEN, sel, 0); - if (!(msg = heap_alloc((len + 1) * sizeof(WCHAR)))) - return 0; - len = SendMessageW(ac->hwndListBox, LB_GETTEXT, sel, (LPARAM)msg); - set_text_and_selection(ac, hwnd, msg, len, len); - heap_free(msg); - } - else - { - UINT len = strlenW(ac->txtbackup); - set_text_and_selection(ac, hwnd, ac->txtbackup, len, len); - } + + msg = (sel >= 0) ? ac->listbox_strs[sel] : ac->txtbackup; + len = strlenW(msg); + set_text_and_selection(ac, hwnd, msg, len, len); + return 0; } @@ -597,9 +585,7 @@ static BOOL display_matching_strs(IAutoCompleteImpl *ac, WCHAR *text, UINT len, SendMessageW(ac->hwndListBox, LB_RESETCONTENT, 0, 0); ac->listbox_strs = str + start; - SendMessageW(ac->hwndListBox, LB_INITSTORAGE, end - start, 0); - for (; start < end; start++) - SendMessageW(ac->hwndListBox, LB_INSERTSTRING, -1, (LPARAM)str[start]); + SendMessageW(ac->hwndListBox, LB_SETCOUNT, end - start, 0); show_listbox(ac); SendMessageW(ac->hwndListBox, WM_SETREDRAW, TRUE, 0); @@ -860,7 +846,7 @@ static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, { IAutoCompleteImpl *This = (IAutoCompleteImpl *)GetWindowLongPtrW(hwnd, GWLP_USERDATA); WCHAR *msg; - int sel, len; + INT sel; switch (uMsg) { case WM_MOUSEACTIVATE: @@ -873,13 +859,9 @@ static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, sel = SendMessageW(hwnd, LB_GETCURSEL, 0, 0); if (sel < 0) return 0; - len = SendMessageW(hwnd, LB_GETTEXTLEN, sel, 0); - if (!(msg = heap_alloc((len + 1) * sizeof(WCHAR)))) - return 0; - len = SendMessageW(hwnd, LB_GETTEXT, sel, (LPARAM)msg); - set_text_and_selection(This, This->hwndEdit, msg, 0, len); + msg = This->listbox_strs[sel]; + set_text_and_selection(This, This->hwndEdit, msg, 0, strlenW(msg)); hide_listbox(This, hwnd, TRUE); - heap_free(msg); return 0; } return CallWindowProcW(This->wpOrigLBoxProc, hwnd, uMsg, wParam, lParam); @@ -918,7 +900,7 @@ static void create_listbox(IAutoCompleteImpl *This) /* FIXME : The listbox should be resizable with the mouse. WS_THICKFRAME looks ugly */ This->hwndListBox = CreateWindowExW(WS_EX_NOACTIVATE, WC_LISTBOXW, NULL, - WS_CHILD | WS_VISIBLE | WS_VSCROLL | LBS_HASSTRINGS | LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT, + WS_CHILD | WS_VISIBLE | WS_VSCROLL | LBS_NODATA | LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT, 0, 0, 0, 0, This->hwndListBoxOwner, NULL, shell32_hInstance, NULL); if (This->hwndListBox) { @@ -1259,11 +1241,12 @@ static HRESULT WINAPI IAutoCompleteDropDown_fnGetDropDownStatus( sel = SendMessageW(This->hwndListBox, LB_GETCURSEL, 0, 0); if (sel >= 0) { - DWORD len; + WCHAR *str = This->listbox_strs[sel]; + size_t size = (strlenW(str) + 1) * sizeof(*str); - len = SendMessageW(This->hwndListBox, LB_GETTEXTLEN, sel, 0); - *ppwszString = CoTaskMemAlloc((len+1)*sizeof(WCHAR)); - SendMessageW(This->hwndListBox, LB_GETTEXT, sel, (LPARAM)*ppwszString); + if (!(*ppwszString = CoTaskMemAlloc(size))) + return E_OUTOFMEMORY; + memcpy(*ppwszString, str, size); } else *ppwszString = NULL;
1
0
0
0
Gabriel Ivăncescu : shell32/autocomplete: Use an owner-drawn listbox for the dropdown.
by Alexandre Julliard
03 Apr '19
03 Apr '19
Module: wine Branch: master Commit: 0cd95038aff9163a8e07316aa749e426f2342fa0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0cd95038aff9163a8e07316a…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Apr 2 14:28:15 2019 +0300 shell32/autocomplete: Use an owner-drawn listbox for the dropdown. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/autocomplete.c | 72 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 68 insertions(+), 4 deletions(-) diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c index 6abc3a48..3fde1e4 100644 --- a/dlls/shell32/autocomplete.c +++ b/dlls/shell32/autocomplete.c @@ -61,6 +61,7 @@ typedef struct BOOL enabled; UINT enum_strs_num; WCHAR **enum_strs; + WCHAR **listbox_strs; HWND hwndEdit; HWND hwndListBox; HWND hwndListBoxOwner; @@ -296,7 +297,6 @@ static void show_listbox(IAutoCompleteImpl *ac) UINT cnt, width, height; GetWindowRect(ac->hwndEdit, &r); - SendMessageW(ac->hwndListBox, LB_CARETOFF, 0, 0); /* Windows XP displays 7 lines at most, then it uses a scroll bar */ cnt = SendMessageW(ac->hwndListBox, LB_GETCOUNT, 0, 0); @@ -307,6 +307,60 @@ static void show_listbox(IAutoCompleteImpl *ac) SWP_SHOWWINDOW | SWP_NOACTIVATE); } +static void set_listbox_font(IAutoCompleteImpl *ac, HFONT font) +{ + /* We have to calculate the item height manually due to owner-drawn */ + HFONT old_font = NULL; + UINT height = 16; + HDC hdc; + + if ((hdc = GetDCEx(ac->hwndListBox, 0, DCX_CACHE))) + { + TEXTMETRICW metrics; + if (font) old_font = SelectObject(hdc, font); + if (GetTextMetricsW(hdc, &metrics)) + height = metrics.tmHeight; + if (old_font) SelectObject(hdc, old_font); + ReleaseDC(ac->hwndListBox, hdc); + } + SendMessageW(ac->hwndListBox, WM_SETFONT, (WPARAM)font, FALSE); + SendMessageW(ac->hwndListBox, LB_SETITEMHEIGHT, 0, height); +} + +static BOOL draw_listbox_item(IAutoCompleteImpl *ac, DRAWITEMSTRUCT *info, UINT id) +{ + COLORREF old_text, old_bk; + HDC hdc = info->hDC; + UINT state; + WCHAR *str; + + if (info->CtlType != ODT_LISTBOX || info->CtlID != id || + id != (UINT)GetWindowLongPtrW(ac->hwndListBox, GWLP_ID)) + return FALSE; + + if ((INT)info->itemID < 0 || info->itemAction == ODA_FOCUS) + return TRUE; + + state = info->itemState; + if (state & ODS_SELECTED) + { + old_bk = SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT)); + old_text = SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT)); + } + + str = ac->listbox_strs[info->itemID]; + ExtTextOutW(hdc, info->rcItem.left + 1, info->rcItem.top, + ETO_OPAQUE | ETO_CLIPPED, &info->rcItem, str, + strlenW(str), NULL); + + if (state & ODS_SELECTED) + { + SetBkColor(hdc, old_bk); + SetTextColor(hdc, old_text); + } + return TRUE; +} + static size_t format_quick_complete(WCHAR *dst, const WCHAR *qc, const WCHAR *str, size_t str_len) { /* Replace the first %s directly without using snprintf, to avoid @@ -541,6 +595,8 @@ static BOOL display_matching_strs(IAutoCompleteImpl *ac, WCHAR *text, UINT len, SendMessageW(ac->hwndListBox, WM_SETREDRAW, FALSE, 0); SendMessageW(ac->hwndListBox, LB_RESETCONTENT, 0, 0); + + ac->listbox_strs = str + start; SendMessageW(ac->hwndListBox, LB_INITSTORAGE, end - start, 0); for (; start < end; start++) SendMessageW(ac->hwndListBox, LB_INSERTSTRING, -1, (LPARAM)str[start]); @@ -582,7 +638,11 @@ static void autocomplete_text(IAutoCompleteImpl *ac, HWND hwnd, enum autoappend_ size = len + 1; if (!(text = heap_alloc(size * sizeof(WCHAR)))) + { + /* Reset the listbox to prevent potential crash from ResetEnumerator */ + SendMessageW(ac->hwndListBox, LB_RESETCONTENT, 0, 0); return; + } len = SendMessageW(hwnd, WM_GETTEXT, size, (LPARAM)text); if (len + 1 != size) text = heap_realloc(text, (len + 1) * sizeof(WCHAR)); @@ -781,7 +841,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, break; case WM_SETFONT: if (This->hwndListBox) - SendMessageW(This->hwndListBox, WM_SETFONT, wParam, lParam); + set_listbox_font(This, (HFONT)wParam); break; case WM_DESTROY: { @@ -833,6 +893,10 @@ static LRESULT APIENTRY ACLBoxOwnerSubclassProc(HWND hwnd, UINT uMsg, WPARAM wPa { case WM_MOUSEACTIVATE: return MA_NOACTIVATE; + case WM_DRAWITEM: + if (draw_listbox_item(This, (DRAWITEMSTRUCT*)lParam, wParam)) + return TRUE; + break; case WM_SIZE: SetWindowPos(This->hwndListBox, NULL, 0, 0, LOWORD(lParam), HIWORD(lParam), SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER | SWP_DEFERERASE); @@ -854,7 +918,7 @@ static void create_listbox(IAutoCompleteImpl *This) /* FIXME : The listbox should be resizable with the mouse. WS_THICKFRAME looks ugly */ This->hwndListBox = CreateWindowExW(WS_EX_NOACTIVATE, WC_LISTBOXW, NULL, - WS_CHILD | WS_VISIBLE | WS_VSCROLL | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT, + WS_CHILD | WS_VISIBLE | WS_VSCROLL | LBS_HASSTRINGS | LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT, 0, 0, 0, 0, This->hwndListBoxOwner, NULL, shell32_hInstance, NULL); if (This->hwndListBox) { @@ -869,7 +933,7 @@ static void create_listbox(IAutoCompleteImpl *This) /* Use the same font as the edit control, as it gets destroyed before it anyway */ edit_font = (HFONT)SendMessageW(This->hwndEdit, WM_GETFONT, 0, 0); if (edit_font) - SendMessageW(This->hwndListBox, WM_SETFONT, (WPARAM)edit_font, FALSE); + set_listbox_font(This, edit_font); return; }
1
0
0
0
Gabriel Ivăncescu : shell32/autocomplete: Encapsulate the listbox into an owner window.
by Alexandre Julliard
03 Apr '19
03 Apr '19
Module: wine Branch: master Commit: 6f3beaee37854f46bcb242387226156e453cd34d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6f3beaee37854f46bcb24238…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Apr 2 14:28:14 2019 +0300 shell32/autocomplete: Encapsulate the listbox into an owner window. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/autocomplete.c | 69 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 52 insertions(+), 17 deletions(-) diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c index 9e8d93c..6abc3a48 100644 --- a/dlls/shell32/autocomplete.c +++ b/dlls/shell32/autocomplete.c @@ -63,8 +63,10 @@ typedef struct WCHAR **enum_strs; HWND hwndEdit; HWND hwndListBox; + HWND hwndListBoxOwner; WNDPROC wpOrigEditProc; WNDPROC wpOrigLBoxProc; + WNDPROC wpOrigLBoxOwnerProc; WCHAR *txtbackup; WCHAR *quickComplete; IEnumString *enumstr; @@ -283,7 +285,7 @@ static void free_enum_strs(IAutoCompleteImpl *ac) static void hide_listbox(IAutoCompleteImpl *ac, HWND hwnd, BOOL reset) { - ShowWindow(hwnd, SW_HIDE); + ShowWindow(ac->hwndListBoxOwner, SW_HIDE); SendMessageW(hwnd, LB_RESETCONTENT, 0, 0); if (reset) free_enum_strs(ac); } @@ -301,7 +303,7 @@ static void show_listbox(IAutoCompleteImpl *ac) height = SendMessageW(ac->hwndListBox, LB_GETITEMHEIGHT, 0, 0) * min(cnt + 1, 7); width = r.right - r.left; - SetWindowPos(ac->hwndListBox, HWND_TOP, r.left, r.bottom + 1, width, height, + SetWindowPos(ac->hwndListBoxOwner, HWND_TOP, r.left, r.bottom + 1, width, height, SWP_SHOWWINDOW | SWP_NOACTIVATE); } @@ -338,7 +340,7 @@ static BOOL select_item_with_return_key(IAutoCompleteImpl *ac, HWND hwnd) if (!(ac->options & ACO_AUTOSUGGEST)) return FALSE; - if (IsWindowVisible(hwndListBox)) + if (IsWindowVisible(ac->hwndListBoxOwner)) { INT sel = SendMessageW(hwndListBox, LB_GETCURSEL, 0, 0); if (sel >= 0) @@ -612,8 +614,8 @@ static void destroy_autocomplete_object(IAutoCompleteImpl *ac) { ac->hwndEdit = NULL; free_enum_strs(ac); - if (ac->hwndListBox) - DestroyWindow(ac->hwndListBox); + if (ac->hwndListBoxOwner) + DestroyWindow(ac->hwndListBoxOwner); IAutoComplete2_Release(&ac->IAutoComplete2_iface); } @@ -627,7 +629,7 @@ static LRESULT ACEditSubclassProc_KeyDown(IAutoCompleteImpl *ac, HWND hwnd, UINT { case VK_ESCAPE: /* When pressing ESC, Windows hides the auto-suggest listbox, if visible */ - if ((ac->options & ACO_AUTOSUGGEST) && IsWindowVisible(ac->hwndListBox)) + if ((ac->options & ACO_AUTOSUGGEST) && IsWindowVisible(ac->hwndListBoxOwner)) { hide_listbox(ac, ac->hwndListBox, FALSE); ac->no_fwd_char = 0x1B; /* ESC char */ @@ -666,7 +668,7 @@ static LRESULT ACEditSubclassProc_KeyDown(IAutoCompleteImpl *ac, HWND hwnd, UINT break; case VK_TAB: if ((ac->options & (ACO_AUTOSUGGEST | ACO_USETAB)) == (ACO_AUTOSUGGEST | ACO_USETAB) - && IsWindowVisible(ac->hwndListBox) && !(GetKeyState(VK_CONTROL) & 0x8000)) + && IsWindowVisible(ac->hwndListBoxOwner) && !(GetKeyState(VK_CONTROL) & 0x8000)) { ac->no_fwd_char = '\t'; return change_selection(ac, hwnd, wParam); @@ -684,7 +686,7 @@ static LRESULT ACEditSubclassProc_KeyDown(IAutoCompleteImpl *ac, HWND hwnd, UINT if (!(ac->options & ACO_AUTOSUGGEST)) break; - if (!IsWindowVisible(ac->hwndListBox)) + if (!IsWindowVisible(ac->hwndListBoxOwner)) { if (ac->options & ACO_UPDOWNKEYDROPSLIST) { @@ -725,7 +727,9 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, case WM_KILLFOCUS: if (This->options & ACO_AUTOSUGGEST) { - if ((HWND)wParam == This->hwndListBox) break; + if (This->hwndListBoxOwner == (HWND)wParam || + This->hwndListBoxOwner == GetAncestor((HWND)wParam, GA_PARENT)) + break; hide_listbox(This, This->hwndListBox, FALSE); } @@ -737,7 +741,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, WINDOWPOS *pos = (WINDOWPOS*)lParam; if ((pos->flags & (SWP_NOMOVE | SWP_NOSIZE)) != (SWP_NOMOVE | SWP_NOSIZE) && - This->hwndListBox && IsWindowVisible(This->hwndListBox)) + This->hwndListBoxOwner && IsWindowVisible(This->hwndListBoxOwner)) show_listbox(This); break; } @@ -772,7 +776,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, ? autoappend_flag_yes : autoappend_flag_no); return ret; case WM_MOUSEWHEEL: - if ((This->options & ACO_AUTOSUGGEST) && IsWindowVisible(This->hwndListBox)) + if ((This->options & ACO_AUTOSUGGEST) && IsWindowVisible(This->hwndListBoxOwner)) return SendMessageW(This->hwndListBox, WM_MOUSEWHEEL, wParam, lParam); break; case WM_SETFONT: @@ -821,12 +825,37 @@ static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, return CallWindowProcW(This->wpOrigLBoxProc, hwnd, uMsg, wParam, lParam); } +static LRESULT APIENTRY ACLBoxOwnerSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + IAutoCompleteImpl *This = (IAutoCompleteImpl*)GetWindowLongPtrW(hwnd, GWLP_USERDATA); + + switch (uMsg) + { + case WM_MOUSEACTIVATE: + return MA_NOACTIVATE; + case WM_SIZE: + SetWindowPos(This->hwndListBox, NULL, 0, 0, LOWORD(lParam), HIWORD(lParam), + SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER | SWP_DEFERERASE); + break; + } + return CallWindowProcW(This->wpOrigLBoxOwnerProc, hwnd, uMsg, wParam, lParam); +} + static void create_listbox(IAutoCompleteImpl *This) { + This->hwndListBoxOwner = CreateWindowExW(WS_EX_NOACTIVATE, WC_STATICW, NULL, + WS_BORDER | WS_POPUP | WS_CLIPCHILDREN, + 0, 0, 0, 0, NULL, NULL, shell32_hInstance, NULL); + if (!This->hwndListBoxOwner) + { + This->options &= ~ACO_AUTOSUGGEST; + return; + } + /* FIXME : The listbox should be resizable with the mouse. WS_THICKFRAME looks ugly */ This->hwndListBox = CreateWindowExW(WS_EX_NOACTIVATE, WC_LISTBOXW, NULL, - WS_BORDER | WS_POPUP | WS_VSCROLL | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT, - 0, 0, 0, 0, NULL, NULL, shell32_hInstance, NULL); + WS_CHILD | WS_VISIBLE | WS_VSCROLL | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT, + 0, 0, 0, 0, This->hwndListBoxOwner, NULL, shell32_hInstance, NULL); if (This->hwndListBox) { HFONT edit_font; @@ -834,13 +863,19 @@ static void create_listbox(IAutoCompleteImpl *This) This->wpOrigLBoxProc = (WNDPROC) SetWindowLongPtrW( This->hwndListBox, GWLP_WNDPROC, (LONG_PTR) ACLBoxSubclassProc); SetWindowLongPtrW( This->hwndListBox, GWLP_USERDATA, (LONG_PTR)This); + This->wpOrigLBoxOwnerProc = (WNDPROC)SetWindowLongPtrW(This->hwndListBoxOwner, GWLP_WNDPROC, (LONG_PTR)ACLBoxOwnerSubclassProc); + SetWindowLongPtrW(This->hwndListBoxOwner, GWLP_USERDATA, (LONG_PTR)This); + /* Use the same font as the edit control, as it gets destroyed before it anyway */ edit_font = (HFONT)SendMessageW(This->hwndEdit, WM_GETFONT, 0, 0); if (edit_font) SendMessageW(This->hwndListBox, WM_SETFONT, (WPARAM)edit_font, FALSE); + return; } - else - This->options &= ~ACO_AUTOSUGGEST; + + DestroyWindow(This->hwndListBoxOwner); + This->hwndListBoxOwner = NULL; + This->options &= ~ACO_AUTOSUGGEST; } /************************************************************************** @@ -1148,7 +1183,7 @@ static HRESULT WINAPI IAutoCompleteDropDown_fnGetDropDownStatus( TRACE("(%p) -> (%p, %p)\n", This, pdwFlags, ppwszString); - dropped = IsWindowVisible(This->hwndListBox); + dropped = IsWindowVisible(This->hwndListBoxOwner); if (pdwFlags) *pdwFlags = (dropped ? ACDD_VISIBLE : 0); @@ -1189,7 +1224,7 @@ static HRESULT WINAPI IAutoCompleteDropDown_fnResetEnumerator( if (This->hwndEdit) { free_enum_strs(This); - if ((This->options & ACO_AUTOSUGGEST) && IsWindowVisible(This->hwndListBox)) + if ((This->options & ACO_AUTOSUGGEST) && IsWindowVisible(This->hwndListBoxOwner)) autocomplete_text(This, This->hwndEdit, autoappend_flag_displayempty); } return S_OK;
1
0
0
0
← Newer
1
...
65
66
67
68
69
70
71
...
81
Older →
Jump to page:
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
Results per page:
10
25
50
100
200