I tried many combos to achieve this non worked. Any ideas?
This is the last snippet of the code i tried, should have saved the others. Will try to add a few i remember trying.
Make sure to have winamp active and moved away from center if any of the hotkeys worked. xD
If important, Windows 10 Pro x64 | Winamp 5.666.
Code: Select all
#SingleInstance, Force
Target := "ahk_class Winamp v1.x"
; WORKING ONLY ON WINAMP CLASSIC SKINS.
F1::
SoundBeep, 800, 200
WinGetPos, X, Y, Width, Height, %Target%
WinampCenter:=(Round(Width/2))
ScreenCenter:=( Round(A_ScreenWidth/2) )
Anchor:=( Round(ScreenCenter-WinampCenter) )
WinMove, %Target%,, %Anchor%, Y
Return
; WORKING ON WINAMP CLASSIC SKINS AND EXPLORERS FOLDERS, PROBABLY SOME OTHER WINDOWS AS WELL.
F2::
SoundBeep, 800, 200
WinGetTitle, windowName, A
WinGetPos, X, Y, Width, Height, %windowName%
WinampCenter:=(Round(Width/2))
ScreenCenter:=( Round(A_ScreenWidth/2) )
Anchor:=( Round(ScreenCenter-WinampCenter) )
WinMove, %windowName%,, %Anchor%, Y
Return
; NOT WORKING ANYWHERE BUT I THINK IT USED TO? A MODIFICATION TO THE CODE BROKE IT?
F3::
SoundBeep, 800, 200
WinGetClass, windowClass, A
WinGetPos, X, Y, Width, Height, %windowClass%
WinampCenter:=(Round(Width/2))
ScreenCenter:=( Round(A_ScreenWidth/2) )
Anchor:=( Round(ScreenCenter-WinampCenter) )
WinMove, %windowClass%,, %Anchor%, Y
Return
; NOT WORKING ANYWHERE BUT IT DID AT SOME POINT ON CLASSIC SKIN??? A MODIFICATION TO THE CODE BROKE IT?
F4::
SoundBeep, 800, 200
WinGet, active_id, ID, A
WinGetPos, X, Y, Width, Height, %active_id%
WinampCenter:=(Round(Width/2))
ScreenCenter:=( Round(A_ScreenWidth/2) )
Anchor:=( Round(ScreenCenter-WinampCenter) )
WinMove, %active_id%,, %Anchor%, Y
Return
F5::ExitApp
And id like it rather that the user doesnt have to make the window active for it to work.
F1 doesnt require winamp to be active and only moves the main player but the rest does move the other windows but only the active selected ones.
EDIT: Also, i set winamp to be in the Tray. Because it runs mostly all the time and dont want to waste space on the taskbar app button.