Search code examples
c#pinvokewmp

get status info Windows Media Player (stand-alone application)


I want to write an application which gets the status information about a running WMP thread, like playing/paused, shuffle mode on/off, repeat on/off, song title or media file path.

I was using the P/Invoke SendMessage-function to "simulate" a click on the play/pause/stop etc. buttons, but I'm unable read the values of labels/text boxes inside the WMP application with WM_GETTEXT.
I used Spy++ to get the handles of certain text fields - but they (obviously) change their handle after restarting the WMP.

Does somebody know a answer to this Problem?

It could be anything - P/Invoke or SendKeys - but not this AxWindowsMediaPlayer, because my application is a console app and I want the status information of the external process - not of my own.

Thanks


Solution

  • I will mark this thread as 'answered'.

    I have solved this problem a few months ago, but lost the source code.
    The aim of this application is to control the WMP via sshd or telnet. You can download the binaries here if you want to:

    WMP.rar (27 KB)
    https://mega.co.nz/#!ug5DySRR!rQlI9OZZ8wYq7yAqaH-KYsmCl9LSaBjNdvqX0g_WDtI

    The application is executed via console. You can see the commands by typing >wmp help