Catching MediaMonkey events in C#. Again.

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey.

Moderator: Gurus

Posts: 1
Joined: Tue Jan 12, 2010 6:23 pm

Catching MediaMonkey events in C#. Again.

Post by VolkerK » Tue Jan 12, 2010 6:50 pm

Hello all,

surfed this forum, but only found non-working examples (a lot) or confusing ones, which I cannot use to put my thing to work. I want to write a C# application and catch the events in media monkey, for example by code like this:

Code: Select all

    public partial class frmMain : Window
        public SongsDB.SDBApplication mmapp;

        public frmMain()

            mmapp = new SongsDB.SDBApplication();
            mmapp.ShutdownAfterDisconnect = false;

            mmapp.OnChangedSelection += new SongsDB.ISDBApplicationEvents_OnChangedSelectionEventHandler(mmapp_OnChangedSelection);
            mmapp.OnPlay += new SongsDB.ISDBApplicationEvents_OnPlayEventHandler(mmapp_OnPlay);

        void mmapp_OnPlay()
                // do something

        void mmapp_OnChangedSelection()
                // do something
It works like this with other COM/ActiveX enabled applications I'm working with (e.g. Skype), but not in MM. What am I doing wrong? And questions to the MediaMonkey developers: what did they do differently that it is so easy in scripting host but so confusing in .NET? Could somebody rewrite me my example in a way which will work? Tested? (Or do I need the Gold version... :-) )


Posts: 339
Joined: Mon Aug 18, 2008 9:46 am
Location: Philadelphia, PA, US

Re: Catching MediaMonkey events in C#. Again.

Post by Melloware » Wed Jan 13, 2010 1:15 pm

The only way I have seen it solved is in .NET by using a COM object and registering that COM object of your out of process app in MM itself.

See this thread: ... nts#p69933

You can download and look at the MonkeyToys source code for a working example....
Melloware Inc.
MonkeyTunes - DACP Server for MediaMonkey
Intelliremote - Take Back Control of your HTPC!

Post Reply