shell32: Use ShellExecuteEx instead of ShellExecute in the run dialog.
This commit is contained in:
parent
5c24f70c8b
commit
47298e25a1
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue