473,378 Members | 1,469 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,378 software developers and data experts.

How to start app by clicking file?

I'd like to start my app by double clicking a file. Via the file
extension, it should know the app to load. The file will contain
several IDs in XML, which my gets data off of and loads into a datagrid
relevant to these IDs. Here is what I'm not sure on.

1.) How does the OS or what ever is monitoring know which app to load
from the file extension?

2.) Once my app loads, how do I create an entry point to start
processing the file data?

3.) If I have three applications, three file extensions and want the
user to have a choice of which app to load (b/c certain apps can handle
multiple extensions), how is that done? I guess it would be using
steps 1 and 2 to load a little app that allows selection of the other
apps.

What is this particular topic called? I wasn't sure what to search
under.

Thanks,
Brett

Jan 25 '06 #1
5 1212
You have to register the extension of your file and the application to open it.



In the Windows Explorer : click the Menu Tools/Options and Select the "FileType" Tab.
Steph.
Jan 25 '06 #2
Hi,

"Brett Romero" <ac*****@cygen.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I'd like to start my app by double clicking a file. Via the file
extension, it should know the app to load. The file will contain
several IDs in XML, which my gets data off of and loads into a datagrid
relevant to these IDs. Here is what I'm not sure on.

1.) How does the OS or what ever is monitoring know which app to load
from the file extension?


It's stored in the registry, the file is passed as a parameter. You will
have to register that extension to your program.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Jan 25 '06 #3
How do you setup a method to capture the parameter?

Thanks,
Brett

Jan 25 '06 #4
Here's part 2:

[STAThread]
static void Main(string[] args)
{
if (args.Length > 0)
{
//open files and read contents
foreach (string filename in args)
{
//file processing
}
}
else
{
loadUser_Init();
frmMaster MainForm = new frmMaster();
System.Windows.Forms.Application.Run(MainForm);
}
}

This will also take care of #3. Another app will need to be created
that catches all relevant file executions. It gives the user options
of which app to open.

Brett

Jan 25 '06 #5
Hi,

So this will solve your problem?

Not sure of the if though, the idea is that you process the file in the
same way you would do by selecting File/Open from the menu.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Brett Romero" <ac*****@cygen.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Here's part 2:

[STAThread]
static void Main(string[] args)
{
if (args.Length > 0)
{
//open files and read contents
foreach (string filename in args)
{
//file processing
}
}
else
{
loadUser_Init();
frmMaster MainForm = new frmMaster();
System.Windows.Forms.Application.Run(MainForm);
}
}

This will also take care of #3. Another app will need to be created
that catches all relevant file executions. It gives the user options
of which app to open.

Brett

Jan 25 '06 #6

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

Similar topics

0
by: roy | last post by:
Hi, I created a jnlp file, a jar file and a html on my local disk. Clicking the link of jnlp from the webpage, my Java Web Start launches. Everything is ok. But after I've uploaded all the...
16
by: Kerry Neilson | last post by:
For the past couple of months, Idle won't start when I invoke it. I am at a complete loss for why this is. When this happens, they python command line still starts, and python works fine...
0
by: dming | last post by:
I've experienced this a couple of times on different Windows workstations and it's driving me crazy. I've installed mysql-4.0 from the installer to c:\mysql. Then just for kicks I try to start it...
5
by: Kenneth | last post by:
Hi, I've upgraded to .NET 2003 and I opened an .NET 2002 app and let the new IDE convert it to .NET 2003 project. Then I tried to start the application but it keeps on saying "Error while...
6
by: Randy | last post by:
Hello All, Can someone tell me why when I go to the Solution Explorer and try to set a certain aspx page as the start page (Set As Start Page), it is grayed out? Thanks :)
3
by: Husam | last post by:
Hi EveryBody: by VB.Net How can I amke windows application project start with starting of opreating system and end with ending the opreating system, for exaple like the windows service project...
1
by: KenLee | last post by:
I worked on Windows application. I made a application to covert flat file to insert database. currently, I made a button to display progress bar after clicking the button. I just want to load...
4
by: =?Utf-8?B?S2lt?= | last post by:
Hey All I know how to to get the service ( by RegistyKey and Registy) so I can start the Application by dobble ckich on the file, but how can I read (and save) the path to the file so I can save...
3
by: Bob | last post by:
Hi, The user must enter a name into a text input control. Then i want to give him the choice between clicking on the button with the mouse or pushing the ENTER key of the keyboard. This works...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.