我将尝试实现IShellIconOverlayIdentifier
设置图标覆盖的界面。
但是代码ComRegisterFunction
不起作用:
[ComRegisterFunction]
public static void Register(Type t)
{
RegistryKey rk = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\"
+ t.Name + @"\");
rk.SetValue(string.Empty, t.GUID.ToString("B").ToUpper());
rk.Close();
ShellInterop.SHChangeNotify(0x08000000, 0, IntPtr.Zero, IntPtr.Zero);
}
注册后,注册表中没有我的密钥。如果我从其他应用程序调用相同的代码,它就可以正常工作。但Regasm
没有奏效。