473,385 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Code for associating file types

string keyName;
string keyValue;

keyName = "MyApp";
keyValue = "My App";

RegistryKey key,subkey;
key = Registry.ClassesRoot.CreateSubKey(keyName);
key.SetValue("",keyValue);
subkey = key.CreateSubKey("shell");
subkey = subkey.CreateSubKey("open");
subkey = subkey.CreateSubKey("command");
subkey.SetValue("",
System.Windows.Forms.Application.StartupPath + "\\MyApp.exe
%1");

subkey = key.CreateSubKey("DefaultIcon");
subkey.SetValue("",System.Windows.Forms.Applicatio n.StartupPath
+ "\\MyApp.exe,0");

keyName = ".bwt";
keyValue = "MyApp";
key = Registry.ClassesRoot.CreateSubKey(keyName);
key.SetValue("", keyValue);
Is this code standard for associating file types? Some of my beta
testers seem to be having problems with it. Am I missing anything?

Thanks for any help.
zerodot
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 16 '05 #1
0 1077

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Psymaster | last post by:
How could I do that? I'm writing an image viewer and I would want to associate all images to be opened with my proggie when they are double-clicked.
0
by: vpcs | last post by:
I am trying to do an invoicing software with perl - cgi. I am having a problem in associating the checkbox with the items from the database. I am giving the user option to enter the customer...
6
by: paul dallaire | last post by:
HI! I need to associate a iframe pages to a specific page for my menu system. I want to be able to click on my menu system anywhere on my site and the options that is clicked will load that...
6
by: Bill English | last post by:
How do I associate file types with my application, and use its icon? Also is there an event I can use for when my application is loaded by opening those filetypes? Ex. Open a .rtf, and I want my...
3
by: Bill English | last post by:
Jason, could you please explain to me what else I have to do? Your filename will be passed as the first argument on the command line. Check it with something like this: static void...
0
by: carl.manaster | last post by:
Hi, In <http://groups-beta.google.com/group/microsoft.public.dotnet.languages.csharp/msg/05abaf8460c61859>, back in 2003, "SleazySt" wrote that > Unfortunately, C# projects can't have...
8
by: Penny | last post by:
Hi All, I have a continuous form which shows meetings that consultants have booked for certain timeslots. The text of the field displays a short description of the appointment and I want to set...
3
by: bg_ie | last post by:
Hi, Lets say I have a TreeView with nodes that represent objects of a number of different types. Is there a way of associating the Set method of each object with its node in the TreeView? That...
2
by: blackduck603 | last post by:
Hi, I am fairly new to Access programming and Reports. I have inherited a project and am trying to understand some of the inner workings. There is a field named Overall in the Detail section of my...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.