?
Solved

Register a File Type with Windows

Posted on 1998-09-07
6
Medium Priority
?
178 Views
Last Modified: 2010-04-02
I've written an MFC applicaton which has it's own file type and I was wondering how to have my program register the file type with windows and assign an Icon to the file types.
Thanks
0
Comment
Question by:trip42
[X]
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
  • 4
6 Comments
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1172133
Look into the function RegisterShellFileTypes (a CWinApp function).
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1172134
I do believe it does exactly what you want.
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1172135
Also look into EnableShellOpen (also a CWinApp member function).
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 3

Expert Comment

by:gcauthon
ID: 1172136
All you have to do is create the registry keys.

HKEY_CLASSES_ROOT\.ext = appname
HKEY_CLASSES_ROOT\appname\DefaultIcon = fullpathtoapp.exe

They don't take effect until you reboot.
0
 
LVL 1

Accepted Solution

by:
VAM345 earned 200 total points
ID: 1172137
In you InitInstance() chesk for

        // Enable DDE Execute open
      EnableShellOpen();
      RegisterShellFileTypes(TRUE);

after call all
        AddDocTemplate(pDocTemplate);

If not add.


Check for correct IDR_ in you doc templetes.

Before return InitInstance add
      m_pMainWnd->DragAcceptFiles();
If you ask accept Drag&Drop of you files.

You see icon after start program.
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1172138
VAM345, I suggested using those functions in my comments.  Why did you post it as an answer?
0

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

718 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