| | |
Creating own file extension
Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
![]() |
Greetings.
I've done a search regarding the above subject.
I came across this page: CreateFileAssociation
I'm on my way in developing a desktop application and I need to implement my own file format to store data in the way I want it to be. I'm quite uncertain as to how should I go about first. Anyone here has any idea? How can I benefit from the content of the above link? What do I have to know before implementing this? Thanks a lot.
I've done a search regarding the above subject.
I came across this page: CreateFileAssociation
I'm on my way in developing a desktop application and I need to implement my own file format to store data in the way I want it to be. I'm quite uncertain as to how should I go about first. Anyone here has any idea? How can I benefit from the content of the above link? What do I have to know before implementing this? Thanks a lot.
"Study the past if you would define the future" - Confucius
Creating the association means that anytime someone double-clicks on a file with 'your' extension, your program will be launched and your WinMain will get the file name so you can open the file and do whatever you want with it.
So, if that's what you WANT, then this code is for you (and/or having your installer do it for you).
Pick an extension that no one else is using, or you'll have upset customers. In particular, there can be a large number of extensions for images, sounds, videos, and the like. So go to a 'fully loaded' machine with photoshop or its ilk on it, and then look in the registry under the file classes key and you'll see 50-100 extensions already there. Pick something ELSE.
An easy way to avoid these common other files is to pick an extension longer than 3 chars, though there may be compatability issues on non-windows OS', if that matters to you.
So, if that's what you WANT, then this code is for you (and/or having your installer do it for you).
Pick an extension that no one else is using, or you'll have upset customers. In particular, there can be a large number of extensions for images, sounds, videos, and the like. So go to a 'fully loaded' machine with photoshop or its ilk on it, and then look in the registry under the file classes key and you'll see 50-100 extensions already there. Pick something ELSE.
An easy way to avoid these common other files is to pick an extension longer than 3 chars, though there may be compatability issues on non-windows OS', if that matters to you.
Thanks for your feedback.
Err, the thing that is still confusing me is that piece of code provided with the link.
Is it giving me a direction? May I know what does that piece of code do?
A wild guess, it creates a registry key and set the registry key for a new extension? Does any other application with their own extension do this everytime?
Err, the thing that is still confusing me is that piece of code provided with the link.
Is it giving me a direction? May I know what does that piece of code do?
A wild guess, it creates a registry key and set the registry key for a new extension? Does any other application with their own extension do this everytime?
"Study the past if you would define the future" - Confucius
The MS File Explorer program and others like it, when coming across a file with an extension, look in the registry in a specifc location to see what program is associated with that file's extension.
This code snippet sets the registry up so that those programs can find your program. You only need to do this once at installation time.
As I say, all this does is allow someone to see your file in Explorer, double click on it, and have that run your program.
This code snippet sets the registry up so that those programs can find your program. You only need to do this once at installation time.
As I say, all this does is allow someone to see your file in Explorer, double click on it, and have that run your program.
![]() |
Similar Threads
- Creating a new file type - and creating Search function (C#)
- File extension: How to display in Hexadecimal? (Windows NT / 2000 / XP)
- Is it possible to execute programs without “.exe� file extension? (Windows Software)
- Need help w/ file extension (Windows NT / 2000 / XP)
Other Threads in the Computer Science Forum
- Previous Thread: YaBasic: The beginners choice
- Next Thread: Computer Architecture
| Thread Tools | Search this Thread |
ai algorithm algorithms amazon assignment assignmenthelp assignments automata battery bigbrother binary bittorrent bletchleypark bomb business cern codebreaker compiler computer computerscience computertrackingsoftware connect conversion csc dataanalysis dataintepretation development dfa dissertation dissertations dissertationthesis dissertationtopic ebook employment energy floatingpoint foreclosure foreclosuresoftware fuel gadgets geeks givemetehcodez government graphics hardware history homeowners homeworkassignment homeworkhelp humor ibm idea internet iphone ipod itcontracts jobs kindle laser laws lsmeans mainframes marketing mobileapplication msaccess nano netbeans networking news os p2p piracy piratebay principles rasterizer research sam-being-cute sas science software spying stephenfry study supercomputer sweden technology textfield turing turingtest two'scompliment uk virus ww2





