[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

File Associations

Posted on 1998-12-04
3
Medium Priority
?
167 Views
Last Modified: 2010-04-04
How do I check the Win32-Registry for the Association of specified File Types, to see if they are assigned to my Program ?
0
Comment
Question by:omsec
[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
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
sassas081597 earned 40 total points
ID: 1349273
Here is an example of looking for assosiation.
  Uses Registry;

  With TRegistry.Create Do
  Begin
    RootKey := HKEY_Classes_Root;
    OpenKeyReadOnly('.XXX');
    ExtName := ReadString('');
    CloseKey;

    ExtName := ExtName + '\shell\open\command';
    OpenKeyReadOnly(ExtName);
    AppPath := ReadString('');
    CloseKey;

    ShowMessage(AppPath);
  End;
The AppPath is what you are looking for.
0
 
LVL 2

Author Comment

by:omsec
ID: 1349274
could you please also post a short code, to write a new association to the registry ?

XXX   = My Program File (Description of the Type)
0
 
LVL 1

Expert Comment

by:sassas081597
ID: 1349275
Here you are
const AppPath : 'C:\MyPath\...'
with TRegistry.Create do
   try
     RootKey := HKEY_Classes_Root;
     OpenKeyReadOnly('.XXX');
     ExtName := ReadString('');
     CloseKey;

     ExtName := ExtName + '\shell\open\command';
     OpenKey(ExtName,True);
     WriteString('Default', AppPath);
     CloseKey;
   finally
      Free;
   end;
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

656 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