WMP comes with an automation compatible object model, that means you can
control Media Player from any language that supports COM automation.
To use it from C#, you simply need to
- add a COM reference to "Windows Media Player" (wmp.dll),
- add a using directive like:
using WMPLib;
and you can access the OM like this:
WindowsMediaPlayer mediaPlayer = new WindowsMediaPlayerClass();
mediaPlayer .openPlayer(@"someMediaFile");
....
Willy.
"Anand Ganesh" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Peter,
>
> I am trying to control Windows Media Player from a seperate .NET
> Application.
>
> I am using Windows 32 API.
>
> SendKeys is for Windows Forms but using this I cannot access a different
> process.
>
> Please let me know whether I am missing something here.
>
> I thought only Windows 32 API is the best way to access another process.
>
> Thanks for your time.
>
> Regards
> Anand Ganesh
>
>
> "Peter Duniho" <(E-Mail Removed)> wrote in message
> news
(E-Mail Removed)...
>> On Tue, 19 Feb 2008 11:41:48 -0800, Anand Ganesh
>> <(E-Mail Removed)> wrote:
>>
>>> I want to give a Windows 32 API SendMessage command to Windows Media
>>> Player
>>> and Pause it or Play it.
>>>
>>> The shortcut command is Control-P.
>>
>> You might instead find the SendKeys class preferable.
>>
>> Pete
>
>