Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

my file type

Hi all;

How can associate my file type to my application?

That is, when i double-click on the file, my application will run and do whatever is necessary with that file.

Also, how can i associate an icon with my file type? Is there something to do with registry?

Thanx in advance...

Comments

  • zibadianzibadian Posts: 6,349Member
    : Hi all;
    :
    : How can associate my file type to my application?
    :
    : That is, when i double-click on the file, my application will run and do whatever is necessary with that file.
    :
    : Also, how can i associate an icon with my file type? Is there something to do with registry?
    :
    : Thanx in advance...
    :
    You need to create two register keys, all of which are in the HKEY_CLASSES root. First you need to create key with the extension (including the dot). That key must have a standard value with a description of the file-type.
    The second key in the HKEY_CLASSES describes that file type. Inside that key you need to create a key-path called "shellopencommand", who's standard value is set to the command line, to open the file. A second subkey called "DefaultIcon" will give the icon associated with the file-type.
    A good example is the .zip file-type. Just look it up in your registry.
    Also be sure to add the necessary code to your program to handle the command line parameters.
  • _yilmaz_yilmaz Posts: 150Member
    : : Hi all;
    : :
    : : How can associate my file type to my application?
    : :
    : : That is, when i double-click on the file, my application will run and do whatever is necessary with that file.
    : :
    : : Also, how can i associate an icon with my file type? Is there something to do with registry?
    : :
    : : Thanx in advance...
    : :
    : You need to create two register keys, all of which are in the HKEY_CLASSES root. First you need to create key with the extension (including the dot). That key must have a standard value with a description of the file-type.
    : The second key in the HKEY_CLASSES describes that file type. Inside that key you need to create a key-path called "shellopencommand", who's standard value is set to the command line, to open the file. A second subkey called "DefaultIcon" will give the icon associated with the file-type.
    : A good example is the .zip file-type. Just look it up in your registry.
    : Also be sure to add the necessary code to your program to handle the command line parameters.
    :

    i have created a new key called .myf, which is the extension of my file type. Then i assigned values to (Default) and Content Type.

    But that's all i could do. I could'nt manage to associate my icon and application with the file type.
    Is there something to do with the PersistentHandler key?

    Thanx...

  • zibadianzibadian Posts: 6,349Member
    : : : Hi all;
    : : :
    : : : How can associate my file type to my application?
    : : :
    : : : That is, when i double-click on the file, my application will run and do whatever is necessary with that file.
    : : :
    : : : Also, how can i associate an icon with my file type? Is there something to do with registry?
    : : :
    : : : Thanx in advance...
    : : :
    : : You need to create two register keys, all of which are in the HKEY_CLASSES root. First you need to create key with the extension (including the dot). That key must have a standard value with a description of the file-type.
    : : The second key in the HKEY_CLASSES describes that file type. Inside that key you need to create a key-path called "shellopencommand", who's standard value is set to the command line, to open the file. A second subkey called "DefaultIcon" will give the icon associated with the file-type.
    : : A good example is the .zip file-type. Just look it up in your registry.
    : : Also be sure to add the necessary code to your program to handle the command line parameters.
    : :
    :
    : i have created a new key called .myf, which is the extension of my file type. Then i assigned values to (Default) and Content Type.
    :
    : But that's all i could do. I could'nt manage to associate my icon and application with the file type.
    : Is there something to do with the PersistentHandler key?
    :
    : Thanx...
    :
    :
    Nope. In the descriptive key you need to create a key called DefaultIcon, whose Default value is the associated icon. A nice example of this is the HKEY_CLASSES_ROOTWinZipDefaultIcon key.
Sign In or Register to comment.