Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Registering file types - dialog-based app.

Posted on 1999-08-01
Medium Priority
Last Modified: 2013-11-20
How do I register one or more file types (*.ABC, *.XYZ) with my own dialog-based application ? I need to              extract the name of the double-clicked file, launch the program and execute a default action.

I know where to find documentation on "Manipulating the Registry" for SDI/MDI applications, but my program is dialog-based and, of course, behaves "differently".

                    Thanks in advance.

                    Pawel Tokarczuk
Question by:me618r
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

Expert Comment

ID: 1312240
The way to do this is probably to look at what an SDI/MDI app does in InitInstance and adapt that code to your situation. I think the relevent functions are... RegisterShellFileTypes, ParseCommandLine, and ProcessShellCommand.


Expert Comment

ID: 1312241
you can register your files manually by editing the file extension entry in the registry under:
create a new key: Shell\Open\command
and enter as value for command yourapp.exe "%1"
this will start your app with the doublecklicked file as parameter.
what will happen with this file must be implemented in the "ParseCommandLine()" Function.
if you want automaitc registration of file type you have implemnet all the functions mentioned by paul.


Accepted Solution

jaguar_sri earned 300 total points
ID: 1312242
Hai there
  Firstly RegisterShellFileTypes is used
only when you have a document template.
What does RegisterShellFileTypes() do?
It uses a flag that registration should
 be done and then registers all the file
 extensions provided either in the string
 table or when using appwizard.
So if you dont use a doc template then you
 cannot use it.

Same is the case with
ParseCommandLine and ProcessShellCommand.

For  a dialog based application if you
are not using any documents then only way
 is to write your own
modules to register the file types using
various functions like WriteProfileString etc.


Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

715 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