?
Solved

File association

Posted on 2004-10-20
2
Medium Priority
?
277 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 2000 total points
ID: 12365850
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
ID: 12365940
The class in a later post on that last link had it all without me having to retype stuff.  Great!!!!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses
Course of the Month17 days, 13 hours left to enroll

831 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