Setting the position of the seekbar of foobar2000

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
william_ahk
Posts: 512
Joined: 03 Dec 2018, 20:02

Setting the position of the seekbar of foobar2000

30 Jan 2023, 23:18

I'm trying to set the position of this seekbar in foobar2000:
foobar2000_seekbar.png
foobar2000_seekbar.png (709 Bytes) Viewed 472 times
I have attempted TBM_SETPOS but to no avail. TBM_GETRANGEMIN and TBM_GETRANGEMAX both reports 0. Is this not a regular win32 slider control?

Code: Select all

window := "ahk_class {97E27FAA-C0B3-4b8e-A693-ED7881E99FC1}"
seekbar := "{596C5150-D8FF-4ed4-81AB-99B3DDA08AF1}1"
SendMessage, 0x0405, 1, 10, % seekbar, % window ; TBM_SETPOS
msgbox % ErrorLevel ; -> 0 but no effect

SendMessage, 0x0401, 0, 0, % seekbar, % window ; TBM_GETRANGEMIN
rangemin := ErrorLevel
SendMessage, 0x0402, 0, 0, % seekbar, % window ; TBM_GETRANGEMAX
rangemax := ErrorLevel
msgbox % rangemin " - " rangemax ; -> 0 - 0
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Setting the position of the seekbar of foobar2000

11 Feb 2023, 19:45

william_ahk wrote:Is this not a regular win32 slider control?
ahk_class {97E27FAA-C0B3-4b8e-A693-ED7881E99FC1} should already be enough of a clue that its not
u can try MSAA or UIA to automate it
william_ahk
Posts: 512
Joined: 03 Dec 2018, 20:02

Re: Setting the position of the seekbar of foobar2000

11 Feb 2023, 20:37

swagfag wrote:
11 Feb 2023, 19:45
ahk_class {97E27FAA-C0B3-4b8e-A693-ED7881E99FC1} should already be enough of a clue that its not
u can try MSAA or UIA to automate it
Well damn, I did not know that. MSAA/UIA did not expose any value for the seekbar, so I ended up using ControlClick.

Code: Select all

ControlGetPos, x, y, w, h, % seekbar, % wintitle
Random, rand_pos, 0, % w
ControlClick, % seekbar, % wintitle,,,, % "NA x" rand_pos " y0"
One drawback is that the window must be shown for this to work. If anyone knows how to control the playback programmatically with AHK it would be great.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Draken, oktavimark and 359 guests