Jump to content

Windows Media controler


Recommended Posts

ok heres what im looking for,i need something to control windows media player while its minimized, i need it to do a few simple things: Next song, Previous song, Pause, play, etc.. the basics. and have them as preset hotkeys. Any help is needed.

Link to comment
Share on other sites

I found these... you can use Send() ( for xp/2000 only )

VK_MEDIA_NEXT_TRACK (B0)

Windows 2000/XP: Next Track key

VK_MEDIA_PREV_TRACK (B1)

Windows 2000/XP: Previous Track key

VK_MEDIA_STOP (B2)

Windows 2000/XP: Stop Media key

VK_MEDIA_PLAY_PAUSE (B3)

Windows 2000/XP: Play/Pause Media key

8)

NEWHeader1.png

Link to comment
Share on other sites

sorry, im very newbie to autoit, is this right?? i dont know how to do these lol:

Hotkeyset( "7" "@prev" )
hotkeyset( "9" "@next" )
HotKeySet( "8" "@stop" )
hotkeyset( "5" "@play" )

IF _Ispressed( "@prev" )
 Then 
 Send( "VK_MEDIA_PREV_TRACK")
 Or  _ispressed( "@next" )
    Send( "VK_MEDIA_NEXT_TRACK" )
 Or  _ispressed( "@stop" )
    Send( "VK_MEDIA_STOP" )
 Or  _ispressed( "@play" )
    Send( "VK_MEDIA_PLAY_PAUSE" )

EndIf

EDIT: ok i KNOW its wrong cuz it says error If statement needs THEN keyword, but i have one, what did i do wronghere??

EDIT2: i realized i put @play when i shoudl have had $play, does that make a difference?? ill try it.

EDIT3: grr nope :o someone help here, getting angry

Edited by go0b3r
Link to comment
Share on other sites

after reading some stuff i changed it a bit, but its not working still:

If _IsPressed("67") Then
 Send("VK_MEDIA_PREV_TRACK")
 ElseIf  _ispressed( "69" )
    Send("VK_MEDIA_NEXT_TRACK")
 ElseIf  _ispressed( "68" )
    Send("VK_MEDIA_STOP")
 ElseIf  _ispressed( "65" )
    Send("VK_MEDIA_PLAY_PAUSE")

EndIf
Edited by go0b3r
Link to comment
Share on other sites

this is my complete script, what am i missing??

#include <misc.au3>

If _IsPressed("67") Then
 Send("VK_MEDIA_PREV_TRACK")
 ElseIf  _IsPressed( "69" ) Then
    Send("VK_MEDIA_NEXT_TRACK")
 ElseIf  _IsPressed( "68" ) Then
    Send("VK_MEDIA_STOP")
 ElseIf  _IsPressed( "65" ) Then
    Send("VK_MEDIA_PLAY_PAUSE")

EndIf
Link to comment
Share on other sites

If that's your complete script, you'll never get a chance to press the keys because it just starts and ends. Put the whole thing in a While 1 / Wend loop to keep it going. Plus, what keys are 65, 67, 68, and 69?

By whole thing I mean the IsPressed stuff.. don't put the include in the loop....

Edited by greenmachine
Link to comment
Share on other sites

ok got a problem, how do i make it send the command "VK_MEDIA_PREV_TRACK"?? i wasn't thinking but when i did it it just SENDS VK_MEDIA_PREV_TRACKVK_MEDIA_PREV_TRACKVK_MEDIA_PREV_TRACKVK_MEDIA_PREV_TRACKVK_MEDIA_PREV_TRACKVK_ME

DIA_PREV_TRACK like that lol, heres whati got.

#include <misc.au3>

While 1
    If _IsPressed("67") Then
     Send("VK_MEDIA_PREV_TRACK")
         ElseIf  _IsPressed( "69" ) Then
     Send("VK_MEDIA_NEXT_TRACK")
         ElseIf  _IsPressed( "68" ) Then
     Send("VK_MEDIA_STOP")
         ElseIf  _IsPressed( "65" ) Then
     Send("VK_MEDIA_PLAY_PAUSE")
 EndIf
 Wend
Link to comment
Share on other sites

im guessing i probably need to set up a function for each of the : VK_MEDIA_PREV_TRACK things, btw i took out the "s and it doesn't type them, but it says error parsing function call. Am i correct in assuming this means that each VK_MEDIA_PREV_TRACK needs to be set up in a function? Can someone give a basic example of a correct function statement, i dont konw how to do them. I mean i looked it up but i dont know how to put my info in. also how do i get the send(VK_MEDIA_PREV_TRACK) to know look for the function? do i have to make a variable? i dont know how to do that either lol. help plz

Link to comment
Share on other sites

Put them in curly brackets.

#include <misc.au3>

While 1
    If _IsPressed("67") Then
     Send("{VK_MEDIA_PREV_TRACK}")
         ElseIf  _IsPressed( "69" ) Then
     Send("{VK_MEDIA_NEXT_TRACK}")
         ElseIf  _IsPressed( "68" ) Then
     Send("{VK_MEDIA_STOP}")
         ElseIf  _IsPressed( "65" ) Then
     Send("{VK_MEDIA_PLAY_PAUSE}")
EndIf
Wend
Edited by greenmachine
Link to comment
Share on other sites

Put them in curly brackets.

#include <misc.au3>

While 1
    If _IsPressed("67") Then
     Send("{VK_MEDIA_PREV_TRACK}")
         ElseIf  _IsPressed( "69" ) Then
     Send("{VK_MEDIA_NEXT_TRACK}")
         ElseIf  _IsPressed( "68" ) Then
     Send("{VK_MEDIA_STOP}")
         ElseIf  _IsPressed( "65" ) Then
     Send("{VK_MEDIA_PLAY_PAUSE}")
EndIf
Wend

i tried your script and it didnt work for me, so i did this..

#include <misc.au3>

HotKeySet("{NUMPAD4}", "prevtrack")
HotKeySet("{NUMPAD5}", "pausetrack")
HotKeySet("{NUMPAD6}", "nexttrack")
HotKeySet("{NUMPAD8}", "stoptrack")


While ProcessExists("wmplayer.exe")
    Sleep(100)
Wend

func prevtrack()
    Send("{MEDIA_PREV}")
EndFunc
 
func nexttrack()
    Send("{MEDIA_NEXT}")
EndFunc

func stoptrack()
    Send("{MEDIA_STOP}")
EndFunc

func pausetrack()
    Send("{MEDIA_PLAY_PAUSE}")
EndFunc
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...