Creating my own file extension

This is a discussion on Creating my own file extension within the Tech Board forums, part of the Community Boards category; What i want to know is A: how do i make a program run by double clicking an icon (as ...

  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    3

    Creating my own file extension

    What i want to know is
    A: how do i make a program run by double clicking an icon (as is normally how you activate a program), but i need to somehow attatch my program to the extension i use.
    and B: once i run the program i would need it determine the file name of the file i double clicked without me having to define it.

    The extension is for my own bitmap kind of image file (it is simpler than others and is purely for my own use), i would basicly want to start my program with the file i double click being the loaded file... just like if i were to open a text file.... its just a matter of figuring out the name of the file being opened.

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    http://msdn.microsoft.com/workshop/n...appendix_a.asp

    In HKEY_CLASSES_ROOT, you create a key that contains the extension you want. A default (empty string "") value in this key should be set to your classname "MyBmpThingy". Then, create HKEY_CLASSES_ROOT\MyBmpThingy\Shell\Open\Command and make default ("") value of "\"C:\\Path\\To\\Yr\\Prog\" \"%1\"". You will need the win32 registry api to do this, and permission to modify the registry, and special precautions taken when dealing with the registry (not liable)

    http://www.google.com/search?q=registry+api
    http://msdn.microsoft.com/library/de..._functions.asp

    Or search the internet/forum for file associations. People do this and make code for you to use and make big smiles for yoo.

    ╔╗╔╦══╦╗╔╦══╦╗
    ║╚╝║╔╗║╚╝║╔╗║║
    ║╔╗║╠╣║╔╗║╠╣╠╣
    ╚╝╚╩╝╚╩╝╚╩╝╚╩╝

    codez http://code.google.com/p/zxcvbn/

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    3
    That doesnt sound like fun, lol... but thanks for the information, i will try to see if can do that.

  4. #4
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    There are fun ways too. Just search file associations on google. That's how you'd do it programmatically. I didn't realize that this was not on the coding board, and you might want to look at these

    http://support.microsoft.com/default...307859&sd=tech

    ╔╗╔╦══╦╗╔╦══╦╗
    ║╚╝║╔╗║╚╝║╔╗║║
    ║╔╗║╠╣║╔╗║╠╣╠╣
    ╚╝╚╩╝╚╩╝╚╩╝╚╩╝

    codez http://code.google.com/p/zxcvbn/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Formatting a text file...
    By dagorsul in forum C Programming
    Replies: 12
    Last Post: 05-02-2008, 04:53 AM
  2. Formatting the contents of a text file
    By dagorsul in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2008, 01:36 PM
  3. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  4. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 04:39 AM
  5. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 08:01 PM

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