Getting current game song from Windows Media Player using python

For the program I am writing, I need to get the current song from the Windows media player.

I searched a lot on googled, but all I found was to play VIA Windows Media Player music and get information from it.

What I specifically want, someone has WMP open, and he has a song. I need to get the name of this song.

I tried

import win32com.client wmp = win32com.client.gencache.EnsureDispatch('WMPlayer.OCX') 

However, this does not control and does not do anything with the currently open instance of wmp.

I also found something about using wmp.dll with ctypes, but I have no idea where to look or what to do with it. Associated-source: http://msdn.microsoft.com/en-us/library/windows/desktop/dd564585(v=vs.85).aspx

Can anyone shed some light on this? There were some other posts about the same issue, but they really don't help me.

+4
source share

Source: https://habr.com/ru/post/1486057/


All Articles