473,385 Members | 1,934 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Opening Windows Media Player from my program

How can Start, Play,Stop and pause Windows Media Player from my VB program
Apr 21 '09 #1
6 2940
kadghar
1,295 Expert 1GB
you should be able by using its ActiveX, the syntax depends on your VB versión, but using CreateObject would be of help:
Expand|Select|Wrap|Line Numbers
  1. Dim Obj1 as Object
  2. Set Obj1=CreateObject("WMPlayer.OCX")
  3. Obj1.visible=true
You should ask Google about other commands, to open a playlist or stuff like that.
Apr 21 '09 #2
smartchap
236 100+
It gives error 'Object doesn't support this property or method' for statement 'obj1.visible = True'
Apr 22 '09 #3
kadghar
1,295 Expert 1GB
hmm, thats perhaps my mistake.

Once the object has been created as an instance of Windows Media Player. You could only use properties or methods its ActiveX supports.

If 'visible' is not one of them, the mistake will be shown. Sorry about that. You should ask google about the properties and methods of this application.
Apr 22 '09 #4
debasisdas
8,127 Expert 4TB
why not use media player component. you can use all the inbuilt properties and methods.
Apr 23 '09 #5
smartchap
236 100+
Thanks for the reply. As a component it will do all the required things, i.e. its properties and methods could be used. Actually I wanted to know how to use as object.
Apr 24 '09 #6
kadghar
1,295 Expert 1GB
@smartchap
The same as a component. For example if you define the object as an InternetExplorer, it has the VISIBLE property and the NAVIGATE method, so you can do this:

Expand|Select|Wrap|Line Numbers
  1. dim obj1 as object
  2. set obj1 = createobject("internetexplorer.application")
  3. obj1.visible=true
  4. obj1.navigate "www.google.com"
HTH
Apr 24 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Mickel Grönroos | last post by:
Hi! Anybody tried using Windows Media Player 9 via win32com? (And more precisely, combining that with a Tkinter application.) I found a few earlier threads on Windows Media Player and Python,...
1
by: Anise | last post by:
I have a question concerning embedding a windows media player into a web application in .net.. I download Windows Media Player 10 and its SDK On the .ascx page I placed a windows media player...
1
by: Stephen Adam | last post by:
Hi there, Have spent a while trying to find out how to connect to Windows Media Player through COM. Unfortunately there doesnt seem to be much stuff about it on the web. What I need to do is...
3
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...
5
by: Paul Fi | last post by:
I have this code which tries to obtain the number of items in the current playlist of windows media player: private void MainForm_Load(object sender, System.EventArgs e) { // get Window handle...
1
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...
19
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...
2
by: Garrett | last post by:
I'm writing a small program in C# that will sit in the system tray and "monitor" Windows Media Player. I want the program to grab the file name (and checksum) of whatever video a user is playing in...
0
by: artsohc | last post by:
Hey Everyone, this is my first time posting so go easy on me. I am trying to hook up music-on-hold at the office I work at. I got all the music loaded and I got Windows Media Player working while...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.