简体   繁体   中英

C++ Shell Context Menu Extension

I try to create a context menu extension for windows files/folders. I´ve already tried very much, but nothing worked for me. I already have such an extension for 32-Bit systems, but it´s outdated. I want to recreate it using C++ for 64-Bit systems.

This one was closest to what I want to do: Klick But this is for 32-Bit systems. After reading the comments, I was able to modify&build it for x64.

Registering it using the system32/regsvr32.exe on my 64-Bit system, tells that it was successfully registered. All the registry entries are created correctly. But the menu item does not appear. I have no clue why...

Can someone help me? I can upload the project for you if you want.

UPDATE

I use the original Project from the link above and changed the following things:

1) set target to "x64"

2) since I couln't compile it, i changed the following things:

2.1) Before the includes in stdafx.h I added:

#define _ATL_NO_UUIDOF

2.2) I changed UINT to UINT_PTR here:

HRESULT CFSBankShellExtension::GetCommandString (
UINT_PTR idCmd, 
UINT uFlags, 
UINT* pwReserved,
LPSTR pszName, 
UINT cchMax )

3) I changed txtfile to * in the .rgs file, so that it should apper on all filetypes.

4) I was able to compile and register it

If you can´t help me, it would be cool if you could upload a template, that will work on x64 system.

This article might help you as it worked out for my project..

Simple shell context menu

Context menus for all files, folders, and drives

You can also hookup context menus to all files, folders, and drives by adding entries to the file type's *, Directory, and Drive registry keys. For example, XP PowerToys adds the Open Command Window Here menu to all folders with the following registry script:

REGEDIT4

[HKEY_CLASSES_ROOT\\Directory\\shell\\cmd] @="Open Command Window Here"

[HKEY_CLASSES_ROOT\\Directory\\shell\\cmd\\command] @="cmd.exe /k \\"cd %L\\""

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM