How to start writing a Windows shell extension?

I look at creating a shell extension, so when a file is clicked, an action can be taken against it. (Like any other context menu :))

To what extent do I need to insert a new menu item into 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 you need to write unmanaged code, but my knowledge of unmanaged C ++ code is 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 the C # console application to do the main processing, so is it possible to call the C # console application from unmanaged code?

In addition, what kind of visual studio project will I need to create a Windows Shell program? What type of project do I choose from:

  • Win32 Console Application
  • MFC app
  • Win32 Project
  • ATL Project
  • MFC DLL
  • CLR console application
  • Class library
  • Makefile project
  • MFC ActiveX Management
  • Windows Forms Management Library

Greetings

+3
source share
4 answers

This MSDN article will get you started.

Your approach to the emergence of a process (written in managed code) to do the actual work of a shell extension should be fine. I would suggest just passing the selected files as command line parameters via CreateProcess .

, Win32 (DLL). 2005 Win32 Dll. 2008 ( , ) Win32, DLL .

+5

( ), , - , , CLR , , , CLR.

, . ++, , Active Template Library (ATL).

+3

++ Windows COM, , , .

?

(. ) "" #.

, %1 .

:

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\\*\shell\SomeCmd]
@="Do Some Cmd"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\\*\shell\SomeCmd\command]
@="\"Path to your app\\YourApp.exe\" \"%1\""

%1 - . , , . , , .

+2

, .NET: http://groups.google.com/group/codefactory/web/wcf-service-and-unmanaged-c-client

, (++) Shell. #, Microsoft Explorer. codeproject ContextMenu. COM- dll, IContextMenu .

0

Source: https://habr.com/ru/post/1735690/


All Articles