creating file association for vb exe 
Author Message
 creating file association for vb exe

i dont know how to associate the exe with a filetype from VB. but i do know
that when you find out how to associate it, then when you doubleclick on say
a .txt file (if thats what your associated with), then the filename of the
file you are loading will be in the Command$ string in VB. Example:

Sub Form_Load()
    msgbox Command$       ' that is the path of the file that is being
loaded
End Sub

hope this helps

Noah



Quote:
> I was wondering if anyone has any information on creating file
associations
> that can be opened with a vb exe.

> for example:
> If I was to write a notepad replacement in Visual Basic 5 that views text
> files, In order for me to simply click on a text file in windows explorer
> and have it opened by the notepad replacement I would have to create
> registry entries that associate the "text file type" with the notepad
> replacement.

> that is fine. I can do that.

> the next part of the problem is how does the vb notepad replacement know
> which file I just clicked on? That is what code or whatever do I need to
> include in the program so that it "knows"? i have heard that it involves
> something called a "shell extension". Is that true?

> Any help would be greatly appreciated.




Wed, 24 Oct 2001 03:00:00 GMT  
 creating file association for vb exe
Michael,

The trick is to replace the shell command default in the registry with your program.
If I remember correctly, there's a sample in VBnet (www.mvps.org/vbnet/) that deals
with this. It's got a search engine, so you can look it up easily.

~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please post/reply to the newsgroup(s) so
that everyone can benefit from the discussion.

Regards,

Klaus H. Probst, MCP

       ICQ: 22454937
      The VB Box: http://members.xoom.com/kprobst/
~~~~~~~~~~~~~~~~~~~~~~~~~~~



Quote:
> I was wondering if anyone has any information on creating file associations
> that can be opened with a vb exe.

> for example:
> If I was to write a notepad replacement in visual basic 5 that views text
> files, In order for me to simply click on a text file in windows explorer
> and have it opened by the notepad replacement I would have to create
> registry entries that associate the "text file type" with the notepad
> replacement.

> that is fine. I can do that.

> the next part of the problem is how does the vb notepad replacement know
> which file I just clicked on? That is what code or whatever do I need to
> include in the program so that it "knows"? i have heard that it involves
> something called a "shell extension". Is that true?



Wed, 24 Oct 2001 03:00:00 GMT  
 creating file association for vb exe
I was wondering if anyone has any information on creating file associations
that can be opened with a vb exe.

for example:
If I was to write a notepad replacement in visual basic 5 that views text
files, In order for me to simply click on a text file in windows explorer
and have it opened by the notepad replacement I would have to create
registry entries that associate the "text file type" with the notepad
replacement.

that is fine. I can do that.

the next part of the problem is how does the vb notepad replacement know
which file I just clicked on? That is what code or whatever do I need to
include in the program so that it "knows"? i have heard that it involves
something called a "shell extension". Is that true?



Thu, 25 Oct 2001 03:00:00 GMT  
 creating file association for vb exe
I was wondering if anyone has any information on creating file associations
that can be opened with a vb exe.

for example:
If I was to write a notepad replacement in visual basic 5 that views text
files, In order for me to simply click on a text file in windows explorer
and have it opened by the notepad replacement I would have to create
registry entries that associate the "text file type" with the notepad
replacement.

that is fine. I can do that.

the next part of the problem is how does the vb notepad replacement know
which file I just clicked on? That is what code or whatever do I need to
include in the program so that it "knows"? i have heard that it involves
something called a "shell extension". Is that true?

Any help would be greatly appreciated.



Thu, 25 Oct 2001 03:00:00 GMT  
 creating file association for vb exe
Thanks Noah,

that is exactly what I was looking for!( i couldn't believe it was so
simple)
I am also a little embarrassed because the entry in the vb help file that
talks about this I have looked at a couple of times.
I didn't read it properly thinking "command$" was only related to the visual
basic development environment.

thanks,

Michael Dalla Costa

Quote:

>i dont know how to associate the exe with a filetype from VB. but i do know
>that when you find out how to associate it, then when you doubleclick on
say
>a .txt file (if thats what your associated with), then the filename of the
>file you are loading will be in the Command$ string in VB. Example:

>Sub Form_Load()
>    msgbox Command$       ' that is the path of the file that is being
>loaded
>End Sub

>hope this helps

>Noah



Fri, 26 Oct 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Creating an .EXE file from a VB .EXE ????

2. File Name associations ?.exe

3. File Association and passing file name of associated file to VB App

4. How to create an Exe file and a setup file in VB.NET

5. Creating file associations with VB6?

6. Creating a file association

7. Need help creating file type associations

8. Creating a File Association?

9. Progmatically create file associations on Windows 2000

10. How can I create file associations, please?

11. how to create a standalone .*.exe file to vb program

12. Creating exe files that pass arguments to VB

 

 
Powered by phpBB® Forum Software