HydrogenAudio

Hosted Forums => foobar2000 => Development - (fb2k) => Topic started by: onirwai on 2018-09-24 16:14:39

Title: Not responding to graceful termination signal
Post by: onirwai on 2018-09-24 16:14:39
I'm trying to shut it down at night, programming through AutoHotkey.
I can't for the life of me figure out a termination signal to send that works reliably but doesn't force.

Code: [Select]
WinClose, ahk_exe foobar2000.exe ; Doesn't work if minimized
PostMessage, 0x112, 0xF060,,, ahk_exe foobar2000.exe ; Doesn't work if minimized
Run, taskkill /t /im foobar2000.exe, , Hide ; Doesn't work if minimized

I could handle it as a special case with foobar2000.lnk /pause /exit but I was hoping for a more reliable general solution.
What is holding it back from behaving normally? Is it some kind of play lock because it's a media player?
Title: Re: Not responding to graceful termination signal
Post by: Case on 2018-09-24 16:51:31
Your authotkey hackery closes foobar2000 just fine here when it's minized. But if it's hidden so it only shows up in notification area it no longer works. But nothing that lives in notification area can be closed with your command.

I'd assume what you want to achieve can be achieved with foo_scheduler (https://www.foobar2000.org/components/view/foo_scheduler). But cleanest way to achieve closing of foobar2000 at specific time is to use Windows' Task Scheduler and call foobar2000.exe /quit.