What I would like to do is:
Start playing a playlist in Media Player
Minimise it
Have a way (from any prog of mine) of previous/next song
I am thinking FindWindow to get Media Player's hwnd and using SendMessage to send
a keystroke. The trouble is how do I send ctrl-b or ctrl-f? For that matter, how can I send
a window a key?
I don't want to have to go into the Media Player SDK for such a simple(?) thing... ::)
hi
What are you after? the send apis to play,stop,back...???
G'day ragdog, all I want is back/forward...that's it, since it's on repeat. Is there an API for it?
use this http://www.codeproject.com/csharp/wmp_pinvoke.asp
:U
18808 play
18809 stop
18810 back
18811 forward
ragdog, that link seems perfect, bewdy mate! :U
[a bit later]Just saw your latest post, adds to my understanding (and the value of the link). Champion! :clap:
:bg
if your project finsish post the program? :bg
heh heh if it ever gets beyond the "it works on my machine" stage :bg
not the source the exe
i have self written with winamp :U
Here is some quick, dirty and drunk code...but it works on my machine :bg which is xp home sp2 and mp11 beta.
This is just to see if it works, obviously a slicker gui would help :bdg
Edit: added the exe to the zip
[attachment deleted by admin]
:bg thsi work on my maschine :bdg
here is my source
[attachment deleted by admin]
This is the most brilliant thing, sending a menu-click to a window...
You, ragdog, are a BLOODY LEGEND.
Now, I'll put an app on a timer and use GetAsyncKeyState to control it (just like a game trainer (oops! shh)).
hi sinsi :toothy
this work´s too with GetAsyncKeyState! :8)
have you powerdvd commands?
best regards
ragdog
Old topic, but new info: the same code works in win7beta/mp12 (although fast-forward has changed) but if I run a game as admin (old games, fair enough but new *vista* compatible games? cmon) the keys don't work...unless I run my program as admin too. I've seen stuff about raising privileges via the good old manifest, anyone got one that actually works?
ETA: lay off the beer, sinsi. Topic: Run Elevated (http://www.masm32.com/board/index.php?topic=9422.msg68586#msg68586)
The sad thing is that I posted in that thread...
Revisiting old code, guess who discovered VK_MEDIA_NEXT_TRACK? Much better way of controlling media player and no need for admin privileges.
Sorry about the old thread but I seem to have an affinity for it...
Quoteinclude \asm\win32.inc
???
i tried replacing it with \masm32\include\masm32rt.inc....
MPctrl.asm(6) : error A2008: syntax error : input_dn
MPctrl.asm(7) : error A2008: syntax error : input_up
MPctrl.asm(32) : error A2006: undefined symbol : INPUT
Sorry, I forgot that windows.inc doesn't seem to have the INPUT structure.
KEYBDINPUT struct
wVk dw ?
wScan dw ?
dwFlags dd ?
time dd ?
dwExtraInfo dd ?
KEYBDINPUT ends
MOUSEINPUT struct
_dx dd ?
_dy dd ?
mouseData dd ?
dwFlags dd ?
time dd ?
dwExtraInfo dd ?
MOUSEINPUT ends
HARDWAREINPUT struct
uMsg dd ?
wParamL dw ?
wParamH dw ?
HARDWAREINPUT ends
INPUT struct
_type dd ?
union
ki KEYBDINPUT <>
mi MOUSEINPUT <>
hi HARDWAREINPUT <>
ends
INPUT ends
Also, I use ebx to call an API, my linking happens via _imp__API, just replace "call ebx" with "call API".
What can I say, it's a hack, but 2 of my long-suffering guinea pigs have been using it for a few years now.