473,385 Members | 1,919 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.

How to: Launch application AND open the "triggering" file

Hi, I need some help. Hopefully this is trivial!

I have created a special file type for my application. I can easily
associate the app with the file type manually and I have even seen som code
to do this as well. (MSDN - 185453)

However, once the app is launched after double-clicking on the file,
how can I identify which file was selected, i.e. triggered the launch.

Pls point me to the right direction for search!
Thanks,
Bob



Jul 21 '05 #1
3 3265
In article <#h**************@TK2MSFTNGP10.phx.gbl>, Bob Lidgard wrote:
Hi, I need some help. Hopefully this is trivial!

I have created a special file type for my application. I can easily
associate the app with the file type manually and I have even seen som code
to do this as well. (MSDN - 185453)

However, once the app is launched after double-clicking on the file,
how can I identify which file was selected, i.e. triggered the launch.

Pls point me to the right direction for search!
Thanks,
Bob


Bob,

I believe the file path is passed in as a command line argument. So,
just check the command line - either by including it in your main
declaration or use System.Environment.CommandLine or
System.Environment.GetCommandLineArgs to retrieve the command line...

' main method
Public Sub Main(ByVal Args() As String)
....

End Sub
' System.Envrionment.CommandLine

Dim cmdLine As String = System.Envrionment.CommandLine
'System.Environment.GetCommandLineArgs()

Dim cmdLine() As String = System.Environment.GetCommandLineArgs()

HTH,
Tom Shelton
Jul 21 '05 #2
Hi Bob,

If you've tried to get the file name from the command line args and it's
still not working, check that the command in the file association has %1 as
its arguments.

Regards,
Fergus
Jul 21 '05 #3
Dear all,

Many thanks for your swift assistance!

Great!

Bob

"Bob Lidgard" <bl******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi, I need some help. Hopefully this is trivial!

I have created a special file type for my application. I can easily
associate the app with the file type manually and I have even seen som code to do this as well. (MSDN - 185453)

However, once the app is launched after double-clicking on the file,
how can I identify which file was selected, i.e. triggered the launch.

Pls point me to the right direction for search!
Thanks,
Bob


Jul 21 '05 #4

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

Similar topics

175
by: Ken Brady | last post by:
I'm on a team building some class libraries to be used by many other projects. Some members of our team insist that "All public methods should be virtual" just in case "anything needs to be...
4
by: Bob Lidgard | last post by:
Hi, I need some help. Hopefully this is trivial! I have created a special file type for my application. I can easily associate the app with the file type manually and I have even seen som code...
3
by: Scott McDermott | last post by:
I have an application that is making an HTTP request with HttpWebRequest.GetRequest. Unless I set 'httpWebRequest useUnsafeHeaderParsing="true"' in the web.config, I get a 'The server committed a...
0
by: =?Utf-8?B?SkhhbGV5?= | last post by:
Our system is: IIS Server: dual Intel Xeon 2.80 GHz, 4 GB Ram Windows Server 2003 SP2 IIS 6.0 SQL Server: dual Intel Xeon 2.80 GHz, 4 GB Ram (separate server) Windows Server 2003 SP2 SQL...
1
by: chrisj | last post by:
I'm using freeASPupload and got some assistance integrating to a Member script. It works successfully. In this modified version there are two groups that use this upload script. Members of one...
5
by: IUnknown | last post by:
Ok, we are all aware of the situation where modifying the folder structure (adding files, folders, deleting files, etc) will result in ASP.NET triggering a recompilation/restart of the application....
19
by: maya | last post by:
hi, so what is "modern" javascript?? the same as "DOM-scripting"? i.e., editing content (or changing appearance of content) dynamically by massaging javascript objects, html elements, etc? ...
3
Curtis Rutland
by: Curtis Rutland | last post by:
OK, I have a question. I have a problem. I'm trying to catch all KeyDown events on a button, but the problem is when I press the "Enter" key, the button's "Click" event is triggered, not the...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
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...

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.