How to start to write a Windows context menu
I would like to write a context menu for Markdown files for Windows XP, when I right click on a Markdown file it should display "View in browser" option. It could use MardownSharp or Discount to convert it in HTML and show it using the default browser. I guess that building such feature shouldn't require too much knowledge of the Windows platform. My question 开发者_如何学Cis: where should I start considering the fact that I would want to write this tool without using MS Visual Studio (I would like to use opensource software)? Could it be possible to use Mono?
See this answer on how to convert Markdown to HTML. As far as adding this as a context menu, this is a built-in feature of the Windows registry:
Browse to or create the following key. This assumes the file extension is .mdml
(as I am unfamiliar with any set standard on this file format). If that's not the case, replace .mdml
with the file extension(s) you are looking for, or *
for all files, regardless of extension.
HKEY_CLASSES_ROOT\.mdml\Shell\
Browse to or create a new sub-key called something like "View in browser" and a sub-sub-key called "Command" (must be this word). In that key, modify the default to display the program and arguments to launch (e.g. C:\WINDOWS\SYSTEM32\NOTEPAD.EXE "%1"
).
You should now be able to browse to
HKEY_CLASSES_ROOT\.mdml\Shell\View in browser\Command\
and see the launch parameters in (Default)
.
精彩评论