开发者

Windows Explorer Context Menu

I want to add a context menu entry with C++. I've been searching but all I can find is some jackass trying to sell me some BS program that does it for me which is not what I am looking for. I'm not looking for anything that uses .NET or Visual C++ either. I want the straight C++ way of d开发者_运维技巧oing this.


You can add a right-click menu item that just runs a program, simply by registry editing. No need to do shell extension for that. E.g. I used to have an extract icon thing (copy to clipboard),

HKEY_CLASSES_ROOT\*\shell\copyIcon\=Copy icon to clipboard
HKEY_CLASSES_ROOT\*\shell\copyIcon\command="path to the program" %1

Cheers & hth.,


A decent tutorial, ignore the jackass title, is available here. This kind of shell programming requires COM, no escaping that. Trying to write COM code without MSVC support classes is character-building. But possible, as long as you know COM really well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