Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: sending WMP messages

  1. #11
    Low Bitrate omar's Avatar
    Join Date
    Dec 2004
    Location
    San Diego
    Posts
    89
    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

  2. #12
    Maximum Bitrate
    Join Date
    Sep 2004
    Posts
    637
    please download wmp sdk, it is free and detailed

  3. #13
    Whistle Tip pimpJ's Avatar
    Join Date
    Apr 2004
    Location
    Metro, TX
    Posts
    523
    Quote 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

  4. #14
    Whistle Tip pimpJ's Avatar
    Join Date
    Apr 2004
    Location
    Metro, TX
    Posts
    523
    Quote 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

  5. #15
    Whistle Tip pimpJ's Avatar
    Join Date
    Apr 2004
    Location
    Metro, TX
    Posts
    523
    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

Page 2 of 2 FirstFirst 12

Similar Threads

  1. WinAmp viz's in FP (i.e. in WMP)
    By NoPistonPC in forum FrodoPlayer
    Replies: 11
    Last Post: 07-26-2004, 03:17 PM
  2. Gapless playback between MP3's in WMP embedded in VB6?
    By CRCinAU in forum Software & Software Development
    Replies: 0
    Last Post: 05-23-2004, 04:40 AM
  3. Question for Developers - Help find WMP bug workaround
    By GingerPrince in forum Software & Software Development
    Replies: 4
    Last Post: 01-14-2004, 02:52 AM
  4. instant messages
    By Sh0cker in forum Mp3car Forum Suggestions/Comments
    Replies: 0
    Last Post: 12-10-2003, 05:41 PM
  5. Interesting Thing With WMP and VB
    By Bj in forum Software & Software Development
    Replies: 1
    Last Post: 10-08-2002, 02:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •