Home All Groups Group Topic Archive Search About

how to launch media player and a selected file from within VB.Net app?

Author
19 Jun 2006 10:08 PM
Bob
I have a media file Myfile.wme that I want to play within the Windows
default media player on a button or menu click event in my app. The file is
in a folder relative to my bin folder. I can defeine the full path of the
file then using that I want to launch the media player to use that file.

Any help greatly appreciated.

Bob

Author
19 Jun 2006 10:43 PM
Herfried K. Wagner [MVP]
"Bob" <bduf***@sgiims.com> schrieb:
> I have a media file Myfile.wme that I want to play within the Windows
> default media player on a button or menu click event in my app. The file
> is in a folder relative to my bin folder. I can defeine the full path of
> the file then using that I want to launch the media player to use that
> file.

\\\
Imports System.Diagnostics
....
Process.Start("C:\foo\bla.wmv")
///

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
20 Jun 2006 6:18 AM
bob@datasync.com
Hi,

I notice your reply to the starting message uses "Process.Start" and
only names the target file to be played, without naming the program to
play it with. Obviously, this depends on the "Type" of file (wmv) being
assigned a hosting program in Windows. Is this "Process.Start" command
now the equivalent of the Windows API "ShellExecute"??

Thanks.


Herfried K. Wagner [MVP] wrote:
Show quoteHide quote
> "Bob" <bduf***@sgiims.com> schrieb:
> > I have a media file Myfile.wme that I want to play within the Windows
> > default media player on a button or menu click event in my app. The file
> > is in a folder relative to my bin folder. I can defeine the full path of
> > the file then using that I want to launch the media player to use that
> > file.
>
> \\\
> Imports System.Diagnostics
> ...
> Process.Start("C:\foo\bla.wmv")
> ///
>
> --
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://classicvb.org/petition/>
Author
20 Jun 2006 9:41 AM
Herfried K. Wagner [MVP]
<b**@datasync.com> schrieb:
> I notice your reply to the starting message uses "Process.Start" and
> only names the target file to be played, without naming the program to
> play it with. Obviously, this depends on the "Type" of file (wmv) being
> assigned a hosting program in Windows.

Yes.  However, you can open the file with a certain player too:

\\\
Process.Start("C:\myplayer.exe", """C:\my files\sample.mp3""")
///

> Is this "Process.Start" command
> now the equivalent of the Windows API "ShellExecute"??

Yes, it is.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
20 Jun 2006 2:14 PM
bob@datasync.com
Thanks. (I'm slowly eliminating all the "declares" I had in vb6,
replacing them with cleaner, quicker vb.net stuff. Every time I do
that, it makes me feel a little better about .net. Before long, I'm
going to be loving this language!)


Herfried K. Wagner [MVP] wrote:
Show quoteHide quote
> <b**@datasync.com> schrieb:
> > I notice your reply to the starting message uses "Process.Start" and
> > only names the target file to be played, without naming the program to
> > play it with. Obviously, this depends on the "Type" of file (wmv) being
> > assigned a hosting program in Windows.
>
> Yes.  However, you can open the file with a certain player too:
>
> \\\
> Process.Start("C:\myplayer.exe", """C:\my files\sample.mp3""")
> ///
>
> > Is this "Process.Start" command
> > now the equivalent of the Windows API "ShellExecute"??
>
> Yes, it is.
>
> --
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://classicvb.org/petition/>
Author
20 Jun 2006 2:29 PM
Cor Ligthert [MVP]
Bob,

You are not the first one who does that and have the same evolution in that.

Although version 2005 has a lot of failures especial in the IDE, but that is
known and we are sure that it will be solved. Our expiriences from 2002 to
2003 version (in fact almost an SP) were great.

:-)

Cor

<b**@datasync.com> schreef in bericht
Show quoteHide quote
news:1150812871.475313.175750@y41g2000cwy.googlegroups.com...
> Thanks. (I'm slowly eliminating all the "declares" I had in vb6,
> replacing them with cleaner, quicker vb.net stuff. Every time I do
> that, it makes me feel a little better about .net. Before long, I'm
> going to be loving this language!)
>
>
> Herfried K. Wagner [MVP] wrote:
>> <b**@datasync.com> schrieb:
>> > I notice your reply to the starting message uses "Process.Start" and
>> > only names the target file to be played, without naming the program to
>> > play it with. Obviously, this depends on the "Type" of file (wmv) being
>> > assigned a hosting program in Windows.
>>
>> Yes.  However, you can open the file with a certain player too:
>>
>> \\\
>> Process.Start("C:\myplayer.exe", """C:\my files\sample.mp3""")
>> ///
>>
>> > Is this "Process.Start" command
>> > now the equivalent of the Windows API "ShellExecute"??
>>
>> Yes, it is.
>>
>> --
>>  M S   Herfried K. Wagner
>> M V P  <URL:http://dotnet.mvps.org/>
>>  V B   <URL:http://classicvb.org/petition/>
>
Author
20 Jun 2006 2:28 PM
Mike Lowery
Myfile.wme?  WME is Windows Media Encoder and a wme file is not a multimedia
file that WMP can play.

Show quoteHide quote
"Bob" <bduf***@sgiims.com> wrote in message
news:%23latxz%23kGHA.4284@TK2MSFTNGP05.phx.gbl...
> I have a media file Myfile.wme that I want to play within the Windows default
> media player on a button or menu click event in my app. The file is in a
> folder relative to my bin folder. I can defeine the full path of the file then
> using that I want to launch the media player to use that file.
>
> Any help greatly appreciated.
>
> Bob
>
>
>
Author
22 Jun 2006 7:13 PM
Bob
You're right. I found the correct extension, works fine now.
Thanks
Bob
Show quoteHide quote
"Mike Lowery" <selfspam@mouse-potato.com> wrote in message
news:%23bukcXHlGHA.1000@TK2MSFTNGP04.phx.gbl...
> Myfile.wme?  WME is Windows Media Encoder and a wme file is not a
> multimedia file that WMP can play.
>
> "Bob" <bduf***@sgiims.com> wrote in message
> news:%23latxz%23kGHA.4284@TK2MSFTNGP05.phx.gbl...
>> I have a media file Myfile.wme that I want to play within the Windows
>> default media player on a button or menu click event in my app. The file
>> is in a folder relative to my bin folder. I can defeine the full path of
>> the file then using that I want to launch the media player to use that
>> file.
>>
>> Any help greatly appreciated.
>>
>> Bob
>>
>>
>>
>
>