C++: How do I correctly register and unregister file type associations for our application (programatically)

丶灬走出姿态 提交于 2020-01-11 06:20:08

问题


Time was when you set file associations in:

HEY_CLASSES_ROOT\<.ext>

However, that seems to be possible, but an incomplete solution anymore. There are additional associations throughout the registry. For example:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\KindMap HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Extensions

And all of the above, but by HKEY_USERS\

And Microsoft added their Set Default Associations control panel applet, which controls... what?

I'm looking for a white paper, or discussions on:

"How is a modern, Windows XP-Windows 7 compatible application written in C/C++ supposed to register and manipulate its file associations without interfering with Explorer, User-Settings, or the Default Associations cpl"

EDIT: I'm trying to further this investigation with more questions here: How to delete ProgIDs from other user accounts when uninstalling from Windows?


回答1:


Alas, this documentation still seems current, and it's all about the registry: MSDN

Maybe someone's created a nice wrapper for this? Time to hit Google...




回答2:


I believe Microsoft wants you to do this through an installation package rather than on-the-fly, since you need elevated permissions to do so.

Edit: See this previous StackOverflow question for how this might be possible.

How to change file association without UAC confirmation?



来源:https://stackoverflow.com/questions/2828637/c-how-do-i-correctly-register-and-unregister-file-type-associations-for-our-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!