Shell extensions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Arthur Roodenburg

    #1

    Shell extensions

    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


  • Mattias Sjögren

    #2
    Re: Shell extensions

    Arthur,
    [color=blue]
    >On some machines these shellextensions do not work.[/color]

    Can you be a bit more specific about what, exactly, doesn't work? Are
    you sure the failure is related to registration?



    Mattias

    --
    Mattias Sjögren [MVP] mattias @ mvps.org

    Please reply only to the newsgroup.

    Comment

    • Arthur Roodenburg

      #3
      Re: Shell extensions

      I think it has something to do with the registration, since AddPages is not
      invoked. Strange thing is that on my development machine it actually works
      fine (since I started with the sample, I think something is registered that
      I forgot later on, but I couldn't find out what). On all other machines,
      AddPages is not invoked.

      "Mattias Sjögren" <mattias.dont.w ant.spam@mvps.o rg> wrote in message
      news:uFvtY9wfDH A.3324@TK2MSFTN GP11.phx.gbl...[color=blue]
      > Arthur,
      >[color=green]
      > >On some machines these shellextensions do not work.[/color]
      >
      > Can you be a bit more specific about what, exactly, doesn't work? Are
      > you sure the failure is related to registration?
      >
      >
      >
      > Mattias
      >
      > --
      > Mattias Sjögren [MVP] mattias @ mvps.org
      > http://www.msjogren.net/dotnet/
      > Please reply only to the newsgroup.[/color]


      Comment

      Working...