471,354 Members | 1,279 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 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 1163
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by roy | last post: by
16 posts views Thread by Kerry Neilson | last post: by
reply views Thread by dming | last post: by
5 posts views Thread by Kenneth | last post: by
6 posts views Thread by Randy | last post: by
1 post views Thread by KenLee | last post: by
3 posts views Thread by Bob | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.