如何为自己的应用创建一个 progId?
If you plan to associate one or more file types with a new application, you must define a ProgID for each file type that you want to associate with the application.
To create a ProgID for each unique file type that your application handles, use these steps.
Instructions
Step 1:
Note that some file types have multiple extensions that point to the same ProgID; for example:
- HKEY_CLASSES_ROOT\App.jpeg (your ProgID)
- HKEY_CLASSES_ROOT\.jpg = App.jpeg (the file type mappings)
- HKEY_CLASSES_ROOT\.jpeg = App.jpeg
Step 2:
Remove the ProgID values when you install and uninstall your program.
Step 3:
Leave the file type mappings unchanged at uninstall time. Doing so works because file type mappings are stored per user in HKEY_CLASSES_ROOT\.ext, and the system identifies the case where the ProgID value is missing and ignores it. Leaving file type mappings unchanged avoids the need to have conditional code that only removes the file type mapping if the value still points to your ProgID. It is important to avoid doing so in cases where it might have been changed by another application and you thus cannot easily remove the value.
Step 4:
Specify a unique value for the file type description of each file type ProgID by doing one of the following:
- Leave the default value of the ProgID empty, in which case the system uses the .ext file.
- Provide a localized value via FriendlyTypeName and, for compatibility with old applications that read the registry directly, be sure to provide the default value of the ProgID as the file type description (that is, use the same value that is referred to by the FriendlyTypeName in the English resource).
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
2020-04-02 c# winform 在新的应用程序域运行 wpf