473,687 Members | 3,423 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

resolve launch application to file extension from registry using C#?

When a user double clicks on file item in Windows Explorer, Windows
tries to open the document with whatever application is related to
it's file extension.

In my WinForms application I would like to be able to shell out and
launch referenced applications in this way (to simplify what I'm
trying to accomplish, let's say I'm trying to create a Windows
Explorer like application using WinForms and C# for .NET 2.0

What's the best way to go about resolving the appropriate launch
application to the document file extension? Is there a location in the
registry I can check?

Thanks.

Feb 8 '07 #1
2 6099
I discovered this is not necessary, turns on Process.Start handles it
for you:

E.g.
System.Diagnost ics.Process.Sta rt("c:\myfile.d oc")

On Feb 8, 9:51 am, "JDeats" <Jeremy.De...@g mail.comwrote:
When a user double clicks on file item in Windows Explorer, Windows
tries to open the document with whatever application is related to
it's file extension.

In my WinForms application I would like to be able to shell out and
launch referenced applications in this way (to simplify what I'm
trying to accomplish, let's say I'm trying to create a Windows
Explorer like application using WinForms and C# for .NET 2.0

What's the best way to go about resolving the appropriate launch
application to the document file extension? Is there a location in the
registry I can check?

Thanks.

Feb 8 '07 #2
Thanks for the answer to yourself, I need exactly that information!

On 8 Feb., 21:00, "JDeats" <Jeremy.De...@g mail.comwrote:
I discovered this is not necessary, turns on Process.Start handles it
for you:

E.g.
System.Diagnost ics.Process.Sta rt("c:\myfile.d oc")

On Feb 8, 9:51 am, "JDeats" <Jeremy.De...@g mail.comwrote:
When a user double clicks on file item in Windows Explorer, Windows
tries to open the document with whatever application is related to
it's file extension.
In my WinForms application I would like to be able to shell out and
launch referenced applications in this way (to simplify what I'm
trying to accomplish, let's say I'm trying to create a Windows
Explorer like application using WinForms and C# for .NET 2.0
What's the best way to go about resolving the appropriate launch
application to the document file extension? Is there a location in the
registry I can check?
Thanks.

Feb 14 '07 #3

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

Similar topics

6
2370
by: Ashok | last post by:
hi, i want to know how to make a specific type of file open in an application i developed in python when the user clicks on the file.(in windows) for eg. a .txt file when clicked opens in notepad, a .doc file when clicked opens in MS-word. In the same way i want to make a .xyz file open in the application i developed when clicked. thanks in advance for any advice.
8
5372
by: Dutchy | last post by:
Dear reader, In an attempt to obtain the path to the quick-launch-folder in order to create a shortcut to my application-updates during installation , I thought to: 1- check if quick launch is used by the user 2- check if a link to my application is there 3- if so, obtain the path (ANY PATH) to the quick-launch-folder from existing button(s)
6
2193
by: Jesper. | last post by:
Know of any good tutorials to demonstrate how to assign a file extension to an applicatiand and how to open the file in the application when you doubleclick on the file in the OS brgds Jesper.
13
4940
by: David Rose | last post by:
Hi, I am trying to launch pdf files (in this case). The test application takes the path to the pdf from a TextBox when the user clicks a button. I have written code that works on my computer, but I have doubts that my method is universal. Basically, in HKEY_CLASSES_ROOT, I look up the .pdf extension and get the human readable class id. Then I look that up, recursing through the tree until I get to "command" and then return that...
5
32732
by: GrantS | last post by:
Hi I am trying to use ShellExecute to launch an application to display a certain file. The variation on the theme is that I need to be able to specify the application to launch and not simply pass the file name (which will then result in the application associated with the file extension to launch). I want to prevent the application registered in the system as being associated with the file extension from opeing the file.
7
4072
by: Steve | last post by:
I used System.Diagnostics.Process.Start(str) to launch application. str is based on the registry setting, in registry, it might be str = rundll32.exe "%ProgramFiles%\INTERN~1\hmmapi.dll",OpenInboxHandler str = "C:\PROGRA~1\MICROS~4\OFFICE11\OUTLOOK.EXE" /recycle str = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome System.Diagnostics.Process.Start(str) can't launch with parameter, and there might be any kind of the parameter in...
8
3662
by: Paul | last post by:
I have looked and looked for this info. All the I/O examples I've found either explicity use a file name or use the OpenFileDialog. When you drag a MS Word document over MS Word, it launches and opens the document. I would like my App to launch and open a document (if it has the correct extension). What is the launch event sequence and where do I pick up the path/name of the file or files that were dropped on the application icon? Any...
2
1591
by: Peter Ignarson | last post by:
Hi there - I am writing a paint program (I am following a learning tutorial, there is no point to writing a paint program) and I want to extend it so that I can copy the contents of my drawing and paste it into Microsoft Word. Then I want to double click on the diagram in Microsoft Word and have my paint program loaded with the drawing ready for editing. For this seemingly basic functionality, is there an example out there on how to do...
5
1881
by: jmsxp | last post by:
Hi all, I am in my infancy with programming, so please forgive stupid questions... I am attempting to write a C# program that will launch Trillian (well, that is just a part of the overall program). I can get the program to start using System.Diagnostics.Process.Start(@"C:\Program Files\Trillian\trillian.exe");
0
8590
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8524
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9066
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8783
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5806
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4541
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2960
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2214
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.