go0b3r Posted March 5, 2006 Share Posted March 5, 2006 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 More sharing options...
Valuater Posted March 5, 2006 Share Posted March 5, 2006 this guy is working on that alsohttp://www.autoitscript.com/forum/index.ph...opic=19472&hl=#8) Link to comment Share on other sites More sharing options...
Valuater Posted March 5, 2006 Share Posted March 5, 2006 I found these... you can use Send() ( for xp/2000 only )VK_MEDIA_NEXT_TRACK (B0) Windows 2000/XP: Next Track keyVK_MEDIA_PREV_TRACK (B1) Windows 2000/XP: Previous Track keyVK_MEDIA_STOP (B2) Windows 2000/XP: Stop Media keyVK_MEDIA_PLAY_PAUSE (B3) Windows 2000/XP: Play/Pause Media key8) Link to comment Share on other sites More sharing options...
go0b3r Posted March 5, 2006 Author Share Posted March 5, 2006 (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 someone help here, getting angry Edited March 5, 2006 by go0b3r Link to comment Share on other sites More sharing options...
go0b3r Posted March 5, 2006 Author Share Posted March 5, 2006 (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 March 5, 2006 by go0b3r Link to comment Share on other sites More sharing options...
go0b3r Posted March 5, 2006 Author Share Posted March 5, 2006 says: IF _IsPressed("67") Then IF ^ERROR Error: Unknown function name. but i looked it up and its done right i think. grr Link to comment Share on other sites More sharing options...
greenmachine Posted March 5, 2006 Share Posted March 5, 2006 You need beta to use _IsPressed. If you have beta, you need to #include <misc.au3>. Link to comment Share on other sites More sharing options...
go0b3r Posted March 5, 2006 Author Share Posted March 5, 2006 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. Link to comment Share on other sites More sharing options...
go0b3r Posted March 5, 2006 Author Share Posted March 5, 2006 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 More sharing options...
greenmachine Posted March 5, 2006 Share Posted March 5, 2006 (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 March 5, 2006 by greenmachine Link to comment Share on other sites More sharing options...
go0b3r Posted March 5, 2006 Author Share Posted March 5, 2006 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. Link to comment Share on other sites More sharing options...
go0b3r Posted March 5, 2006 Author Share Posted March 5, 2006 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 More sharing options...
go0b3r Posted March 5, 2006 Author Share Posted March 5, 2006 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 More sharing options...
greenmachine Posted March 5, 2006 Share Posted March 5, 2006 (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 March 5, 2006 by greenmachine Link to comment Share on other sites More sharing options...
skippynz Posted March 5, 2006 Share Posted March 5, 2006 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 More sharing options...
go0b3r Posted March 5, 2006 Author Share Posted March 5, 2006 damn its not working! it just types V over and over when i open notepad. Valuater are you sure those commands are right?? Link to comment Share on other sites More sharing options...
skippynz Posted March 5, 2006 Share Posted March 5, 2006 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 Link to comment Share on other sites More sharing options...
go0b3r Posted March 5, 2006 Author Share Posted March 5, 2006 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. Link to comment Share on other sites More sharing options...
Oxin8 Posted March 6, 2006 Share Posted March 6, 2006 In the AutoIt help file. AutoIt->Function Reference->Keyboard Control->Send Then scroll down. ~My Scripts~ *********_XInput UDF for Xbox 360 ControllerSprayPaint_MouseMovePlus Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now