Announcement

Collapse
No announcement yet.

sending WMP messages

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • sending WMP messages

    Someone well versed in sending messages to WMP (I'm looking at you, Frodo) :
    I've recently downloaded talisman (a shell alteration program, I recommend) and the way they handle WMP is through a side bar but any button presses of that sidebar maximize WMP, somewhat defeating the purpose of having the sidebar.
    I'm not too fluent in Window's handles / sending messages or anything. I'm decent at coding, but not windows specific stuff. Any help/suggestions are appreciated. Here's what the helpfile has to say on the sendmessage command:
    Code:
    Syntax: sendmessage <parameter1> <parameter2> <parameter3> <parameter4> <parameter5>
    
    where:
    parameter1* - Window class name (string);
    parameter2* - Window name (string);
    parameter3 - message to send (integer);
    parameter4 - first Windows Message parameter (integer);
    parameter5 - second Windows Message parameter (integer).
    
    * - Use a "" for names with spaces. Use a nil parameter for not defined names. For example: send Play command to WinAmp player:
    
    sendmessage "Winamp v1.x" nil 273 40045 0
    I've been looking at WMP messages through Winspector Spy (= Spy++) for days and I can't find anything.

    Thanx
    I consider that our present sufferings are not worth comparing with the glory that will be revealed in us.

    www.neoterikos.com

  • #2
    heh, my "member type" (dunno what to call it. It says whistle tip now) changed. DIdn't even notice. When was that ?

    I guess that's what I get for not being here for 2 weeks. I miss things like this.

    I guess I don't feel guilty hijacking my own threads.
    sorry.. back on topic.
    I consider that our present sufferings are not worth comparing with the glory that will be revealed in us.

    www.neoterikos.com

    Comment


    • #3
      Originally posted by pimpJ
      heh, my "member type" (dunno what to call it. It says whistle tip now) changed. DIdn't even notice. When was that ?

      I guess that's what I get for not being here for 2 weeks. I miss things like this.

      I guess I don't feel guilty hijacking my own threads.
      sorry.. back on topic.
      About two weeks ago.
      [H]4 Life
      My next generation Front End is right on schedule.
      It will be done sometime in the next generation.
      I'm a lesbian too.
      I am for hire!

      Comment


      • #4
        Well that code is for winamp, but wmp would be similar, however
        I don't know of any specific windows messages for wmp, but
        I also haven't looked.
        [H]4 Life
        My next generation Front End is right on schedule.
        It will be done sometime in the next generation.
        I'm a lesbian too.
        I am for hire!

        Comment


        • #5
          Originally posted by frodobaggins
          About two weeks ago.
          fascinating
          I consider that our present sufferings are not worth comparing with the glory that will be revealed in us.

          www.neoterikos.com

          Comment


          • #6
            Originally posted by frodobaggins
            Well that code is for winamp, but wmp would be similar, however
            I don't know of any specific windows messages for wmp, but
            I also haven't looked.
            alright, anyone else ?
            I consider that our present sufferings are not worth comparing with the glory that will be revealed in us.

            www.neoterikos.com

            Comment


            • #7
              bump ?
              I consider that our present sufferings are not worth comparing with the glory that will be revealed in us.

              www.neoterikos.com

              Comment


              • #8
                You don't communicate with windows media player through windows messages. You use more powerful COM controls. You can fake it by sending WM_LBUTTONDOWN messages to the play button, but its not very reliable and won't work if the window is offscreen. Theres nothing specificly for say playing a file by sending a WM_PLAY message or something like that. The only way around it I can see is to write your own wrapper app that will accept custom messages and embed a WMP control that will be controlled when it recieves the messages.
                StreetDeck.com Developer (I am Chuck)
                Get StreetDeck at http://www.streetdeck.com
                The Official StreetDeck Forums have moved, please visit us at http://www.streetdeck.com/forum for official support for Streetdeck.

                Comment


                • #9
                  yikes.. that sounds like an overkill.

                  I assume there's another way to do it. For instance, in firefox, there's a media player extension that allows me to control WMP. (without maximization or anything)
                  I consider that our present sufferings are not worth comparing with the glory that will be revealed in us.

                  www.neoterikos.com

                  Comment


                  • #10
                    http://msdn.microsoft.com/library/de..._reference.asp
                    is this a step in the right direction ?
                    I consider that our present sufferings are not worth comparing with the glory that will be revealed in us.

                    www.neoterikos.com

                    Comment


                    • #11
                      What you need are the actual messages to send (parameter 3). Parameters 4 and 5 should be optional. Here's the constants for Media Player when I develop in vb:

                      Const MEDIA_NEXTTRACK = 11
                      Const MEDIA_PREVIOUSTRACK = 12
                      Const MEDIA_STOP = 13
                      Const MEDIA_PLAY_PAUSE = 14

                      Use these in sendmessages this way. To send the stop message:

                      sendmessage "WMPlayerApp" "Windows Media Player" 13 0 0

                      Here's a simple vb6 app that demonstrates the same:
                      Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
                      Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long


                      Const WM_APPCOMMAND = &H319
                      Const HWND_BROADCAST = &HFFFF
                      Const MEDIA_NEXTTRACK = 11
                      Const AMEDIA_PREVIOUSTRACK = 12
                      Const MEDIA_STOP = 13
                      Const MEDIA_PLAY_PAUSE = 14

                      Private Sub Button_STOP()
                      Dim hwnd As Long

                      hwnd = FindWindow("WMPlayerApp", "Windows Media Player")
                      If hwnd <> 0 Then
                      SendMessage hwnd, WM_APPCOMMAND, hwnd, _
                      ByVal (MEDIA_PLAY_PAUSE * &H10000)
                      End If

                      End Sub
                      MyMedia Website

                      Comment


                      • #12
                        please download wmp sdk, it is free and detailed

                        Comment


                        • #13
                          Originally posted by dragonBTV
                          please download wmp sdk, it is free and detailed
                          I've had it. It had nothing of this sort
                          I consider that our present sufferings are not worth comparing with the glory that will be revealed in us.

                          www.neoterikos.com

                          Comment


                          • #14
                            Originally posted by omar
                            What you need are the actual messages to send (parameter 3). Parameters 4 and 5 should be optional. Here's the constants for Media Player when I develop in vb:

                            Const MEDIA_NEXTTRACK = 11
                            Const MEDIA_PREVIOUSTRACK = 12
                            Const MEDIA_STOP = 13
                            Const MEDIA_PLAY_PAUSE = 14

                            Use these in sendmessages this way. To send the stop message:

                            sendmessage "WMPlayerApp" "Windows Media Player" 13 0 0

                            Here's a simple vb6 app that demonstrates the same:
                            Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
                            Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long


                            Const WM_APPCOMMAND = &H319
                            Const HWND_BROADCAST = &HFFFF
                            Const MEDIA_NEXTTRACK = 11
                            Const AMEDIA_PREVIOUSTRACK = 12
                            Const MEDIA_STOP = 13
                            Const MEDIA_PLAY_PAUSE = 14

                            Private Sub Button_STOP()
                            Dim hwnd As Long

                            hwnd = FindWindow("WMPlayerApp", "Windows Media Player")
                            If hwnd <> 0 Then
                            SendMessage hwnd, WM_APPCOMMAND, hwnd, _
                            ByVal (MEDIA_PLAY_PAUSE * &H10000)
                            End If

                            End Sub
                            THank U very much. Let me check that out
                            I consider that our present sufferings are not worth comparing with the glory that will be revealed in us.

                            www.neoterikos.com

                            Comment


                            • #15
                              not working.. any other ideas/variations on wht U gave me ?
                              I consider that our present sufferings are not worth comparing with the glory that will be revealed in us.

                              www.neoterikos.com

                              Comment

                              Working...
                              X