471,627 Members | 2,330 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,627 software developers and data experts.

Associating a file extension to an application

MJB

I have an application that understands a proprietary format and file
extension. I can associate the file to my application using the windows
'Open With' dialog, but I want my application to automatically load the
file when opening it. What is the proper way to do this? An example of
how to pass the file to my application would be great.

Thanks,
Matt
Dec 28 '05 #1
3 2768
Hi,

It goes in the registry , you can see this by creating an extension, assign
it to any program and checking the register after.

take a look at
http://msdn.microsoft.com/library/de.../fileassoc.asp
A possible solution is to prepare a .reg file, put it as a embedded resource
and later just insert this info in the register.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"MJB" <mb*@email.com> wrote in message
news:eZ**************@TK2MSFTNGP14.phx.gbl...

I have an application that understands a proprietary format and file
extension. I can associate the file to my application using the windows
'Open With' dialog, but I want my application to automatically load the
file when opening it. What is the proper way to do this? An example of
how to pass the file to my application would be great.

Thanks,
Matt

Dec 28 '05 #2
"MJB" <mb*@email.com> schrieb:
I have an application that understands a proprietary format and file
extension. I can associate the file to my application using the windows
'Open With' dialog, but I want my application to automatically load the
file when opening it. What is the proper way to do this? An example of
how to pass the file to my application would be great.


<URL:http://www.mentalis.org/soft/class.qpx?id=5>

The filename will be passed to the executable in a command line parameter:

\\\
Public Module Program
Public Function Main(ByVal Args() As String) As Integer
For Each Arg As String In Args
MsgBox(Arg)
Next Arg
Application.Run(...)
End Function
End Module
///

Select 'Sub Main' as startup object in the project properties.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Dec 28 '05 #3
MJB
Thanks Herfried and all who responded.
Herfried K. Wagner [MVP] wrote:
"MJB" <mb*@email.com> schrieb:
I have an application that understands a proprietary format and file
extension. I can associate the file to my application using the
windows 'Open With' dialog, but I want my application to automatically
load the file when opening it. What is the proper way to do this? An
example of how to pass the file to my application would be great.

<URL:http://www.mentalis.org/soft/class.qpx?id=5>

The filename will be passed to the executable in a command line parameter:

\\\
Public Module Program
Public Function Main(ByVal Args() As String) As Integer
For Each Arg As String In Args
MsgBox(Arg)
Next Arg
Application.Run(...)
End Function
End Module
///

Select 'Sub Main' as startup object in the project properties.

Dec 28 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Bill English | last post: by
reply views Thread by zerodot | last post: by
3 posts views Thread by Shapper | last post: by
reply views Thread by leo001 | 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.