Understanding File Extensions & How To Create Your Own

  • Thread starter Thread starter Pauly Man
  • Start date Start date
  • Tags Tags
    File
Click For Summary
SUMMARY

This discussion focuses on creating custom file extensions, specifically how to register a new file type such as .psh in Windows. To achieve this, developers must utilize the Windows Registry API to add the file type information into HKEY_CLASSES_ROOT. Additionally, the program must be capable of recognizing and decoding the custom file format. Resources like regedit and online tutorials are recommended for further guidance.

PREREQUISITES
  • Understanding of Windows Registry structure and HKEY_CLASSES_ROOT
  • Familiarity with Windows API, specifically Registry API functions
  • Basic programming skills to create a file handling application
  • Knowledge of file format encoding and decoding
NEXT STEPS
  • Research Windows Registry API functions for file type registration
  • Learn how to manipulate HKEY_CLASSES_ROOT using C# or C++
  • Explore tutorials on creating custom file formats and their associated applications
  • Investigate methods for setting file icons and default applications in Windows
USEFUL FOR

Software developers, particularly those interested in file handling and Windows application development, will benefit from this discussion.

Pauly Man
Messages
129
Reaction score
0
Hi guys. I have a question about file extensions.

For example, if you create a .txt file, windows seems to know automatically that it is a file that can be opened by notepad or wordpad. It gives it a specific icon, and opens it inside notepad or wordpad.

If I wanted to create a program that saved data in a file extension like .psh (my initials) I know I can do it. But exactly what do I need to code to make windows regonise the extension and give the file a particlular icon, and open up it up in my program etc?

I guess one obvious thing is that my program must be able to recognise the file type and "decode" it.
 
Computer science news on Phys.org
You need to add the filetype into the registry, which keeps track of that stuff. If you go into Tools->Folder Options->File Types you can browse the associations and enter it manually. If you want your program to do it, use the Registry API functions and put the info in HKEY_CLASSES_ROOT -- you can browse with regedit to see how it's structured, or there are plenty of online tutorials and code snippets.
 
Thanx for the info Damgo.

Once this session is over at uni I'll have to take a look around the net for some tutorials on the subject.
 

Similar threads

Replies
10
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 17 ·
Replies
17
Views
8K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 20 ·
Replies
20
Views
3K
  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 33 ·
2
Replies
33
Views
3K