-
Please solve this!!
Say, I have developed an application which opens a text file. it reads a text file and displays it to the user on a form and does various tasks.
Now, I want to open every txt file using my application whenever the user double clicks the file in the windows explorer.
pls guide.
-
Hi,
Why do it in windows explorer? You can do it perfectly well using the OpenFileDialog control from the ToolBox. (Which looks like Windows Explorer anyway!)
-
I'm not sure how to associate extensions with an app in code, although it probably wouldn't take much searching to find a way, but a user can easily do it manually.
-
Associating your program with specific ext can be easily done while making setup project for your application .
Or
by API .
-
Look in HKEY_CLASSES_ROOT at how the file extensions are created and use your program to simply add the required registry keys and strings to associate the files with your program.
-
I'd go with Pirate. I forgot you could do it in setup, although to be nice, you should ask first.
But, now you've got leads on 4 or 5 ways to do it :cool:
-
is it something related to commandline argument??
like, say, my application name followed by filename
c:\MyApp.exe Text1.txt
??
-
Yeah the filename goes into the command part of the path. To get the file name, use X = Command in the Form_Load sub. I'm pretty sure it displays the full path so all you'd really have to do is call the sub that loads the files and it would do it automatically when it first loads up.
-
i am bit confused.
can u provide me with an example?
what settings i have to do in my project properties?
thanx in advance
-
File Types Editor view . Check out MSDN howto .
-
pirate, i am searching for it.
btw, could u please solve my query at the following link:
Please solve this!
didnt receive any help from anybody yet. its urgent.
thanx in advance