From d710c109b1ecb222e2847c624786346ab3985a0a 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 | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dlls/shell32/dialogs.c b/dlls/shell32/dialogs.c index 0fdc951..a7f056a 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 */ + sei.hwnd = hwnd; + sei.nShow = SW_SHOWNORMAL; + sei.lpFile = psz; + sei.fMask = SEE_MASK_FLAG_NO_UI; + if (prfdp->lpstrDirectory) - working_dir = prfdp->lpstrDirectory; + sei.lpDirectory = prfdp->lpstrDirectory; else - working_dir = parent = RunDlg_GetParentDir(psz); + sei.lpDirectory = parent = RunDlg_GetParentDir(sei.lpFile); - if (ShellExecuteW(hwnd, NULL, psz, NULL, working_dir, SW_SHOWNORMAL) < (HINSTANCE)33) + if (ShellExecuteExW( &sei ) < 33) { char *pszSysMsg = NULL ; char szMsg[256]; -- 1.5.6.3