/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/** * This file exists so that LaunchModernSettingsDialogDefaultApps can be called * without linking to libxul.
*/ #include"WindowsDefaultBrowser.h"
constwchar_t* format = L"%s%I64X"; int bufferSize = _scwprintf(format, APP_REG_NAME_BASE, hash);
++bufferSize; // Extra byte for terminating null
aAppRegName = mozilla::MakeUnique<wchar_t[]>(bufferSize);
_snwprintf_s(aAppRegName.get(), bufferSize, _TRUNCATE, format,
APP_REG_NAME_BASE, hash);
bool LaunchModernSettingsDialogDefaultApps() { if (mozilla::IsWin11OrLater()) { return LaunchMsSettingsProtocol();
}
if (!mozilla::IsWindows10BuildOrLater(14965) && !IsWindowsLogonConnected() &&
SettingsAppBelievesConnected()) { // Use the classic Control Panel to work around a bug of older // builds of Windows 10. return LaunchControlPanelDefaultPrograms();
}
if (SUCCEEDED(hr)) {
DWORD pid;
hr = pActivator->ActivateApplication(
L"windows.immersivecontrolpanel_cw5n1h2txyewy"
L"!microsoft.windows.immersivecontrolpanel",
L"page=SettingsPageAppsDefaults", AO_NONE, &pid); if (SUCCEEDED(hr)) { // Do not check error because we could at least open // the "Default apps" setting.
pActivator->ActivateApplication(
L"windows.immersivecontrolpanel_cw5n1h2txyewy"
L"!microsoft.windows.immersivecontrolpanel",
L"page=SettingsPageAppsDefaults"
L"&target=SystemSettings_DefaultApps_Browser",
AO_NONE, &pid);
}
pActivator->Release(); return SUCCEEDED(hr);
} returntrue;
}
¤ Dauer der Verarbeitung: 0.18 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.