如何在“打开方式...”中获得更好的程序标题?
我正在向注册表添加文件关联,以便“打开方式”右键单击菜单将显示我的程序。为了简单起见,假设我的程序是“MyTextEditor.exe”,并且它对 .txt 文件进行操作。因此,我将这些键和值添加到注册表中:
HKCR\.txt\OpenWithProgids\MyTextEditor.txt (no value)
HKCR\MyTextEditor.txt "Text file"
HKCR\MyTextEditor.txt\shell\open\command "C:\Program Files (x86)\MyTextEditor\MyTextEditor.exe" "%1"
添加这些键后,如果我右键单击 .txt 文件并选择“打开方式”菜单: 我会看到一个类似
- Microsoft Office Word
- mytexteditor.exe
- Notepad
- Notepad++ 的列表:免费(GNU)源代码编辑器
- 写字板
但是,我真的希望在菜单中看到一些更好的标题,例如“My Wonderful Text Editor”,而不仅仅是“mytexteditor.exe”。
那么更好读的程序标题如何进入“打开方式”菜单呢?
如果我在注册表中搜索“打开方式”中看到的程序标题,我只能在各种 MuiCache 条目中找到诸如“Microsoft Office Word”和“Notepad++:免费(GNU)源代码编辑器”之类的字符串。我的印象是我不会直接向 MuiCache 添加内容。
(可能是不相关的细节,但无论如何我都会提到它们:我使用 Inno Setup 作为注册表项,并且该程序是由 launch4j 创建的包装器。)
I am adding a file association to the registry so that the "Open with" right-click menu will show my program. To simplify, suppose my program is "MyTextEditor.exe", and it operates on .txt files. So I add these keys and values to the registry:
HKCR\.txt\OpenWithProgids\MyTextEditor.txt (no value)
HKCR\MyTextEditor.txt "Text file"
HKCR\MyTextEditor.txt\shell\open\command "C:\Program Files (x86)\MyTextEditor\MyTextEditor.exe" "%1"
After these keys are added, if I right-click on a .txt file and choose the "Open with" menu: I see a list like
- Microsoft Office Word
- mytexteditor.exe
- Notepad
- Notepad++ : a free (GNU) source code editor
- Wordpad
However, I really want to see some nicer title like "My Wonderful Text Editor" in the menu, not just "mytexteditor.exe".
So how do the nicer more readable program titles get into the "Open with" menu?
If I search the registry for program titles I see in "Open with", I only find strings like "Microsoft Office Word" and "Notepad++ : a free (GNU) source code editor" in various MuiCache entries. My impression is that I wouldn't add things to MuiCache directly.
(Probably irrelevant details, but I'll mention them anyway: I'm using Inno Setup for the registry entries, and the program is a wrapper created by launch4j.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您唯一需要做的就是提供 VERSIONINFO 资源。 Windows 将获取 FileDescription 条目并使用它来代替“打开方式”菜单中的可执行文件的名称。
The only thing you need to do is provide a VERSIONINFO resource in your executable. Windows will take the FileDescription entry and use it instead of the executable's name in the Open With menu.