No announcement yet.

Winamp Application Programming Interface - Discussion

  • Filter
  • Time
  • Show
Clear All
new posts

  • Winamp Application Programming Interface - Discussion

    Many Thanks!

    Mas Tequila!
    Idiot's Advocate
    My site (under construction)

  • #2
    Hrm is there not a WM_COMMAND for mute? Or any other way to mute for that matter?


    • #3
      mute is a feature of the windows volume control panel? send that a WM_COMMAND instead?


      • #4
        I am trying to control winamp 5 from a application and i have problems using SendMessage: everything seems to work except I don't get results either for WM_USER nor WM_COMMAND stuff.
        It seems strange to me that the hwnd is always between something like 364673202778132480 and 372391402778132480 ...

        Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

        Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

        'function ...

        Dim hwndWinamp As Long = FindWindow("waam1.2.1", vbNullString)
        'having called winamp with the parameter /CLASS="waam1.2.1"
        'otherwise FindWindow("winamp v1.x", vbNullString) ?

        SendMessage(hwndWinamp, 273, 40029, 0) 'should pop up some window
        SendMessage(hwndWinamp, 1024, 128, 122) 'should set volume to 50%
        'nothing works!
        'end function
        'btw. WM_USER=1024=h400, WM_COMMAND=273=h111


        • #5
          Do you know if winamp can be accesed/controlled using java


          • #6
            i am not good at java, but i guess there should be some windows api library for java so yes it should be possible.


            • #7
              Do you have any idea where I could find out how to to make a plugin in java


              • #8
                try a java forum ???


                • #9
                  Like 4rfvgz7tdfght4 I am not getting the correct window handle back from FindWindow. The number it returns is a constantly increasing number so it clearly isn't returning the right value. Any help on figuring out why FindWindow doesn't seem to work properly would be great.


                  • #10
                    Is there any way to hook onto the play function in this API?

                    I'd like to intercept whenever the PLAY button is pushed, whenever the hotkey for PLAY is used, whenever PLAY is pushed on the Playlist editor, and whenever the Playback option is selected from the context menu.

                    Has anyone achieved any of these?



                    • #11
                      Dave: you need to subclass the main window and look for the second winamp button being pressed (id is in the sdk) under the wm_command message and also the relevant key in the wm_keydown message (which covers all areas i think - no access to any of my source code at the moment but i'm sure that's what i do when i track it)

                      Squirrelinabox: FindWindow("Winamp v1.x","") should be working (does for me) so really not sure why the issues, maybe it's a vb thing, dunno

                      WACUP Project <‖> "Winamp Ramblings" - Indie Winamp Dev Blog


                      • #12
                        To 4rfvgz7tdfght4 and Squirrelinabox (If you still have trouble):
                        The declaration of FindWindow is wrong, it should look like this:
                        Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer

                        The same is for SendMessage which shold look like this:
                        Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef lParam As Object) As Integer

                        Long is used in Windows API calls when you use VB6 but not in VB.NET
                        Look here for Windows API reference for VB.NET.

                        I have done this myself in VB.NET but I changed to C# when I wanted to make a function that adds tracks to playlist due to problems with pointers.

                        Hope this will fix your problems.
                        // Anders


                        • #13
                          HUGE thanks to anderslinder. That was the problem... was using Long everywhere. Somebody should add the note about using integers for .net here so some people don't get mixed up like me

                          Everything works perfect now... thanks again, I was getting very frustrated... thought i tried everything, its those damn simple little things you overlook that bite you in the butt


                          • #14
                            included in the sticky


                            • #15
                              will update the sdk to include that as well when i get the chance over the next week

                              WACUP Project <‖> "Winamp Ramblings" - Indie Winamp Dev Blog