Since Windows 10, the IApplicationAssociationRegistrationUI::LaunchAdvancedAssociationUI
method does not work anymore.
On Windows Vista, 7 and 8, it opens the Control Panel on the Set Program Associations page for specified application.
On Windows 10, it does nothing.
It's even documented in Microsoft documentation:
Starting in Windows 10, this does not launch the association dialog box. It displays a dialog to the user informing them that they can change the default programs used to open file extensions in their Settings
(Even the second part of the statement is no longer true in the current version of Windows 10)
And actually in recent versions of Windows 10 that control panel does not exist anymore. Its functionality has been moved to a Settings app, under Apps > Default apps > Set defaults by app > [App name].
Is there a way to open the Set defaults by app screen for my application in Windows 10 Settings app programmatically?
Or is there another approach recommended for an application to allow its users to customize associations in Windows 10?
Step 1: Press Windows Key + I to open Settings and select Apps. Step 2: Go to the Default apps tab, and you'll find a list of basic default apps on your right, including email, maps, music player, photo viewer, video player, and web browser.
A default program is the program that Windows uses when you open a particular type of file, such as a music file, an image, or a webpage. For example, if you have more than one web browser installed on your computer, you can choose one of them to be the default browser.
For more information, see the section on Changes to how Windows 10 handles default apps in this post. Per-user default settings are specific to an individual user account on the system.
Open the main Default Programs window in Control Panel:
%windir%\system32\control.exe /name Microsoft.DefaultPrograms
Open the Set your default programs page:
%windir%\system32\control.exe /name Microsoft.DefaultPrograms /page pageDefaultProgram
Open the Set associations for a program page:
%windir%\system32\control.exe /name Microsoft.DefaultPrograms /page pageDefaultProgram\pageAdvancedSettings?pszAppName=YourAppRegName
YourAppRegName is name of your registered application from HKEY_LOCAL_MACHINE (or HKEY_CURRENT_USER)\SOFTWARE\RegisteredApplications that must be escaped (Use UrlEscape, Luke!) before use. For example:
%windir%\system32\control.exe /name Microsoft.DefaultPrograms /page pageDefaultProgram\pageAdvancedSettings?pszAppName=Internet%20Explorer
Open Associate a file type or protocol with a program page:
%windir%\system32\control.exe /name Microsoft.DefaultPrograms /page pageFileAssoc
Open Change AutoPlay Settings page:
%windir%\system32\control.exe /name Microsoft.AutoPlay
Open Set Program Access and Computer Defaults page:
%windir%\system32\ComputerDefaults.exe
P.S. Also you can use IOpenControlPanel::Open
method to open Control Panel item/page instead:
IOpenControlPanel * OpenControlPanel;
HRESULT Result =
CoCreateInstance(CLSID_OpenControlPanel,
NULL, CLSCTX_INPROC, __uuidof(IOpenControlPanel), (void**)&OpenControlPanel);
if (SUCCEEDED(Result))
{
const wchar_t * Page = L"pageDefaultProgram\\pageAdvancedSettings?pszAppName=YourAppRegName";
OpenControlPanel->Open(L"Microsoft.DefaultPrograms", Page, NULL);
OpenControlPanel->Release();
}
To open the Set your default programs page:
%windir%\system32\control.exe /name Microsoft.DefaultPrograms /page pageDefaultProgram
Reference: https://msdn.microsoft.com/en-us/library/windows/desktop/ee330741.aspx
Note: This method does not work with April 2018 Update.
To open the Choose default apps by file type page:
Activator->ActivateApplication(
L"windows.immersivecontrolpanel_cw5n1h2txyewy"
L"!microsoft.windows.immersivecontrolpanel",
L"page=SettingsPageAppsDefaults"
L"&target=SettingsPageAppsDefaultsFileExtensionView", AO_NONE, &pid);
Version 1709 or later
To open the Set defaults by app page:
Activator->ActivateApplication(
L"windows.immersivecontrolpanel_cw5n1h2txyewy"
L"!microsoft.windows.immersivecontrolpanel",
L"page=SettingsPageAppsDefaults"
L"&target=SettingsPageAppsDefaultsDefaultAppsListView", AO_NONE, &pid);
Changing the system default apps is no longer allowed. Here is the annoucement on the Windows Insider blog:
Changes to how Windows 10 handles default apps: ‘Default apps’ refers to the way that Windows maps file types and protocols (like HTTP) to the Windows applications they open by default. For example, your favorite photo editor may be set as the default app for .JPG files, which means that when you double-click on a .JPG file in File Explorer, it opens in that photo editor. In Windows 8.1, Classic Windows applications (Win32) could invoke the prompt asking you to change your defaults, so you may have seen multiple prompts during install and after they launched. However, Windows Store apps could not invoke this prompt. Instead, a notification banner will appear after your apps are installed telling you that new apps are available and you would click on this banner to change your defaults.
We know your defaults matter to you. With Windows 10, all apps – both Classic Windows apps and Universal Windows apps – will be unable to invoke a prompt to change your defaults, only Windows. You remain in full control of your default experiences, while reducing some of the unwanted noise that multiple prompts can bring.
Even if there is some way to launch the settings application, you will not be able to do more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With