TimBurris / SiriusXMPlayer

MIT License
5 stars 2 forks source link

Activate main window when restoring from system tray #7

Open ncbrowns opened 8 months ago

ncbrowns commented 8 months ago

When using the SiriusXMPlayer application, I normally keep it in the minimized state and interact with it primarily via the media keys. However, I do bring the application up from time to time to switch channels or interact with dialog boxes when playback is interrupted. To do this, I configured Windows to not hide the system tray icon for the application and would click on it to restore. However, the ToggleMinimized command does not activate the main window and the restored window needs to be manually selected on the taskbar to jump to the top of the window stack. Activating the window while restoring seems like a good idea. I don't have much experience with .NET and couldn't figure out how to get at the main window in ToggleMinimize, so I couldn't create a PR for this.

It turns out that this fix/feature would not be important to me. After trying unsuccessfully to fix this, I realized that I had a better way to handle this. I use the AutoHotKey application to have my own custom hotkeys and an X Windows-style desktop menu. I created a hotkey that would identify the SiriusXMPlayer window, toggle its minimized state, and activate the window when restoring it. But this enhancement might be worthwhile for other users.