File Association

This is a discussion on File Association within the Windows Programming forums, part of the Platform Specific Boards category; How can i make my application set certain files to be associated with it, like how winzip sets *.zip files ...

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    11

    File Association

    How can i make my application set certain files to be associated with it, like how winzip sets *.zip files to be opened with it by default. i think that would be much easier on the users instead of them having to use file->open every time they want to edit one of my apps files.

  2. #2
    Registered User sean345's Avatar
    Join Date
    Mar 2002
    Posts
    346
    The data for file extensions is held in the registry. I do not know the location, but you should be able to find it on MSDN.

    - Sean
    If cities were built like software is built, the first woodpecker to come along would level civilization.
    Black Frog Studios

  3. #3
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    You want to put your actual extension as a key (such as .bmp or .exe) in the registry under HKEY_CLASSES_ROOT. Then put the default value as another key (also in HKEY_CLASSES_ROOT) that opens the program associated with that program. Just open up regedit and look at how other programs do it. You will understand what is going on in no time.

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 10:39 PM
  2. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 04:02 AM
  3. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 08:19 PM
  4. Hmm....help me take a look at this: File Encryptor
    By heljy in forum C Programming
    Replies: 3
    Last Post: 03-23-2002, 09:57 AM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 01:58 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21