Calling Windows COM or equivalent functions to get information from Windows Media Player (Windows 8.1)

680 views
Skip to first unread message

Frank Blechschmidt

unread,
Oct 23, 2013, 9:00:39 PM10/23/13
to golan...@googlegroups.com
Hello,

is there an example how to get information from the Windows Media Player, e.g. current track infos.
I found this https://github.com/mattn/go-ole but I can't get it work with MediaPlayer.MediaPlayer.1 or WMPlayer.OCX.7
Is there a way or example how to use ActiveX/COM with Go?

Is it possible to call/use IWMPPlayer/IWMPCore/IWMPMedia


There are some code examples in other languages, but I don't know how to translate them. e.g.:

Currently I'm testing https://github.com/lxn/win for media key press simulation, but it would be great to get some information from WMP :)

Best regards
Frank

brainman

unread,
Oct 24, 2013, 12:51:53 AM10/24/13
to golan...@googlegroups.com
On Thursday, 24 October 2013 12:00:39 UTC+11, Frank Blechschmidt wrote:

> ... I found this https://github.com/mattn/go-ole but I can't get it work with MediaPlayer.MediaPlayer.1 or WMPlayer.OCX.7

What is the problem? Have you tried talking to mattn about it?

> ... Is there a way or example how to use ActiveX/COM with Go?


> There are some code examples in other languages, but I don't know how to translate them. e.g.: ...

It looks like these use COM. I have never used COM myself, so I don't know enough about it. But, if you can start with a small program, perhaps some gophers can help you, if you get stuck.

Alex

Lubos Pintes

unread,
Oct 24, 2013, 9:46:26 AM10/24/13
to golan...@googlegroups.com
Hi,
I know nothing about WMP, but for com stuff, I am using
code.google.com/p/com-and-go
It worked well for me.
> --
> You received this message because you are subscribed to the Google
> Groups "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
> golang-nuts...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.


Reply all
Reply to author
Forward
0 new messages