问题
at Windows 10 there is a Music Feature(Pic Below):
So my Question is: How can I access this information with C# and which libraries do i need?
Thanks for helping
回答1:
Excuse me for my ignorance, but if I am correct, this widget is a pop up of Spotify, isn't this? In that case, you only have to check the MainWindowsTitle of spotify process.
var spotify = Process.GetProcessesByName("Spotify");
foreach (var song in spotify)
{
Console.WriteLine(song.MainWindowTitle);
}
Console.ReadLine();
Don't forget use using System.Diagnostics;
. You will have to check if you don't get any song.
I was checking if this method works yet :)
来源:https://stackoverflow.com/questions/44526944/c-sharp-how-to-access-the-current-playback-of-windows