| Index: ui/base/win/shell.cc
|
| diff --git a/ui/base/win/shell.cc b/ui/base/win/shell.cc
|
| index 29efce8f7966f34e49deb49c19141d1400995c48..b58a72909d3dd624187fc2dee6088f9d23843549 100644
|
| --- a/ui/base/win/shell.cc
|
| +++ b/ui/base/win/shell.cc
|
| @@ -77,18 +77,22 @@ void SetAppIdAndIconForWindow(const string16& app_id,
|
|
|
| // Open an item via a shell execute command. Error code checking and casting
|
| // explanation: http://msdn2.microsoft.com/en-us/library/ms647732.aspx
|
| -bool OpenItemViaShell(const FilePath& full_path) {
|
| - HINSTANCE h = ::ShellExecuteW(
|
| - NULL, NULL, full_path.value().c_str(), NULL,
|
| - full_path.DirName().value().c_str(), SW_SHOWNORMAL);
|
| -
|
| - LONG_PTR error = reinterpret_cast<LONG_PTR>(h);
|
| - if (error > 32)
|
| +bool OpenItemViaShell(const FilePath& full_path,
|
| + base::ProcessHandle* process_handle) {
|
| + SHELLEXECUTEINFO sei = { sizeof(sei) };
|
| + if (process_handle)
|
| + sei.fMask = SEE_MASK_NOCLOSEPROCESS;
|
| + sei.nShow = SW_SHOWNORMAL;
|
| + sei.lpVerb = NULL;
|
| + sei.lpFile = full_path.value().c_str();
|
| + sei.lpDirectory = full_path.DirName().value().c_str();
|
| + if (::ShellExecuteExW(&sei)) {
|
| + process_handle = sei.hProcess;
|
| return true;
|
| -
|
| + }
|
| + LONG_PTR error = reinterpret_cast<LONG_PTR>(sei.hInstApp);
|
| if ((error == SE_ERR_NOASSOC))
|
| return OpenItemWithExternalApp(full_path.value());
|
| -
|
| return false;
|
| }
|
|
|
|
|