473,803 Members | 3,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

Jun 19 '06 #1
7 5268
"Bob" <bd*****@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.Diagnost ics
....
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/>

Jun 19 '06 #2
bob
Hi,

I notice your reply to the starting message uses "Process.St art" 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.St art" command
now the equivalent of the Windows API "ShellExecute"? ?

Thanks.
Herfried K. Wagner [MVP] wrote:
"Bob" <bd*****@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.Diagnost ics
...
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/>


Jun 20 '06 #3
<bo*@datasync.c om> schrieb:
I notice your reply to the starting message uses "Process.St art" 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.mp 3""")
///
Is this "Process.St art" 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/>
Jun 20 '06 #4
bob
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:
<bo*@datasync.c om> schrieb:
I notice your reply to the starting message uses "Process.St art" 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.mp 3""")
///
Is this "Process.St art" 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/>


Jun 20 '06 #5
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

<bo*@datasync.c om> schreef in bericht
news:11******** **************@ y41g2000cwy.goo glegroups.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:
<bo*@datasync.c om> schrieb:
> I notice your reply to the starting message uses "Process.St art" 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.mp 3""")
///
> Is this "Process.St art" 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/>

Jun 20 '06 #6
Myfile.wme? WME is Windows Media Encoder and a wme file is not a multimedia
file that WMP can play.

"Bob" <bd*****@sgiims .com> wrote in message
news:%2******** **********@TK2M SFTNGP05.phx.gb l...
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

Jun 20 '06 #7
Bob
You're right. I found the correct extension, works fine now.
Thanks
Bob
"Mike Lowery" <se******@mou se-potato.com> wrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Myfile.wme? WME is Windows Media Encoder and a wme file is not a
multimedia file that WMP can play.

"Bob" <bd*****@sgiims .com> wrote in message
news:%2******** **********@TK2M SFTNGP05.phx.gb l...
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


Jun 22 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
404
by: Charles A. Lackman | last post by:
Hello, I have a web site that plays mp3's and wav files, I am using a media player on the site which does not allow for downloading the media, but if you go to properties within the player and copy the URL into Windows media Player you can copy it to your hard drive. How do I prevent this from happening? I have set the mp3's and wav files to read only. Any suggestions would be greatly appreciated. Thanks,
3
19939
by: rmorvay | last post by:
I wrote a quick app to play music and I am having difficulty connecting a slider control to the Windows Media Player control. Here is my difficulty. I need to set the sliders min and max properties and utilize its value property to manage the volume of the Windows Media Player control. I am not sure which property on the windows media control I am suppose to manipulate. I tried to use the following: mp.volume = vsVol.value in the sliders...
3
5193
by: UJ | last post by:
I have a .avi file that uses the Divx codec. If I load it with windows media player program it works fine. If I load it using my control in a program, it doesn't display. Over standard media files work fine so it's this particular file. Do I have to do anything when the file uses a non-included codec? How can I tell what Codec it's using? TIA - Jeff.
2
4933
by: benmourra | last post by:
Hi all, I'm trying to create a web page using VS2005, ASP.NET 2.0, that will allow me to choose from a list of media files on my computer and then play my selection within an embedded Windows Media Player on the page. I've been able to eventually find out how to embed the player into the page by manually inserting code into the source view of my aspx file. It plays the file specified in the source view, but I'd like to be able to...
1
5554
by: sri2097 | last post by:
Basically, I want to check if a URL is playable or not (without actually playing it). i.e. given a URL I want to write an automation script to figure it out for me if it's playable or not. If you give a bad/invalid URL for windows media player to play a pop-up window shows us that it cannot be played. So I would want to catch that event.
19
19277
by: Tony | last post by:
I'm working on project that plays movies using Windows Media Player and I'm controlling everything with JavaScript. Per the client I only need to support IE 6 or greater which happens to make things a bit easier. What I need to do is create a playlist and play it using JavaScript. I keep on getting close but not close enough to play the dang files. Has anyone done this before and can shed some light on what worked for them?
3
9724
by: Ronald S. Cook | last post by:
In my Win app, I'm needing to load a media file into my Windows Media Player control, and THEN read an attribute from the file. The thing is, the file has to be playing for a split second before the attribute can be read. I can have wmpPlayer.URL = @"D:\Web\FWT\TestFile.wma"; in my form load event and then a button on the form to get the value I need... label1.Text = wmpPlayer.currentMedia.getItemInfo("Abstract");
2
3283
riptide2049
by: riptide2049 | last post by:
I really have a problem here. I have a code that is suppost to take the href of a link from the right class;value of a link maked toreturn false. the value is a Media file the file is sent to quicktime or windows meida player depending on which plugin was found. after the plug in is found a iframe with the right player is created. here is the code. for some reason In IE the plug in doesnt work and in fire fox it crashes <!DOCTYPE html...
5
2640
by: Fred Chateau | last post by:
I am currently using an Object element of type "application/x-mplayer2" to create a media player in ASP.NET 3.5, and was wondering if there is a better way to instantiate WMP in a browser. I'm hoping to find something with better cross-browser compatibility. I looked at System.Windows.Media.MediaPlayer in PresentationCore.dll but I'm assuming that is used for Windows Forms (WPF). I'm also looking at the Silverlight 2.0 MediaElement as a...
0
9562
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10542
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10309
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10289
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9119
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5496
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3795
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2968
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.