How to close an app from the system tray

If you have a question or need help, this is the place to be.
Post Reply
Experienced User
Posts: 70
Joined: Mon Nov 23, 2015 9:23 pm
Location: Los Angeles area

How to close an app from the system tray

Post by wysocki » Mon Apr 20, 2020 6:23 pm

I'm using EG to control all my music and video playback on my HTPC. I'm running FxSound (DFX) which improves the audio quality for my various pc music apps. But I don't like to have it running when I switch to Plex to play a video, so I'd like EG to be able to close it. Unfortunately, there is no facility built into FxSound to allow for automating its functions, and it doesn't even appear as a running application in the task manager (only a process named dfx.exe).

I have tried using taskkill to kill the dfx.exe process tree, which works, but then I get NO sound from the pc at all because the default sound playback device is still "DFX Speakers". The only way to close FxSound properly is by right clicking it in the system tray, then exit. How can this operation be done from EG? Or is there a way to switch the default playback device to "Speakers"?

EDIT: Problem solved!
I found an AutoIT script at ... tray-icon/ that can do the trick! I just compiled the script in AutoIT (tweaked to point to FxSound icon) and voila! Complements EG's capabilities perfectly.

User avatar
Site Admin
Posts: 5504
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: How to close an app from the system tray

Post by kgschlosser » Thu Apr 23, 2020 4:28 am

you can also use the Core Audio plugin to change the default audio renderer to your normal speakers when it kills the task. Then there is no need to use any other external software to do the automation.

You can also set EG up so it will close the application racefully instead of killing the task. You need to use the Find Window action and locate the icon in the system tray. I believe by sending a keystroke of {enter} to it it will open the popup or context menu. then from there you send keystrokes that are for the arrow keys to move the selection to close and then send the enter key again. This would close it gracefully allowing the application to change the default audio renderer like it has been designed to do.
If you like the work I have been doing then feel free to Image

Post Reply