For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > February 2005 > Shell without the Application?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Shell without the Application?
Elmo Watson

2005-02-25, 3:55 am

How can I, based on having the exact path of the file I want to open, have
that file open using its default app, based on the extension?

I understand the Shell function, but all the examples I've seen use Shell
(app.name, filepath)

so if .txt is assigned to Notepad - how do I point to the file/pathname and
just make it open?


Tom Esh

2005-02-25, 3:55 am

On Thu, 24 Feb 2005 21:21:06 -0600, "Elmo Watson"
<sputnik@nospam.yahoo.com> wrote:

>How can I, based on having the exact path of the file I want to open, have
>that file open using its default app, based on the extension?
>
>I understand the Shell function, but all the examples I've seen use Shell
>(app.name, filepath)
>
>so if .txt is assigned to Notepad - how do I point to the file/pathname and
>just make it open?


Use either the ShellExecute or ShellExecuteEx Api function. There are
plenty of examples both, including:
http://vbnet.mvps.org/
http://www.mentalis.org/


-Tom
MVP - Visual Basic
(please post replies to the newsgroup)
Elmo Watson

2005-02-25, 3:56 pm

Great - found some examples and it works just like I need it too.
Thanks



"Tom Esh" <tjeshGibberish@suscom.net> wrote in message
news:qh9t11lbhnbc9khpcvco6670emosavo7f3@
4ax.com...
> On Thu, 24 Feb 2005 21:21:06 -0600, "Elmo Watson"
> <sputnik@nospam.yahoo.com> wrote:
>
have[color=darkred]
and[color=darkred]
>
> Use either the ShellExecute or ShellExecuteEx Api function. There are
> plenty of examples both, including:
> http://vbnet.mvps.org/
> http://www.mentalis.org/
>
>
> -Tom
> MVP - Visual Basic
> (please post replies to the newsgroup)



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com