No announcement yet.

Controlling Winamp from a Application written in C#

  • Filter
  • Time
  • Show
Clear All
new posts

  • Controlling Winamp from a Application written in C#


    I'm trying to add files into Winamp's playlist using the WinApi command "SendMessage" from a Application written in C#. All my attempts were unsuccessful.

    Can somebody help me?



    p.s.: Sorry! My english is disastrous...

  • #2
    You are using messages that only can be use in process, like plugins... Search the forums for WinampMagic...


    I remember this

    * PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
    * Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.


    • #3
      I'm actually writing a partial C# Winamp SDK , which is comming along well, it will work for all .NET languages using the .NET 2.0 framework.
      I will post it when it will be finished along with source code, so you can add features (or API's) it lacks.
      If your interested , stay tuned ,it won't be long !


      • #4
        Regarding the C# SDK :
        I've implemented sending commands to winamp , and enque files, now I'll get started on the "ML_SDK" for the media library and probably in late december or early January I'll upload a stable alpha.

        Don't forget to send me ideeas or features you'd like to see in the C# SDK,



        • #5
          i was writing something along those lines, i got it to add files through sendmessage, i have some sloppy code for it if you want.


          • #6
            You can find a pre-Alpha release at sourceforge C# WinampSDK
            If you'd like to contribute with ideeas or source code the best way (the fastest at least) would be an e-mail to [email protected] .

            For now I would like to review all the code myself , so if you have any code you'd like me to see, send it to me and it might get in the "distro".

            A proper alpha might be available before february and a Release by march.

            Hope this helps , Enjoy !



            • #7
              Well use the System.Diagonistic.ProcessStart(params..) and pass in command lines to the winamp,

              you can detect if winamp is installed and get its path from the following registry key HKEY_CURRENT_USER\Software\Winamp

              Read this:
              By simply calling winamp.exe with various command line options, you do a number of things. For example:

              C:\path\to\winamp\winamp.exe /ADD C:\mp3\whatever.mp3
              (Adds C:\mp3\whatever.mp3 to the playlist of a running Winamp, if Winamp is running, otherwise it opens Winamp and plays it outright)

              hope it helped,
              Dayson Pais


              • #8
                I have found a very good solution to the problem using marshaling. This is the best way to call unmanaged code from the NET plattform. The NET-Framework provides many classes for this purpose. This way is more effectiv than using command lines and it supports the transfer of any type of parameters. If you are interested in the sources, I could show you many examples.

                Best regards


                • #9
                  Would you be willing to send me the source-code of your work? I'm fiddling with some C# plugins and having issues with the interface between my managed code and winamp.

                  winampdevstuff at


                  • #10

                    hier is my wrapper as thread saved singleton.
                    The class has only 4 puclic static methods to open winamp, to play or enqueue a file and to stop winamp.
                    The implementation all another commands is similar.

                    When you have to call commands that take one or more parameters, you must allocate unmanaged memory to pass the parameters and free the memory after the use.

                    I use 2 instances of Winamp to play and monitoring my music, because the public methods take a player number as parameter, but you can change it.

                    Good luck!
                    Attached Files


                    • #11
                      Thanks, it looks much like the class I built myself.

                      Sadly it doesnt do what I need to do though which is to fetch the visualization data.

                      I guess I cant avoid using c++ for that unfortunately