Solved

File association

Posted on 2004-10-20
2
246 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
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

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 …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

808 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