shell32: Use ShellExecuteEx to create error dialogs for the run dialog.

This commit is contained in:
Vincent Povirk 2008-12-18 14:30:21 -06:00 committed by Alexandre Julliard
parent 47298e25a1
commit 7ef7d975e4
1 changed files with 0 additions and 15 deletions

View File

@ -224,7 +224,6 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR
sei.hwnd = hwnd; sei.hwnd = hwnd;
sei.nShow = SW_SHOWNORMAL; sei.nShow = SW_SHOWNORMAL;
sei.lpFile = psz; sei.lpFile = psz;
sei.fMask = SEE_MASK_FLAG_NO_UI;
if (prfdp->lpstrDirectory) if (prfdp->lpstrDirectory)
sei.lpDirectory = prfdp->lpstrDirectory; sei.lpDirectory = prfdp->lpstrDirectory;
@ -233,20 +232,6 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR
if (ShellExecuteExW( &sei ) < 33) if (ShellExecuteExW( &sei ) < 33)
{ {
char *pszSysMsg = NULL ;
char szMsg[256];
FormatMessageA (
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, GetLastError (),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPSTR)&pszSysMsg, 0, NULL
) ;
sprintf (szMsg, "Error: %s", pszSysMsg) ;
LocalFree ((HLOCAL)pszSysMsg) ;
MessageBoxA (hwnd, szMsg, "Nix", MB_OK | MB_ICONEXCLAMATION) ;
HeapFree(GetProcessHeap(), 0, psz); HeapFree(GetProcessHeap(), 0, psz);
HeapFree(GetProcessHeap(), 0, parent); HeapFree(GetProcessHeap(), 0, parent);
SendMessageA (htxt, CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ; SendMessageA (htxt, CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ;