Sign in to follow this  
Followers 0
go0b3r

Windows Media controler

19 posts in this topic

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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

says:

IF _IsPressed("67") Then

IF ^ERROR

Error: Unknown function name.

but i looked it up and its done right i think. grr

Share this post


Link to post
Share on other sites

You need beta to use _IsPressed. If you have beta, you need to #include <misc.au3>.

Share this post


Link to post
Share on other sites

erm [confused] ok well i did that but now i go ot run and nothing happens, no error, nothing. doesn't open it at all.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

65 = numpad 5, 67 = Numpad 7 68=numpad 8 69=numpad 9, and ty, ill try to put it in a while thing, thats something ive never tried lol but here it goes. :o

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

damn its not working! it just types V over and over when i open notepad. Valuater are you sure those commands are right??

Share this post


Link to post
Share on other sites

damn its not working! it just types V over and over when i open notepad. Valuater are you sure those commands are right??

try my script i added on the first page, must have been typing it as your were typing your post

Share this post


Link to post
Share on other sites

tyvm, lol i didn't even think to check if someoen had posted on pg 1 lol it works perfectly. how do you get those code things though, for future reference. like the MEDIA_STOP thing.

Share this post


Link to post
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
Sign in to follow this  
Followers 0