To retrieve currently playing media on Windows in C#, you can use the Windows Media Player API. Here's a code snippet that demonstrates how to retrieve the current media being played:
main.cs867 chars31 lines
Note that you will need to add a reference to the "Windows Media Player" COM component in your C# project in order to use the WMPLib
namespace. You can do this by right-clicking on your project in Visual Studio, selecting "Add > Reference...", and navigating to "Windows Media Player" in the COM tab.
gistlibby LogSnag