Commit 47298e25 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

shell32: Use ShellExecuteEx instead of ShellExecute in the run dialog.

parent 5c24f70c
......@@ -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];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment