Bug 1570845 - Call CoAllowSetForegroundWindow before ShellExecute to launch an application in the foreground. r=aklotz

Differential Revision: https://phabricator.services.mozilla.com/D43536

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Toshihito Kikuchi 2019-08-26 23:17:01 +00:00
Родитель 4efd4ec5d2
Коммит 651b0e2a7f
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -126,6 +126,12 @@ inline LauncherVoidResult ShellExecuteByExplorer(const _bstr_t& aPath,
return LAUNCHER_ERROR_FROM_HRESULT(hr);
}
// Passing the foreground privilege so that the shell can launch an
// application in the foreground. If CoAllowSetForegroundWindow fails,
// we continue because it's not fatal.
hr = ::CoAllowSetForegroundWindow(shellDisp, nullptr);
MOZ_ASSERT(SUCCEEDED(hr));
// shellapi.h macros interfere with the correct naming of the method being
// called on IShellDispatch2. Temporarily remove that definition.
#if defined(ShellExecute)