WinMove Winamp doesnt work on all skins

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
theimmersion
Posts: 181
Joined: 09 Jul 2016, 08:34
Location: Serbia

WinMove Winamp doesnt work on all skins

22 Nov 2017, 10:43

I wrote a script to center winamp on screen but it only works on classic skin and classic based custom skins which is very odd.
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
Also, all of them move the main player separately from playlist and eq. I wanted to find a way to move all the windows at same time.
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.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww and 284 guests