Extending windows explorer context menu

China☆狼群 提交于 2019-12-06 15:54:35

I think I've found a solution for this one, and it goes like this - define:

    [DllImport("shell32.dll", CharSet = CharSet.Auto, SetLastError = true)]
    public static extern void SHChangeNotify(uint wEventId, uint uFlags, IntPtr dwItem1, IntPtr dwItem2);

    const uint SHCNF_IDLIST = 0x0;
    const uint SHCNE_ASSOCCHANGED = 0x08000000;

Then do your code stuff with associations when needed, and after it execute:

    SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, IntPtr.Zero, IntPtr.Zero);

Also if mentioned registry keys don't work try:

    HKEY_CLASSES_ROOT\SystemFileAssociations\extension\Shell\yourcommand
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!