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

open custom extnsion files with cutom applications using c#.net

Hi
I am developing a C#.Net windows application for my project.
In that project I have an IDE to work on. The application is similar to
Adobe Photoshop.

My requirement is as follows.
1) I must be able to save my work in a file with custom file extention
(similar to *.PSD in photoshop)
2) After I save my work, if I double click on that file, my work should be
opened with my application automatically and I need to be able to work on
that as usual.
(similar to *.psd file, if we open that file, the file will be opened in
photoshop automatically)

How to do this functionality programatically?
(when we double click the file, my application has to be opened and file
must be opened in that application.)
Please help me out from this situation and guide me in right direction ASAP.

Thanks in advance

Aug 2 '06 #1
5 2134
You can add file extension associations easily in a Setup Project.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Magician

A man, a plan, a canal.
a palindrome that has gone to s**t.
"Yoshitha" <gu**********@yahoo.co.inwrote in message
news:O3**************@TK2MSFTNGP06.phx.gbl...
Hi
I am developing a C#.Net windows application for my project.
In that project I have an IDE to work on. The application is similar to
Adobe Photoshop.

My requirement is as follows.
1) I must be able to save my work in a file with custom file extention
(similar to *.PSD in photoshop)
2) After I save my work, if I double click on that file, my work should be
opened with my application automatically and I need to be able to work on
that as usual.
(similar to *.psd file, if we open that file, the file will be opened in
photoshop automatically)

How to do this functionality programatically?
(when we double click the file, my application has to be opened and file
must be opened in that application.)
Please help me out from this situation and guide me in right direction
ASAP.

Thanks in advance

Aug 2 '06 #2
If you are using .NET 2.0 then this can be done using registry
modifications.

I am just writing an article on this for my web site. Should be up in a few
days.

For the loading of the file you simply need to adjust your Main() method to
accept arguments and make sure that the filename is passed to the executable
as an argument. Check out
http://www.blackwasp.co.uk/WindowsFormsStartParams.aspx for how to do this
bit of the job.

--

BlackWasp
http://www.blackwasp.co.uk/
"Yoshitha" <gu**********@yahoo.co.inwrote in message
news:O3**************@TK2MSFTNGP06.phx.gbl...
Hi
I am developing a C#.Net windows application for my project.
In that project I have an IDE to work on. The application is similar to
Adobe Photoshop.

My requirement is as follows.
1) I must be able to save my work in a file with custom file extention
(similar to *.PSD in photoshop)
2) After I save my work, if I double click on that file, my work should be
opened with my application automatically and I need to be able to work on
that as usual.
(similar to *.psd file, if we open that file, the file will be opened in
photoshop automatically)

How to do this functionality programatically?
(when we double click the file, my application has to be opened and file
must be opened in that application.)
Please help me out from this situation and guide me in right direction
ASAP.

Thanks in advance

Aug 2 '06 #3
Here you go, thought I may as well add it straight away :-)

http://www.blackwasp.co.uk/ProgrammaticFileTypes.aspx

--

BlackWasp
http://www.blackwasp.co.uk/
"BlackWasp" <no@spam.comwrote in message
news:Ae********************@karoo.co.uk...
If you are using .NET 2.0 then this can be done using registry
modifications.

I am just writing an article on this for my web site. Should be up in a
few days.

For the loading of the file you simply need to adjust your Main() method
to accept arguments and make sure that the filename is passed to the
executable as an argument. Check out
http://www.blackwasp.co.uk/WindowsFormsStartParams.aspx for how to do this
bit of the job.

--

BlackWasp
http://www.blackwasp.co.uk/
"Yoshitha" <gu**********@yahoo.co.inwrote in message
news:O3**************@TK2MSFTNGP06.phx.gbl...
>Hi
I am developing a C#.Net windows application for my project.
In that project I have an IDE to work on. The application is similar to
Adobe Photoshop.

My requirement is as follows.
1) I must be able to save my work in a file with custom file extention
(similar to *.PSD in photoshop)
2) After I save my work, if I double click on that file, my work should
be
opened with my application automatically and I need to be able to work on
that as usual.
(similar to *.psd file, if we open that file, the file will be opened in
photoshop automatically)

