Setting an application as Default for certain file types

Would like to open certain file types mapped to my application so that double clicking on them will cause them to be opened in my application.
I was partially succesfull by making a entry in the Registry:
"HKEY_CLASSES_ROOT\.html\shell\open\command" where I had specified my applications path.

But when the user changes the default to some other application like IE and sets the option "Always Open With", then the above settings are over rided. Hope to find a quick response :))


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

If user changed file associations there is nothing to do with this. CWinApp::RegisterShellFileTypes functions makes these associations, but it doesn't overwrite existing information:

If the registration database already associates a given filename extension with another file type, no new association is created (MSDN).

You can make necessary changes in Registry every time program is loaded (using Registry API), but I think this will not be user-friendly (Microsoft Word style: I know what you want better than you).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
in XP its control panel -> folder options -> File Types tab -> Add button.

type in the filename extension ie: A97
click ok. select the installed apllication to associate the file with from the list or use the browse button to find it. association should be immediate, no need to reboot.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.