From 47298e25a1d22711ed5019ca5270818cee5759d4 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Thu, 18 Dec 2008 15:18:47 -0600 Subject: [PATCH] shell32: Use ShellExecuteEx instead of ShellExecute in the run dialog. --- dlls/shell32/dialogs.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/dlls/shell32/dialogs.c b/dlls/shell32/dialogs.c index 0fdc951c85e..a7f056a8492 100644 --- a/dlls/shell32/dialogs.c +++ b/dlls/shell32/dialogs.c @@ -211,19 +211,27 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR if ((ic = GetWindowTextLengthW (htxt))) { WCHAR *psz, *parent=NULL ; - LPCWSTR working_dir ; + SHELLEXECUTEINFOW sei ; + + ZeroMemory (&sei, sizeof(sei)) ; + sei.cbSize = sizeof(sei) ; psz = HeapAlloc( GetProcessHeap(), 0, (ic + 1)*sizeof(WCHAR) ); GetWindowTextW (htxt, psz, ic + 1) ; /* according to http://www.codeproject.com/KB/shell/runfiledlg.aspx we should send a * WM_NOTIFY before execution */ - if (prfdp->lpstrDirectory) - working_dir = prfdp->lpstrDirectory; - else - working_dir = parent = RunDlg_GetParentDir(psz); + sei.hwnd = hwnd; + sei.nShow = SW_SHOWNORMAL; + sei.lpFile = psz; + sei.fMask = SEE_MASK_FLAG_NO_UI; - if (ShellExecuteW(hwnd, NULL, psz, NULL, working_dir, SW_SHOWNORMAL) < (HINSTANCE)33) + if (prfdp->lpstrDirectory) + sei.lpDirectory = prfdp->lpstrDirectory; + else + sei.lpDirectory = parent = RunDlg_GetParentDir(sei.lpFile); + + if (ShellExecuteExW( &sei ) < 33) { char *pszSysMsg = NULL ; char szMsg[256];