How to do this functionality programatically?
(when we double click the file, my application has to be opened and file
must be opened in that application.)
Please help me out from this situation and guide me in right direction
ASAP.

Thanks in advance


Aug 2 '06 #4
Hi BlackWasp
Thanks for the solution....

I followed what ever you said. Finally I am able to open my application when
I double click the file which is having my custom extention.
The below link guided me very well up to now...
http://www.blackwasp.co.uk/ProgrammaticFileTypes.aspx

But here I have one problem,

My application is cbr.exe, and the file extention is *.cbw

I am able to generate myFile.cbw,
I am able to get my own icon for cbw file type.
I am able to run "cbr.exe when *.cbw files are double clicked in the
explorer.

But I could not be able to read the myFile.cbw file content when cbr.exe is
run.
I want to read the file contents of cbw files which I double click and open
with my application "cbr.exe"
When I click the file (which has custom extention, say *.xyz) I am able to
run my application. I could not be able to read the file with my application
at the time of opening it with my application.

Please help me out from this situation

thanks
"BlackWasp" <no@spam.comwrote in message
news:7N********************@karoo.co.uk...
Here you go, thought I may as well add it straight away :-)

http://www.blackwasp.co.uk/ProgrammaticFileTypes.aspx

--

BlackWasp
http://www.blackwasp.co.uk/
"BlackWasp" <no@spam.comwrote in message
news:Ae********************@karoo.co.uk...
If you are using .NET 2.0 then this can be done using registry
modifications.

I am just writing an article on this for my web site. Should be up in a
few days.

For the loading of the file you simply need to adjust your Main() method
to accept arguments and make sure that the filename is passed to the
executable as an argument. Check out
http://www.blackwasp.co.uk/WindowsFormsStartParams.aspx for how to do
this
bit of the job.

--

BlackWasp
http://www.blackwasp.co.uk/
"Yoshitha" <gu**********@yahoo.co.inwrote in message
news:O3**************@TK2MSFTNGP06.phx.gbl...
Hi
I am developing a C#.Net windows application for my project.
In that project I have an IDE to work on. The application is similar to
Adobe Photoshop.

My requirement is as follows.
1) I must be able to save my work in a file with custom file extention
(similar to *.PSD in photoshop)
2) After I save my work, if I double click on that file, my work should
be
opened with my application automatically and I need to be able to work
on
that as usual.
(similar to *.psd file, if we open that file, the file will be opened
in
photoshop automatically)

How to do this functionality programatically?
(when we double click the file, my application has to be opened and
file
must be opened in that application.)
Please help me out from this situation and guide me in right direction
ASAP.

Thanks in advance


Aug 3 '06 #5
Hi again,

The main thing to check for is that you are setting the command that you
execute to cbr.exe %1.

The %1 is important as this will be replaced with the name of the file. So,
say you double-click "c:\cheese.cbw", the command that is executed will be
cbr.exe c:\cheese.cbw.

Effectively this is the same as clicking Start then Run and typeing cbr.exe
c:\cheese.cbw before clicking the OK button. (If you do this, does it load
your app with the document?)

Secondly, you need to be able to capture that this has been passed to your
application. I explain this in
http://www.blackwasp.co.uk/WindowsFormsStartParams.aspx.

Change the Main() definition to Main(string[] args). On starting, check if
args==null. If args is null then no document was passed to the executable.
If it is not null then args[0] should contain the name of your file. You
can then load this using whatever functions you need.

Let me know how you get on either through the newsgroup or drop me a line
via my contact page.

--

BlackWasp
http://www.blackwasp.co.uk/
"Yoshitha" <gu**********@yahoo.co.inwrote in message
news:Oo****************@TK2MSFTNGP03.phx.gbl...
Hi BlackWasp
Thanks for the solution....

I followed what ever you said. Finally I am able to open my application
when
I double click the file which is having my custom extention.
The below link guided me very well up to now...
http://www.blackwasp.co.uk/ProgrammaticFileTypes.aspx

But here I have one problem,

My application is cbr.exe, and the file extention is *.cbw

I am able to generate myFile.cbw,
I am able to get my own icon for cbw file type.
I am able to run "cbr.exe when *.cbw files are double clicked in the
explorer.

But I could not be able to read the myFile.cbw file content when cbr.exe
is
run.
I want to read the file contents of cbw files which I double click and
open
with my application "cbr.exe"
When I click the file (which has custom extention, say *.xyz) I am able to
run my application. I could not be able to read the file with my
application
at the time of opening it with my application.

Please help me out from this situation

thanks
"BlackWasp" <no@spam.comwrote in message
news:7N********************@karoo.co.uk...
>Here you go, thought I may as well add it straight away :-)

http://www.blackwasp.co.uk/ProgrammaticFileTypes.aspx

--

BlackWasp
http://www.blackwasp.co.uk/
"BlackWasp" <no@spam.comwrote in message
news:Ae********************@karoo.co.uk...
If you are using .NET 2.0 then this can be done using registry
modifications.

I am just writing an article on this for my web site. Should be up in
a
few days.

For the loading of the file you simply need to adjust your Main()
method
to accept arguments and make sure that the filename is passed to the
executable as an argument. Check out
http://www.blackwasp.co.uk/WindowsFormsStartParams.aspx for how to do
this
bit of the job.

--

BlackWasp
http://www.blackwasp.co.uk/
"Yoshitha" <gu**********@yahoo.co.inwrote in message
news:O3**************@TK2MSFTNGP06.phx.gbl...
Hi
I am developing a C#.Net windows application for my project.
In that project I have an IDE to work on. The application is similar
to
Adobe Photoshop.

My requirement is as follows.
1) I must be able to save my work in a file with custom file extention
(similar to *.PSD in photoshop)
2) After I save my work, if I double click on that file, my work
should
be
opened with my application automatically and I need to be able to work
on
>that as usual.
(similar to *.psd file, if we open that file, the file will be opened
in
>photoshop automatically)

How to do this functionality programatically?
(when we double click the file, my application has to be opened and
file
>must be opened in that application.)
Please help me out from this situation and guide me in right direction
ASAP.

Thanks in advance





Aug 4 '06 #6

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

Similar topics

0
by: Unigroup of New York | last post by:
Content-Type: multipart/mixed; boundary="------------C465DF38DCB38DD2AF7117E0" Lines: 327 Date: Tue, 15 Feb 2005 23:36:38 -0500 NNTP-Posting-Host: 24.46.113.251 X-Complaints-To: abuse@cv.net...
1
by: | last post by:
Hi, I need to preinstall silently some applications and runtimes (.net runtimes) before I install my application but want to do this from a .bat file. I tried to add this as a custom action in...
0
by: Steve Klett | last post by:
Hi- I use custom erros for the basic 404, etc. I would like to also use them when I encounter a problem at run time, say.. in a try block I find an error, I would like to display an...
4
by: Yoshitha | last post by:
Hi I am developing a C#.Net windows application for my project. In that project I have an IDE to work on. The application is similar to Adobe Photoshop. My requirement is as follows. 1) I must...
1
by: Yoshitha | last post by:
Hi I am developing a C#.Net windows application for my project. In that project I have an IDE to work on. The application is similar to Adobe Photoshop. My requirement is as follows. 1) I must...
13
by: Matt F | last post by:
I have a deployment project that I'm setting up. I need to perform a different custom action based on whether this is a first time install or an update. Does anyone have any idea if it's possible...
0
by: Bandu | last post by:
Hi, Is there any way or tutorial that allow me to use custom object instance as a parameter or property in cutom activity that my other custom activity can call that instance methods. ...
4
by: Jimmy | last post by:
hi, all I'm having a problem with creating custom events in wxpython. I have a class A handling some data processing work and another class B of GUI matter. I need GUI to display information...
2
by: hharry | last post by:
Hello All, Does anyone know of a method to automatically detect if a file is corrupted ? Due to a failed backup process a number of files were corrupted. The files are mostly .xls, .doc, .pdf....
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: 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
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.