Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6136863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:39:20+00:00 2026-05-23T17:39:20+00:00

I know Installers can setup File Associations for your Application during the installation process,

  • 0

I know Installers can setup File Associations for your Application during the installation process, so if you have your own File types that open with your Application, it will be setup to do that, and also the associated File will have its own icon in Windows what you define.

Anyway, I would like to be able to Set/Remove the File types my Application will use, directly from the preferences form in my Application.

What methods are needed to do this, I am thinking along the lines of the Registry, but then what Keys/Values etc are we to work with, if Registry is the way to go?

Appreciate some advice and tips, It is also important that it works on XP/Vista/7.

Thanks in Advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:39:20+00:00Added an answer on May 23, 2026 at 5:39 pm

    try this unit to associate a certain extension to an exe remove the entries made in registry to unregister.

    unit utils; 
    
    interface 
    uses Registry, ShlObj, SysUtils, Windows; 
    
    procedure RegisterFileType(cMyExt, cMyFileType, cMyDescription, ExeName: string; IcoIndex: integer; DoUpdate: boolean = false); 
    
    implementation 
    
    procedure RegisterFileType(cMyExt, cMyFileType, cMyDescription, ExeName: string; IcoIndex: integer; DoUpdate: boolean = false); 
    var 
       Reg: TRegistry; 
    begin 
      Reg := TRegistry.Create; 
      try 
        Reg.RootKey := HKEY_CLASSES_ROOT; 
        Reg.OpenKey(cMyExt, True); 
        // Write my file type to it. 
        // This adds HKEY_CLASSES_ROOT\.abc\(Default) = 'Project1.FileType' 
        Reg.WriteString('', cMyFileType); 
        Reg.CloseKey; 
        // Now create an association for that file type 
        Reg.OpenKey(cMyFileType, True); 
        // This adds HKEY_CLASSES_ROOT\Project1.FileType\(Default) 
        //   = 'Project1 File' 
        // This is what you see in the file type description for 
        // the a file's properties. 
        Reg.WriteString('', cMyDescription); 
        Reg.CloseKey;    // Now write the default icon for my file type 
        // This adds HKEY_CLASSES_ROOT\Project1.FileType\DefaultIcon 
        //  \(Default) = 'Application Dir\Project1.exe,0' 
        Reg.OpenKey(cMyFileType + '\DefaultIcon', True); 
        Reg.WriteString('', ExeName + ',' + IntToStr(IcoIndex)); 
        Reg.CloseKey; 
        // Now write the open action in explorer 
        Reg.OpenKey(cMyFileType + '\Shell\Open', True); 
        Reg.WriteString('', '&Open'); 
        Reg.CloseKey; 
        // Write what application to open it with 
        // This adds HKEY_CLASSES_ROOT\Project1.FileType\Shell\Open\Command 
        //  (Default) = '"Application Dir\Project1.exe" "%1"' 
        // Your application must scan the command line parameters 
        // to see what file was passed to it. 
        Reg.OpenKey(cMyFileType + '\Shell\Open\Command', True); 
        Reg.WriteString('', '"' + ExeName + '" "%1"'); 
        Reg.CloseKey; 
        // Finally, we want the Windows Explorer to realize we added 
        // our file type by using the SHChangeNotify API. 
        if DoUpdate then SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil); 
      finally 
        Reg.Free; 
      end; 
    end; 
    
    end.
    

    Registry is defenetly the way to go with things…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how I can Dynamically create an installation package that installs files
I have a small .NET application that requires the .NET Framework 4 Client Profile.
We have written an application that manages OpenVPN from the tray as an add-on
I have created an application that writes some data to the root folder of
I have a setup and deployment project that, on our build server, reports the
I want that my application start after my setup is finished. I try to
I want to create a window based application in C# so that we can
I have a small program in python that consists in one .py file plus
I am using WIX for my application's setup project, I have to install device
So I have been writing to Environment.SpecialFolder.ApplicationData this data file, that upon uninstall needs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.