Solved

Associating File Extentions

Posted on 1997-05-05
4
280 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
  • 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

773 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