Solved

File association

Posted on 2004-10-20
2
235 Views
Last Modified: 2010-04-23
How can I associate a data file to open with Notepad?  My program creates files with an extension *.AAA and of course Windows allows me to use it with my program since it is just text data but I would like Windows to show the Notepad icon with my *.AAA files like it does with *.txt files.  Can this be done with code in a VB.NET 2002 program?  A good commented working example would be great.  Simple answer would be to use *.txt instead of *.AAA but the name of the file is dependant on parts of my program recognizing what file to use.
0
Comment
Question by:teamdad
2 Comments
 
LVL 10

Accepted Solution

by:
heintalus earned 500 total points
Comment Utility
You can create a registry key called .AAA under HKEY_CLASSES_ROOT and set its default value to txtfile

This can be done via a VB.NET program, take a look at the following for details of writing to & reading from the registry from .Net

http://www.devcity.net/forums/faq.asp?fid=30&cat=Registry&#TID3379

I've also noticed these 2 articles which should help you

http://www.devcity.net/forums/topic.asp?tid=72258

http://www.devcity.net/forums/faq.asp?fid=15&cat=Registry&#TID72502

That last link should give you exactly what your after but the others are useful references

HTH
Andy


0
 

Author Comment

by:teamdad
Comment Utility
The class in a later post on that last link had it all without me having to retype stuff.  Great!!!!
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This video discusses moving either the default database or any database to a new volume.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now