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

Posted on 2005-04-15
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

    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 ( or

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Title # Comments Views Activity
    twoTwo  challenge 35 71
    canBalance challenge 34 55
    JVM encoding. How to change encoding. 27 48
    computer science syllabus 3 37
    For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
    Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
    Video by: Michael
    Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
    Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now