Reputation: 2534
Context & What I've Done
I am attempting to learn how to write shell extensions for Windows, however the process isn't very well documented and information for beginners is scarce. From what I've read, this guide is posted everywhere as one of the best beginner tutorials to windows shell extensions. I have followed the tutorial to the end, but I had to make a few adjustments to avoid some conflicts:
win32
to x64
, but there could be more steps that I don't know about.guidgen.exe
, which comes with Visual Studio 2012, to generate a GUID for me.My project compiles successfully, and I can start it by terminating explorer.exe
(ctrl+shift+rightclick on start menu, select Exit Explorer
) and compiling/running my project in release mode (which then starts another instance of explorer.exe
).
Problem
The issue is that the CLSID value does not get written in regedit.exe
when executing the program (although txtfile
registry location does get updated). Additionally, none of the program hooks work, which is to be expected if the CLSID isn't getting registered. I wish I could narrow down the problem a bit more rather than just say "Help; it doesn't work!" but I honestly have no idea what I can do to further pinpoint the problem. I am almost certain something is wrong with my SimpleShlExt.rgs
file, however the guide doesn't offer much information on this crucial step regarding the *.rgs
file (other than some off-topic banter)
SimpleShlExt.rgs
file?!?!?Code
For additional information, I've posted the relevant code below. It is nearly identical to the guide referenced above (but has a different GUID). I can post my SimpleShlExt.cpp
and SimpleShlExt.h
if requested, however it is pretty much identical to the guide and I'm not sure that it adds any useful information.
SimpleShlExt.rgs (CLSID was generated with guidgen.exe
)
HKCR
{
NoRemove CLSID
{
ForceRemove {E2D6660C-E3E5-43CE-BF24-44D4269EEC1C} = s 'SimpleShlExt Class'
{
InprocServer32 = s '%MODULE%'
{
val ThreadingModel = s 'Apartment'
}
}
}
}
HKCR
{
NoRemove txtfile
{
NoRemove ShellEx
{
NoRemove ContextMenuHandlers
{
ForceRemove SimpleShlExt = s '{E2D6660C-E3E5-43CE-BF24-44D4269EEC1C}'
}
}
}
}
Upvotes: 1
Views: 644
Reputation: 2534
This was a long time ago, but I just realized that I left this hanging. I went back to using the example's CLSID and it worked just fine. I found several other files that define the CLSID which were then mismatched with the ones that I generated with guidgen.exe
. For instance, the tutorial doesn't really mention SimpleExt.h
which also has CLSID information registered in it. In order to change the CLSID, you'd have to seek out all the spots that it show up in.
Upvotes: 1