开发者

How can I control an instance of Windows Media Player in c#?

开发者 https://www.devze.com 2023-01-04 18:11 出处:网络
I\'m trying to control windows media player in c#. That means, I want to be able to programmically play songs. To reiterate, I\'m talking about the full version of WMP, not the component you can embed

I'm trying to control windows media player in c#. That means, I want to be able to programmically play songs. To reiterate, I'm talking about the full version of WMP, not the component you can embed into a windows form. I can launch the WMP process just fine, the problem comes in actually controlling it as I can't think of any keypresses I can send to the player tha开发者_如何学编程t would tell it to select a song and play music. I can do this in iTunes just fine by sending a spacebar key-press to the process, but not so in Windows Media Player. Does anyone have any ideas as per how I can control widows media player programmically in C#? Is there a special command I can send to the process to complete this task?


Here is a link do how to interact with WMP using p/invoke...

This is a question that's almost identical to this one that has already been answered in Stack Overflow.

0

精彩评论

暂无评论...
验证码 换一张
取 消