summaryrefslogtreecommitdiffstats
path: root/chrome/common/win_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common/win_util.cc')
-rw-r--r--chrome/common/win_util.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/common/win_util.cc b/chrome/common/win_util.cc
index 9655478..f664cfb 100644
--- a/chrome/common/win_util.cc
+++ b/chrome/common/win_util.cc
@@ -242,8 +242,10 @@ void ShowItemInFolder(const std::wstring& full_path) {
// 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 std::wstring& full_path, bool ask_for_app) {
- HINSTANCE h = ::ShellExecuteW(NULL, NULL, full_path.c_str(), NULL,
- NULL, SW_SHOWNORMAL);
+ HINSTANCE h = ::ShellExecuteW(
+ NULL, NULL, full_path.c_str(), NULL,
+ file_util::GetDirectoryFromPath(full_path).c_str(), SW_SHOWNORMAL);
+
LONG_PTR error = reinterpret_cast<LONG_PTR>(h);
if (error > 32)
return true;