Windows Media Player Control in Java. Play, Pause, Stop Commands

Posted on 2005-04-15
Medium Priority
Last Modified: 2008-02-01
I am looking to write a small java program that can run on a windows PC with the sole purpose of controlling windows media player, it only needs to have the ability to launch, stop, play, pause, track on/back. So my question is does java have the ability to do this and if so could the commands/example code be supplied? I am almost certain media player can be manipulated in this way as keyboards have hot keys which work to the same affect, I have seen it written into websites too.

Thank You
Question by:clebond
1 Comment
LVL 15

Accepted Solution

aozarov earned 1000 total points
ID: 13792615
If the media play supports command line options then you can use Runtime.getRuntime().exec(....) to invoke calls as child process.
You can also use java.awt.Robot to send key events to application on your machine.
Or find some library that uses JNI and supports WinAPI integration. e.g jawin (jawinproject.sourceforge.net) or
or http://www.sinotar.com/download/swin/README.html

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question