How is it possible to create a custom extension in C++? I know it can be rather easily achieved in C#, but I have yet to see something like this done in C++.
Well, what I mean is something like, how I can write something so that, if I have a file .xyz and a program that read .xyz files, Windows opens them up automatically?
Take a look at http://msdn.microsoft.com/en-us/library/windows/desktop/ff513920(v=vs.85).aspx . You clearly want to know about Windows, so the fact it’s different for every OS doesn’t matter much.
There are several parts to this. First, you need to write code that implements some specific COM interfaces. Then, you put entries in the registry that tell Windows where to find the code you have written. Depending on your needs, that might just be to launch your app and open the file, but it might also include the thumbnail that Windows Explorer shows in tile view (word docs and .txt files all look the same, but jpgs have a thumbnail that’s the mini image), the preview that Windows Explorer can show on the side, custom properties and so on. All of these involve an interaction between the shell and your application, through COM interfaces that you implement, and that the shell calls because it sees in the registry that you have written them.