Solved

Associating File Extentions

Posted on 1997-05-05
4
284 Views
Last Modified: 2010-04-06
How do I associate a file extention with my application in windows 95?

Example:
BMP is associated with Paint.exe.
when you double click on a *.bmp image, paint is launched with the corrosponding bmp loaded.

I would like to associate the extention *.USER with my application.
0
Comment
Question by:sleach
[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
  • 3
4 Comments
 
LVL 2

Accepted Solution

by:
javiertb earned 50 total points
ID: 1335937
Is this a Delphi question or a win95 one?

I guess it's the second one. Just Shift+RightClick on your *.USER  file and the select 'Open With...' . Finally select the application you want to be called everytime you click on a *.USER file.

Programatically it would look something like this:
 
ShellExecute(0,'Open','c:\apppath\yourAPPLICATION.exe',              'c:\filepath\file.USER','c:\apppath',SW_MAXIMIZE);
 


0
 
LVL 2

Expert Comment

by:gysbert1
ID: 1335938
I Assume you want your program to do the association automatically upon install.

I wouldn't say javiertb's method is te best way to do this. It is definitely not the CORRECT way.

You should make an entry in the system registry to associate files in Win95. You could also check if your extention is already associated with something else and then change that if you want.

javiertb's method will not work with .bmp for example since it is associated with another program already !

Drop me a comment if you need help doing this ...
0
 
LVL 2

Expert Comment

by:javiertb
ID: 1335939
I know it's not quite the CORRECT way but I didn't exactly know what you were trying to do.
If you want to change the registry by code to enable it to open your files, you will have to create two entries :

- HKEY_CLASSES_ROOT\.USER  --> (Default)= myextension
- HKEY_CLASSES_ROOT\Shell\Open\Command --> (Default) =                                            c:\path\myfile.exe %1

You'll be able to do this via TRegistry component. Look up delphi online help.  

0
 
LVL 2

Expert Comment

by:javiertb
ID: 1335940
Ooops, mistake:

the second key should be

- HKEY_CLASSES_ROOT\myextension\Shell\Open\Command -->
  (Default) = c:\path\myfile.exe %1
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…

710 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