Pregunta

I'm developing an lyrics related application and I need to listen to Windows Media Player Events. I watched windows events in "Accessible event watcher" and I found out that there's some events that WMP sends whenever it's state or current position changes. I searched and found this article on MSDN a How to set a Windows hook in Visual C# .NET but I couldn't make it work.

How can I listen to that events from my C# application or any suggestions on using other methods to get current song and WMP playing status?\

Thank You

¿Fue útil?

Solución

This article describes how to get the events using the AxWindowsMediaPlayer which is the underlying root of the windows media player system. You will see that the various state change events can be picked up normally.

http://msdn.microsoft.com/en-us/library/windows/desktop/dd562388(v=vs.85).aspx

You should be able to get a running instance from the windows ROT (Running objects table)?

http://www.darinhiggins.com/the-running-instance-of-windows-media-player/

Edit:

This is another way...

http://www.darinhiggins.com/gaining-access-to-a-running-instance-of-windows-media-player-in-vb-net/

Otros consejos

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top