Setting an application as Default for certain file types

Posted on 2003-03-27
Medium Priority
Last Modified: 2013-11-20
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 :))


Question by:RAVID
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 48

Accepted Solution

AlexFM earned 800 total points
ID: 8217790
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).
LVL 10

Expert Comment

ID: 9952777
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.


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question