Hi Dave,
Should the %1 be in speech marks "%1" for long file names?
Jason
-----Original Message-----
From: David O'Brien [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 20 July 2000 9:48 a.m.
To: Multiple recipients of list delphi
Subject: RE: [DUG]: Command line switches
Jason,
Using a Program to Set File Assoications
----------------------------------------
You can also set the associations programmatically. This is useful when
setting up your application on other machines. You would provide this
functionality through your installation program. The first way to do
this
(the simplier method) is to use regedit to merge the changes from a
file.
The syntax for this is:
regedit <filename>.reg
An example of a <filename>.reg is:
REGEDIT
HKEY_CLASSES_ROOT\.riy = FMA000_File_assoc
HKEY_CLASSES_ROOT\FMA000_File_assoc = File_assoc
HKEY_CLASSES_ROOT\FMA000_File_assoc\shell\open\command = fileasso.EXE
HKEY_CLASSES_ROOT\FMA000_File_assoc\shell\open\ddeexec = [Open(%1)]
HKEY_CLASSES_ROOT\FMA000_File_assoc\shell\open\ddeexec\application
= Myserver
HKEY_CLASSES_ROOT\FMA000_File_assoc\shell\open\ddeexec\topic = system
HKEY_CLASSES_ROOT\FMA000_File_assoc\shell\print\command =
fileasso.EXE
HKEY_CLASSES_ROOT\FMA000_File_assoc\shell\print\ddeexec = [Open(%1)]
HKEY_CLASSES_ROOT\FMA000_File_assoc\shell\print\ddeexec\application =
MYServer
HKEY_CLASSES_ROOT\FMA000_File_assoc\shell\print\ddeexec\topic =
System
HKEY_CLASSES_ROOT\FMA000_File_assoc\shell\print\ddeexec\ifexec =
[Test(%1)
]
In the program, you can also add keys to the registry by using the
registry
APIs. The developer needs to add the following keys to the registration
database:
// Your extensions.
HKEY_CLASSES_ROOT\.riy = FMA000_File_assoc
//File type name.
HKEY_CLASSES_ROOT\FMA000_File_assoc = File_assoc
// Command to execute when application is not running or dde is not
// present and Open command is issued.
HKEY_CLASSES_ROOT\FMA000_File_assoc\shell\open\command = fileasso.EXE
// DDE execute statement for Open.
HKEY_CLASSES_ROOT\FMA000_File_assoc\shell\open\ddeexec = [Open(%1)]
// The server name your application responds to.
HKEY_CLASSES_ROOT\FMA000_File_assoc\shell\open\ddeexec\application =
Myserver
// Topic name your application responds to.
HKEY_CLASSES_ROOT\FMA000_File_assoc\shell\open\ddeexec\topic = system
// Command to execute when application is not running or dde is not
// present and print command is issued.
HKEY_CLASSES_ROOT\FMA000_File_assoc\shell\print\command =
fileasso.EXE
// DDE execute statement for Print.
HKEY_CLASSES_ROOT\FMA000_File_assoc\shell\print\ddeexec = [Open(%1)]
// The server name your application responds to.
HKEY_CLASSES_ROOT\FMA000_File_assoc\shell\print\ddeexec\application =
MYServer
// Topic name your application responds to.
HKEY_CLASSES_ROOT\FMA000_File assoc\shell\print\ddeexec\topic =
System
// DDE execute statement for print if the application is not already
// running. This gives the options for a an application to Run, Print
// and Exit.
HKEY_CLASSES_ROOT\FMA000_File assoc\shell\print\ddeexec\ifexec =
[Test(%1)]
Dave.
-----Original Message-----
From: Jason Coley [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 19 July 2000 4:10 p.m.
To: Multiple recipients of list delphi
Subject: [DUG]: Command line switches
How do I setup my Application to use a command line switch, or to be
able to click on a file type and have windows run my app?
Jason
------------------------------------------------------------------------
---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
------------------------------------------------------------------------
---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz