
Edit: Actually, I'm wrong on that. Win"10" doesn't work properly either, in more ways than one.

Moderators: fgagnon, nikos, Site Mods
Code: Select all
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications]
"SevenZipFolder"="Software\\SevenZipFolder\\Capabilities"
[HKEY_LOCAL_MACHINE\SOFTWARE\SevenZipFolder]
"Path64"="C:\\tools\\7zNSE\\"
[HKEY_LOCAL_MACHINE\SOFTWARE\SevenZipFolder\Capabilities]
"ApplicationDescription"="browse archives supported by 7zip like ZipFolders"
"ApplicationName"="SevenZipFolder"
"ApplicationIcon"="C:\\tools\\7zNSE\\SevenZipFolder.dll,0"
[HKEY_LOCAL_MACHINE\SOFTWARE\SevenZipFolder\Capabilities\FileAssociations]
".7z"="SevenZipFolder"
".arj"="SevenZipFolder"
".dmg"="SevenZipFolder"
".gz"="SevenZipFolder"
".gzip"="SevenZipFolder"
".hfs"="SevenZipFolder"
".iso"="SevenZipFolder"
".lha"="SevenZipFolder"
".lzh"="SevenZipFolder"
".lzma"="SevenZipFolder"
".rar"="SevenZipFolder"
".swm"="SevenZipFolder"
".tar"="SevenZipFolder"
".taz"="SevenZipFolder"
".tbz"="SevenZipFolder"
".tbz2"="SevenZipFolder"
".tgz"="SevenZipFolder"
".tpz"="SevenZipFolder"
".txz"="SevenZipFolder"
".wim"="SevenZipFolder"
".xar"="SevenZipFolder"
".z"="SevenZipFolder"
[HKEY_LOCAL_MACHINE\SOFTWARE\SevenZipFolder\DefaultIcon]
@="C:\\tools\\7zNSE\\SevenZipFolder.dll,0"
Code: Select all
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
[ClassInterface(ClassInterfaceType.None)]
[ComImport]
[Guid("1968106d-f3b5-44cf-890e-116fcb9ecef1")]
[TypeLibType(TypeLibTypeFlags.FCanCreate)]
internal sealed class ApplicationAssociationRegistrationUI : IApplicationAssociationRegistrationUI
{
[MethodImpl(MethodImplOptions.InternalCall)]
public extern void LaunchAdvancedAssociationUI(string appRegistryName);
}
[CoClass(typeof(ApplicationAssociationRegistrationUI))]
[ComImport]
[Guid("1f76a169-f994-40ac-8fc8-0959e8874710")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[TypeLibImportClass(typeof(ApplicationAssociationRegistrationUI))]
internal interface IApplicationAssociationRegistrationUI
{
void LaunchAdvancedAssociationUI([MarshalAs(UnmanagedType.LPWStr)] string appRegistryName);
}
static class Program
{
static void Main(string[] args)
{
var assocUI = new ApplicationAssociationRegistrationUI();
try
{
assocUI.LaunchAdvancedAssociationUI("SevenZipFolder");
}
catch
{
// Exceptions here typically mean the ProgID is not registered correctly.
}
finally
{
Marshal.ReleaseComObject(assocUI);
}
}
}
}
Actually, that's not true (trust MSDN to get their own docs wrong again) - despite it saying:FrizzleFry wrote:Apparently this has changed in Windows 10 though... you wont get the set defaults dialog but some pop-up message...
Actually invoking ApplicationAssociationRegistrationUI seems to bring up the appropriate association checkbox settings dialog, not a simple information message...Starting in Windows 10 Insider Preview, 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
Code: Select all
Local Const $CLSID_AARUI = "{1968106d-f3b5-44cf-890e-116fcb9ecef1}"
Local Const $IID_IAARUI = "{1f76a169-f994-40ac-8fc8-0959e8874710}"
Local Const $sTagIAARUI = "LaunchAdvancedAssociationUI hresult(wstr)"
Local $oApplicationAssociationRegistrationUI = ObjCreateInterface($CLSID_AARUI, $IID_IAARUI, $sTagIAARUI)
$oApplicationAssociationRegistrationUI.LaunchAdvancedAssociationUI("SevenZipFolder")
Are we allowed to place bets against you succeeding? Or would that be too honest and disrespectful at the same time? Considering you've been doing outdoor plumbing all day while the rest of us have actually created a working solution to a problem you couldn't even reproduce at first, my Sceptical-O-Meter is bobbing off the charts.nikos wrote:...and then all the other associations are not required.