4

Possible Duplicate:
Set icon for custom right-click context menu item for all desktop shortcuts (windows explorer)

Context menu

I have successfully created the Context Menu in Windows XP and I want to add icon to context menu as shown in Figure. I've read the literature on the Context Menu but failed. Can you help me? Thank you.

private void registryMenuContextFolder(string menuName, string pathApp, string pathIcon)

{

        try
        {

            RegistryKey _key = Registry.ClassesRoot.OpenSubKey("Folder\\Shell", true);

            RegistryKey _keyFolder = _key.CreateSubKey(menuName);
            if (_keyFolder != null)
            {
                _keyFolder.SetValue("Icon",Application.ExecutablePath +",0");

            }
            RegistryKey _keyCmd = _keyFolder.CreateSubKey("Command");
            if (_keyCmd != null)
            {
                _keyCmd.SetValue("", pathApp);
            }
            _keyCmd.Close();
            _keyFolder.Close();
            _key.Close();
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }
    }
Community
  • 1
  • 1
Babyboypk
  • 55
  • 6

0 Answers0