Reputation: 4221
I can add a new item for the folders right click menu
using registry:
HKEY_CLASSES_ROOT\folder\shell\Your item name
But i don't know how to set a icon for created item like this :
May somebody help me?
Upvotes: 2
Views: 3873
Reputation: 381
You should to add iconpath in this key for showing when the user clicked right button. Try to write key OpenWithProgIds, and then create value with name (path) of your application. Example for recycle:
TRegistry *key=new TRegistry(KEY_ALL_ACCESS);
key->RootKey=HKEY_LOCAL_MACHINE;
key->OpenKey("Software\\Classes\\CLSID\\{645FF040-5081-101B-9F08-00AA002F954E}\\shell", false);
key->OpenKey("Prog_name", true);
key->WriteString("Icon", ExtractFileDir(Application->ExeName)+"\\icon_prog.ico");
key->OpenKey("command", true);
key->WriteString("", ExtractFileDir(Application->ExeName)+"\\Program.exe");
key->CloseKey();
Upvotes: 1
Reputation: 5370
To create a custom context menu with an icon when clicking on a folder follow these steps:
There is a nice tool called iconviewer that you can use to examine icons in dlls. After you install it you can right click a dll, open it's properties and an extra tab with it's icons will be added to the propery pages
Upvotes: 8