
I have just a small problem with the usage under Windows 7 x64. I setup four actions (play/pause, show/hide, previous and next) but only the first two are working with Windows Media Player.
Previous and next don't jump to another song, they just jump inside the current song.

It's really strange, at Home W7/64 Pro and WMP v12.0.7601.18150 it works but at work, same OS and WMP version it doesn't.
I already thought of some program maybe interfering with the combo Win+Ctrl+F3 and Win+Ctrl+F4 but I don't know one using this.

Okay, I found the cause but no idea why.
If I change Win+Ctrl+... to Win+Shift+... it works. Looks like at work there is a program using Win+Ctrl combos installed. But only some because Win+Ctrl+F1 for play/pause is working.
Thanks for the help.


I use this one:
http://mplayer-ww.com/eng/
I did try to get that one to work in the past but was unable to. This is a common problem with "front-end" type of players such as this one. SMPlayer and MPUI are two other mplayer front-ends that I haven't been able to get to work. The problem is exacerbated when those front-ends use custom skins instead of regular controls.
Now, that being said, if you have some AutoHotkey code that you happen to use that DOES control mplayer-WW, I'd be happy to test it out and add the support to MPH.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;|---------------|
;|--[ SOURCES ]--|
;|---------------|
;Base Spotify Script from: http://www.autohotkey.com/board/topic/36239-spotify-global-hotkeys/
;Base Starring Script from: http://superuser.com/questions/324416/any-spotify-tweaks-with-keyboard-shortcut-to-star-tracks
;|------------------|
;|--[ SETTING UP ]--|
;|------------------|
DetectHiddenWindows, On ;Detect Spotify even if it's minimized
#IfWinExist ahk_class SpotifyMainWindow ;Only do the following if Spotify is running
spotify = ahk_class SpotifyMainWindow ;Set variable for Spotify Window Name
;|---------------|
;|--[ HOTKEYS ]--|
;|---------------|
; "F5" for previous
F5::
{
ControlSend, ahk_parent, ^{Left}, %spotify%
return
}
; "F6" for next
F6::
{
ControlSend, ahk_parent, ^{Right}, %spotify%
return
}
; "F4" for pause
F4::
{
ControlSend, ahk_parent, {Space}, %spotify%
return
}
; "F10" for track-name
F10::
{
WinGetTitle, spotify_playing, %spotify% ;Get the title of Spotify which contains the track-name
StringTrimLeft, trimmed_playing, spotify_playing, 10 ;Get rid of extra text and place into 'trimmed_playing'
StringReplace, replaced_playing, trimmed_playing, –, -, All ;Replace en dash with normal dash and place into 'replaced_playing'
clipboard = %replaced_playing% ;Copy the fixed text to clipboard
return
}
; "F3" for volume up
F3::
{
ControlSend, ahk_parent, ^{Up}, %spotify%
return
}
; "F2 for volume down
F2::
{
ControlSend, ahk_parent, ^{Down}, %spotify%
return
}
; "F8" for vote up
F8::
{
;Store active window
MouseGetPos, , , winID
;Left click near the song title in the "Now Playing" box.
WinGetPos, , , , spotifyHeight, %spotify%
clickX := 639
clickY := 511
ControlClick, x%clickX% y%clickY% , %spotify%, , Left, , NA
;Restore original window and mouse position.
WinActivate ahk_id %winID%
return
}
; "F7" for vote down
F7::
{
;Store active window
MouseGetPos, , , winID
;Left click near the song title in the "Now Playing" box.
WinGetPos, , , , spotifyHeight, %spotify%
clickX := 590
clickY := 510
ControlClick, x%clickX% y%clickY% , %spotify%, , Left, , NA
;Restore original window and mouse position.
WinActivate ahk_id %winID%
return
}
; "F9" for add to my songs
F9::
{
;Store active window
MouseGetPos, , , winID
;Left click near the song title in the "Now Playing" box.
WinGetPos, , , , spotifyHeight, %spotify%
clickX := 178
clickY := 943
ControlClick, x%clickX% y%clickY% , %spotify%, , Left, , NA
;Restore original window and mouse position.
WinActivate ahk_id %winID%
return
}
;|-----------------|
;|--[ FUNCTIONS ]--|
;|-----------------|
;Context menu helper function.
GetContextMenuItemText(hMenu, nPos)
{
length := DllCall("GetMenuString"
, "UInt", hMenu
, "UInt", nPos
, "UInt", 0 ; NULL
, "Int", 0 ; Get length
, "UInt", 0x0400) ; MF_BYPOSITION
VarSetCapacity(lpString, length + 1)
length := DllCall("GetMenuString"
, "UInt", hMenu
, "UInt", nPos
, "Str", lpString
, "Int", length + 1
, "UInt", 0x0400)
return lpString
}#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;|---------------|
;|--[ SOURCES ]--|
;|---------------|
;Base Spotify Script from: http://www.autohotkey.com/board/topic/36239-spotify-global-hotkeys/
;Base Starring Script from: http://superuser.com/questions/324416/any-spotify-tweaks-with-keyboard-shortcut-to-star-tracks
;|------------------|
;|--[ SETTING UP ]--|
;|------------------|
DetectHiddenWindows, On ;Detect Spotify even if it's minimized
#IfWinExist ahk_class SpotifyMainWindow ;Only do the following if Spotify is running
spotify = ahk_class SpotifyMainWindow ;Set variable for Spotify Window Name
;|---------------|
;|--[ HOTKEYS ]--|
;|---------------|
; "F5" for previous
F5::Media_Prev
; "F6" for next
F6::Media_Next
; "F4" for pause
F4::Media_Play_Pause
;|-----------------|
;|--[ FUNCTIONS ]--|
;|-----------------|
;Context menu helper function.
GetContextMenuItemText(hMenu, nPos)
{
length := DllCall("GetMenuString"
, "UInt", hMenu
, "UInt", nPos
, "UInt", 0 ; NULL
, "Int", 0 ; Get length
, "UInt", 0x0400) ; MF_BYPOSITION
VarSetCapacity(lpString, length + 1)
length := DllCall("GetMenuString"
, "UInt", hMenu
, "UInt", nPos
, "Str", lpString
, "Int", length + 1
, "UInt", 0x0400)
return lpString
}Can I ask if you can update Trout to not only remember when you close the app but across files so I can use it with MPH ?

