开发者

How do I write shell extension context menu in C++ Builder 2010?

开发者 https://www.devze.com 2022-12-15 22:53 出处:网络
I\'m looking for some examples for writing a shell extension in C++ Builder 2010 (2007 and 2009 would also probably be relevant) so I can right click a file in Explorer and get the file path in my VCL

I'm looking for some examples for writing a shell extension in C++ Builder 2010 (2007 and 2009 would also probably be relevant) so I can right click a file in Explorer and get the file path in my VCL program.

I have followed Clayton Todd's tutorial, but it's from 2001, and I have some trouble getting it to work. I can't get it to call my methods (initialize , QueryC开发者_StackOverflowontextMenu etc.).


For many years Delphi and C++ Builder have included a sample project (in ActiveX\ShellExt) that adds a "compile" item to project files' context menus. You should start with that. Also read the MSDN discussion on how to create a context menu handler.

Overall, I recommend not using much of the VCL in your shell extension. Keep it small. All it's going to do is implement the basic IContextMenu methods and then send the file names it collects to your main program.

If you've followed the tutorial and read the documentation and some of your methods still aren't being called, then do some debugging to figure out why. Ask yourself: Which functions are being called? Is the DLL getting loaded at all?

0

精彩评论

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