I’m looking at writing a shell extension so when a file is clicked an action can be performed against it. (Like any other context menu :))
What is the minimum i need to insert a new Menu Item in the Context menu and perform an action against one or more files. A comparative example would be that i selected 10 files and Send to Zip.
I read that writing some unmanaged code is required but my knowledge of c++ unmanaged code is about zero so i want to do as little as possible to get the Menu item in the Windows Context Menu (File > Right Click). After that i want to call a C# console app to do the main processing, so is it possible to call a c# console app from unmanaged code?
Also, what type of visual studio project would i need to create the Windows Shell program? Which project type do i choose from:
- Win32 Console App
- MFC Application
- Win32 Project
- ATL Project
- MFC DLL
- CLR Console App
- Class Library
- Makefile Project
- MFC ActiveX Control
- Windows Forms Control Library
Cheers
This MSDN article will get you started.
Your approach of spawning a process (written in managed code) to do the actual work of the shell extension should be fine. I’d suggest just passing the selected files as command line parameters via CreateProcess.
As to the project type, you’ll be wanting to generate a Win32 dynamic link library (DLL). Under 2005, there actually is a Win32 Dll project type. With 2008 (which I infer you’re using) you should create a Win32 project, then select DLL as the application type in the resulting wizard.