如何开始编写 Windows 上下文菜单
我想为 Windows XP 的 Markdown 文件编写一个上下文菜单,当我右键单击 Markdown 文件时,它应该显示“在浏览器中查看”选项。它可以使用 MardownSharp 或 Discount 将其转换为 HTML 并使用默认浏览器显示。我想构建这样的功能不需要太多的 Windows 平台知识。我的问题是:我应该从哪里开始考虑我想在不使用 MS Visual Studio 的情况下编写这个工具(我想使用开源软件)?可以使用 Mono 吗?
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 is: 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅此答案了解如何将 Markdown 转换为 HTML。至于将其添加为上下文菜单,这是 Windows 注册表的内置功能:
浏览到或创建以下项。这假设文件扩展名是
.mdml
(因为我不熟悉此文件格式的任何设定标准)。如果情况并非如此,请将.mdml
替换为您要查找的文件扩展名,或将*
替换为所有文件,无论扩展名如何。浏览或创建一个名为“在浏览器中查看”之类的新子项和一个名为“Command”的子项(必须是这个词)。在该键中,修改默认值以显示要启动的程序和参数(例如
C:\WINDOWS\SYSTEM32\NOTEPAD.EXE "%1"
)。您现在应该能够浏览
并查看
(默认)
中的启动参数。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.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
and see the launch parameters in
(Default)
.