[PATCH 0/1] MR9998: shell32: ShellExecute uses SW_SHOWDEFAULT by default
This patch applies to applications that launch processes via ShellDispatch without specifying a show mode (such as WPS PDF Editor). When no show parameter is specified, VT_EMPTY is converted to the integer 0 (i.e., SW_HIDE), causing the main window to be hidden by default. This behavior is now adjusted to use the default show mode. The modification references Microsoft’s official description of the IShellDispatch2.ShellExecute interface: "If this parameter is not specified, the application uses its default value." -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9998
From: zhoufan <zhoufan@uniontech.com> --- dlls/shell32/shelldispatch.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/dlls/shell32/shelldispatch.c b/dlls/shell32/shelldispatch.c index 06b853ca3dc..e1234c0c36b 100644 --- a/dlls/shell32/shelldispatch.c +++ b/dlls/shell32/shelldispatch.c @@ -2400,7 +2400,7 @@ static HRESULT WINAPI ShellDispatch_ShellExecute(IShellDispatch6 *iface, { VARIANT args_str, dir_str, op_str, show_int; WCHAR *args = NULL, *dir = NULL, *op = NULL; - INT show = 0; + INT show = 10; /* use default state specified by the application*/ HINSTANCE ret; TRACE("(%s, %s, %s, %s, %s)\n", debugstr_w(file), debugstr_variant(&v_args), @@ -2421,10 +2421,14 @@ static HRESULT WINAPI ShellDispatch_ShellExecute(IShellDispatch6 *iface, if (V_VT(&op_str) == VT_BSTR) op = V_BSTR(&op_str); - VariantInit(&show_int); - VariantChangeType(&show_int, &v_show, 0, VT_I4); - if (V_VT(&show_int) == VT_I4) - show = V_I4(&show_int); + /* check if show parameter is specified*/ + if(V_VT(&v_show) != VT_EMPTY) + { + VariantInit(&show_int); + VariantChangeType(&show_int, &v_show, 0, VT_I4); + if (V_VT(&show_int) == VT_I4) + show = V_I4(&show_int); + } ret = ShellExecuteW(NULL, op, file, args, dir, show); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9998
This merge request was closed by Fan Zhou. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9998
participants (2)
-
Fan Zhou (@zhoufan_uniontech) -
zhoufan