Solved

Associating File Extentions

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
This video discusses moving either the default database or any database to a new volume.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now