MyHomieJR
MyHomieJR

Reputation: 75

C# How to access the current playback of windows

at Windows 10 there is a Music Feature(Pic Below): Music Feature

So my Question is: How can I access this information with C# and which libraries do i need?

Thanks for helping

Upvotes: 1

Views: 650

Answers (1)

user5134936
user5134936

Reputation:

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 :) enter image description here

Upvotes: 1

Related Questions