Solved

Associating File Extentions

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

820 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