473,401 Members | 2,068 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,401 software developers and data experts.

Getting Path of File that Opened an Application


This seems so simple, but...

Let me use this as an example. When you click on an mpg, a program
such as media player opens, and plays that mpg. So, somewhere, media
player knows what file was sent to it.

I'm building a small utility that will need to know what file opened
it. I'm guessing this is an API issue. How do I find out the path of
the file that caused my application to open.

Thanks
Nov 20 '05 #1
2 888
The path will be in the command line. Your application Main must accept
command line parameters to be opened in this way.

--
Bob Powell [MVP]
C#, System.Drawing

The November edition of Well Formed is now available.
Learn how to create Shell Extensions in managed code.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com

<to**************@hotmail.com> wrote in message
news:2s********************************@4ax.com...

This seems so simple, but...

Let me use this as an example. When you click on an mpg, a program
such as media player opens, and plays that mpg. So, somewhere, media
player knows what file was sent to it.

I'm building a small utility that will need to know what file opened
it. I'm guessing this is an API issue. How do I find out the path of
the file that caused my application to open.

Thanks

Nov 20 '05 #2
* to**************@hotmail.com scripsit:
Let me use this as an example. When you click on an mpg, a program
such as media player opens, and plays that mpg. So, somewhere, media
player knows what file was sent to it.

I'm building a small utility that will need to know what file opened
it. I'm guessing this is an API issue. How do I find out the path of
the file that caused my application to open.


<http://www.google.com/groups?selm=br8clu%24iu8q%243%40ID-208219.news.uni-berlin.de>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3

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

Similar topics

5
by: Alvaro Puente | last post by:
Hi all! I've got a FILE* pointing to an already opened file. I want to create a new file in the same directory where that file is. Is there any way of obtaining file path from FILE*? Many...
1
by: Rob T | last post by:
I want to write a file into the directory my application is installed into. If I just write the file without a path, it will go to the user's working directory (ie, where he opened a file from)....
11
by: KarimL | last post by:
Thanks for your advices... but i need to get the Image height because i dynamically resize the height of my webcontrol based on the image height. More i just have the url (relative parth) to the...
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
11
by: Daz | last post by:
Would anyone know of a way to check whether or not a particular path is a directory? If I have to go down the route of using _findfirst and _findnext (windows specific), then so be it. However, I...
4
by: Dots | last post by:
I have a class library with a method called getpath(). I want to be able to get the full path of a folder and write some files to the (my_files_dir) folder. A console application will use this...
22
by: Dale Pennington | last post by:
I find myself in the odd situation of trying to determine the name of a file that has been opened somewhere else with an fopen call, so all I have is the FILE * from that fopen call. I perused my...
9
by: cdroulers | last post by:
Hello, I am working on a school project that requires me to get the path of a filename for future treatment. I've tried getting a file with tkFileDialog.askopenfile. ...
185
by: jacob navia | last post by:
Hi We are rewriting the libc for the 64 bit version of lcc-win and we have added a new field in the FILE structure: char *FileName; fopen() will save the file name and an accessor function will...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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,...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.