AutoHotkey Community

It is currently May 27th, 2012, 1:22 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: August 22nd, 2008, 10:18 pm 
Offline

Joined: August 22nd, 2008, 10:05 pm
Posts: 4
I've searched the forums with no luck in finding hot keys for windows media player when it has been minimized to the task bar. Since my coding skills are limited, here's my work around for WMP hot keys:

Code:
;--WMP Minimized to Taskbar Hotkeys--

;Next Track
<!c::
coordmode, mouse, Screen
MouseGetPos, xpos, ypos
mouseclick,left,3125,1035
MouseMove, xpos, ypos
return

;Previous Track
<!z::
coordmode, mouse, Screen
MouseGetPos, xpos, ypos
mouseclick,left,3081,1035
MouseMove, xpos, ypos
return

;Play/Pause Track
<!x::
coordmode, mouse, Screen
MouseGetPos, xpos, ypos
mouseclick,left,3105,1035
MouseMove, xpos, ypos
return


Essentially, the script performs the following actions:
1. grabs the current mouse position
2. moves the mouse to an absolute screen position and clicks
3. returns the mouse to its previous position

The screen coordinates of the next track, previous track, and play/pause buttons can be found using Window Spy. Substitute those coordinates in for those listed above.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2008, 11:04 pm 
Offline

Joined: May 12th, 2008, 2:23 pm
Posts: 30
Location: Germany
Take a look at
http://www.autohotkey.com/docs/misc/SendMessage.htm

Code:
;Play / Pause
PostMessage, 0x111, 32808, 0, , Windows Media Player

;Stop
PostMessage, 0x111, 32809, 0, , Windows Media Player

;Previous Track
PostMessage, 0x111, 32810, 0, , Windows Media Player

;Next Track
PostMessage, 0x111, 32811, 0, , Windows Media Player


More wParams:
32834 - Play Speed: Fast
32835 - Play Speed: Normal
32836 - Play Speed: Slow

32815 - Volume Up
32816 - Volume Down
32817 - Volume Mute (toggle)

32842 - Shuffle (toggle)
32843 - Repeat (toggle)

32779 - Open "Properties" dialog
32780 - View Full Mode
32781 - View Compact Mode
32782 - Full screen (toggle)

32783 - Show/Hide Playlist (toggle)
32787 - Show/Hide Media Information (toggle)
32789 - Show/Hide Equilizer (toggle)
32791 - Show/Hide Title (toggle)

19721 - Show Menu Bar
19722 - Hide Menu Bar
19723 - Autohide Menu Bar
19724 - Hide Taskbar (toggle)


Report this post
Top
 Profile  
Reply with quote  
PostPosted: August 23rd, 2008, 5:53 am 
Offline

Joined: August 22nd, 2008, 10:05 pm
Posts: 4
WMP can be minimized to the taskbar or minimized to become a toolbar (i.e. beneath the taskbar). I have tried these commands and others while WMP is minimized to a toolbar and I have found only the mouseclick commands to work.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Another idea
PostPosted: October 14th, 2008, 12:45 pm 
You could always try the media key bindings.

Code:
<!c::Media_Next
<!z::Media_Prev


Not sure is they will work with a completely non media keyboard. Mine has media buttons but does not have next and prev track.

The above works on it as when as toolbar as it sends the global media next and prev commands that should always go to WMP when it is running.

Hope it helps


Report this post
Top
  
Reply with quote  
 Post subject: p.s.
PostPosted: October 14th, 2008, 12:48 pm 
P.s. the rest of the keys available can be found here

http://www.autohotkey.com/docs/KeyList.htm

Though the ones your probably interested in are:
Media_Next
Media_Prev
Media_Stop
Media_Play_Pause

cheers


Report this post
Top
  
Reply with quote  
 Post subject: It Works!!!
PostPosted: October 14th, 2008, 3:07 pm 
Offline

Joined: August 22nd, 2008, 10:05 pm
Posts: 4
Wow, that was a simple fix. It works perfectly. Thanks for the link to the key list...that will be helpful in future projects.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bon and 12 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group