ofirg
asked on
assign my application to catch double-click on *.tcs file
i have my prog.exe built ov DevStudio C++
I want to have different script files named *.tcs that i can run with my prog.exe
when i double click a tcs file i want my prog.exe to read lines from the clicked tcs file
I want to have different script files named *.tcs that i can run with my prog.exe
when i double click a tcs file i want my prog.exe to read lines from the clicked tcs file
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
"When creating applications, it's often necessary to
store information as a file on the hard drive. You
may choose to create your own extension and then
associate that extension with your application
through Windows.
Basically, you need to add two keys to the registry
under HKEY_CLASSES_ROOT. Say your extension in
".ext", then the first key you add is the
extension itself:
HKEY_CLASSES_ROOT\
.ext\
and set the "default" string value of this key to
an "internal name" for your file type - for example
MyApp.Document:
HKEY_CLASSES_ROOT\
.ext\
Default = "MyApp.Document"
You then create another key with this name:
HKEY_CLASSES_ROOT\
MyApp.Document\
Create a sub-key of this called "shell", a sub-key
of *this* called "open" and a further sub-key of
"open" called "command". The default value uder this
key is the location and name of your your
application folled by "%1" which represents the
filename parameter that Windows will pass to
your executable:
HKEY_CLASSES_ROOT\
MyApp.Document\
shell\
open\
command\
Default = "C:\myapp\myapp.exe %1"
"
store information as a file on the hard drive. You
may choose to create your own extension and then
associate that extension with your application
through Windows.
Basically, you need to add two keys to the registry
under HKEY_CLASSES_ROOT. Say your extension in
".ext", then the first key you add is the
extension itself:
HKEY_CLASSES_ROOT\
.ext\
and set the "default" string value of this key to
an "internal name" for your file type - for example
MyApp.Document:
HKEY_CLASSES_ROOT\
.ext\
Default = "MyApp.Document"
You then create another key with this name:
HKEY_CLASSES_ROOT\
MyApp.Document\
Create a sub-key of this called "shell", a sub-key
of *this* called "open" and a further sub-key of
"open" called "command". The default value uder this
key is the location and name of your your
application folled by "%1" which represents the
filename parameter that Windows will pass to
your executable:
HKEY_CLASSES_ROOT\
MyApp.Document\
shell\
open\
command\
Default = "C:\myapp\myapp.exe %1"
"
HKEY_CLASSES_ROOT\.tcs --Default key should contain something like TCSFile
HKEY_CLASSES_ROOT\TCSFile\
If you set it up like this and then double-click a TCS file, your program will be launched with the full pathname of the TCS file as its only command line parameter.