Hi, uniuse, and welcome to the DonationCoder site. Apologies for the delay in replying.Can I ask if you can update Trout to not only remember when you close the app but across files so I can use it with MPH ?
I'm not sure what you're asking for here as MPH already supports Trout. Regarding the new Spotify, I've tried to make it work but, due to how MPH is written, it's proving to be a right pain in the arse.

I think I got the new Spotify partially working (play/pause/stop/next/prev). Volume controls and like/dislike are not supported for the new Spotify.
Website | Download
v1.1.2 - 2015-05-16
+ Added partial support for the new Spotify client. Tested against version
1.0.4.90. (Thanks, uniuse)

I think I got the new Spotify partially working (play/pause/stop/next/prev). Volume controls and like/dislike are not supported for the new Spotify.
Website | Download
v1.1.2 - 2015-05-16
+ Added partial support for the new Spotify client. Tested against version
1.0.4.90. (Thanks, uniuse)
Will test it out, thanks for updating it for the new version.
Also as I will use it on Spotify too I will take up on me to keep you inform when Volume controls and like/dislike will work.

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;|---------------|
;|--[ SOURCES ]--|
;|---------------|
;Base Spotify Script from: http://www.autohotkey.com/board/topic/36239-spotify-global-hotkeys/
;Base Starring Script from: http://superuser.com/questions/324416/any-spotify-tweaks-with-keyboard-shortcut-to-star-tracks
;|------------------|
;|--[ SETTING UP ]--|
;|------------------|
DetectHiddenWindows, On ;Detect Spotify even if it's minimized
#IfWinExist ahk_class SpotifyMainWindow ;Only do the following if Spotify is running
spotify = ahk_class SpotifyMainWindow ;Set variable for Spotify Window Name
;|---------------|
;|--[ HOTKEYS ]--|
;|---------------|
; "F5" for previous
F5::Media_Prev
; "F6" for next
F6::Media_Next
; "F4" for pause
F4::Media_Play_Pause
; "F10" for track-name
F10::
{
WinGetTitle, spotify_playing, %spotify% ;Get the title of Spotify which contains the track-name
StringTrimLeft, trimmed_playing, spotify_playing, 0 ;Get rid of extra text and place into 'trimmed_playing'
StringReplace, replaced_playing, trimmed_playing, –, -, All ;Replace en dash with normal dash and place into 'replaced_playing'
clipboard = %replaced_playing% ;Copy the fixed text to clipboard
return
}
; "F3" for volume up
F3::
{
ControlSend, ahk_parent, ^{Up}, %spotify%
return
}
; "F2 for volume down
F2::
{
ControlSend, ahk_parent, ^{Down}, %spotify%
return
}
; "F8" for vote up in Radio
F8::
{
;Store active window
MouseGetPos, , , winID
;Left click near the song title in the "Now Playing" box.
WinGetPos, , , , spotifyHeight, %spotify%
clickX := 631
clickY := 556
ControlClick, x%clickX% y%clickY% , %spotify%, , Left, , NA
;Restore original window and mouse position.
WinActivate ahk_id %winID%
return
}
; "F7" for vote down in Radio
F7::
{
;Store active window
MouseGetPos, , , winID
;Left click near the song title in the "Now Playing" box.
WinGetPos, , , , spotifyHeight, %spotify%
clickX := 578
clickY := 577
ControlClick, x%clickX% y%clickY% , %spotify%, , Left, , NA
;Restore original window and mouse position.
WinActivate ahk_id %winID%
return
}
; Add track to Your Music
F9::
{
;Store active window
MouseGetPos, , , winID
;Left click near the song title in the "Now Playing" box.
WinGetPos, , , , spotifyHeight, %spotify%
clickX := 161
clickY := 924
ControlClick, x%clickX% y%clickY% , %spotify%, , Left, , NA
;Restore original window and mouse position.
WinActivate ahk_id %winID%
return
}
;|-----------------|
;|--[ FUNCTIONS ]--|
;|-----------------|
;Context menu helper function.
GetContextMenuItemText(hMenu, nPos)
{
length := DllCall("GetMenuString"
, "UInt", hMenu
, "UInt", nPos
, "UInt", 0 ; NULL
, "Int", 0 ; Get length
, "UInt", 0x0400) ; MF_BYPOSITION
VarSetCapacity(lpString, length + 1)
length := DllCall("GetMenuString"
, "UInt", hMenu
, "UInt", nPos
, "Str", lpString
, "Int", length + 1
, "UInt", 0x0400)
return lpString
}


I would definitely use this product if it covered all the video players that I use regularly. It would have to address the really difficult programming challenges of YouTube, UStream, and similar browser-based players, which all have buggy and incomplete user controls. I would definitely donate for that.





Original address: https://www.donationcoder.com/forum/index.php?topic=28387.0