Hello,
I built property page shellextensions , based on the DependencyWalke r sample
from Microsoft.
On some machines these shellextensions do not work. I implemented it like
this (consider the registration code):
[Guid("CB262AEB-CD12-40f6-9712-F0956048B080"), ComVisible(true )]
public class ExtensionHandle r : IShellExtInit, IShellPropSheet Ext
{
//implementation of Addhandler, etc
//Registration
[System.Runtime. InteropServices .ComRegisterFun ctionAttribute( )]
static void RegisterServer( String str1)
{
RegistryKey root = Registry.LocalM achine;
RegistryKey rk;
// For WINNT set me as an approved shellex
rk =
root.OpenSubKey ("Software\\Mic rosoft\\Windows \\CurrentVersio n\\Shell
Extensions\\App roved", true);
rk.SetValue(gui d, "My Shell Extensions");
rk.Close();
root.Close();
root = Registry.Classe sRoot;
string subKey =
"dllfile\\Shell ex\\PropertyShe etHandlers\\MyS hellExtensions" ;
rk = root.CreateSubK ey(subKey);
rk.SetValue("", guid);
rk.Close();
root.Close();
}
I made an install program like this:
System.Runtime. InteropServices .RegistrationSe rvices regservice = new
System.Runtime. InteropServices .RegistrationSe rvices();
Assembly asm = Assembly.LoadFr om("XshellExten sions.dll");
regservice.Regi sterAssembly(as m, AssemblyRegistr ationFlags.SetC odeBase );
Which registers the assembly. I am also putting the assembly into the GAC.
My questions are: How do I exactly register the shellextensions correctly?
What is missing, and can I find any documentation about this topic?
Thanks in advance,
Arthur
I built property page shellextensions , based on the DependencyWalke r sample
from Microsoft.
On some machines these shellextensions do not work. I implemented it like
this (consider the registration code):
[Guid("CB262AEB-CD12-40f6-9712-F0956048B080"), ComVisible(true )]
public class ExtensionHandle r : IShellExtInit, IShellPropSheet Ext
{
//implementation of Addhandler, etc
//Registration
[System.Runtime. InteropServices .ComRegisterFun ctionAttribute( )]
static void RegisterServer( String str1)
{
RegistryKey root = Registry.LocalM achine;
RegistryKey rk;
// For WINNT set me as an approved shellex
rk =
root.OpenSubKey ("Software\\Mic rosoft\\Windows \\CurrentVersio n\\Shell
Extensions\\App roved", true);
rk.SetValue(gui d, "My Shell Extensions");
rk.Close();
root.Close();
root = Registry.Classe sRoot;
string subKey =
"dllfile\\Shell ex\\PropertyShe etHandlers\\MyS hellExtensions" ;
rk = root.CreateSubK ey(subKey);
rk.SetValue("", guid);
rk.Close();
root.Close();
}
I made an install program like this:
System.Runtime. InteropServices .RegistrationSe rvices regservice = new
System.Runtime. InteropServices .RegistrationSe rvices();
Assembly asm = Assembly.LoadFr om("XshellExten sions.dll");
regservice.Regi sterAssembly(as m, AssemblyRegistr ationFlags.SetC odeBase );
Which registers the assembly. I am also putting the assembly into the GAC.
My questions are: How do I exactly register the shellextensions correctly?
What is missing, and can I find any documentation about this topic?
Thanks in advance,
Arthur
Comment