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 MSDN:
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?
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:Changing the system default apps is no longer allowed. Here is the annoucement on the Windows Insider blog:
Even if there is some way to launch the settings application, you will not be able to do more.
To open the Set your default programs page:
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:
Version 1709 or later
To open the Set defaults by app page:
I managed to do it using UI Automation. It's not the ideal solution but it seems to work. Here is the code with comments inline: