Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to trigger the Windows volume display?

When the standard keyboard key to increase the volume is hit on windows, a small window appears in the upper left displaying the volume and possibly information about playing media. I am looking for a way to trigger the window without changing the volume status, preferably in an easy to integrate way with Autohotkey.

like image 334
Matthew Sundberg Avatar asked Jul 30 '17 00:07

Matthew Sundberg


People also ask

How do I turn on the volume overlay in Windows 10?

Navigate to Menu → Edit → Preferences. Then scroll down to Display options. Locate this option: Show desktop overlay when using media keys.


2 Answers

Windows 8 introduced the Media​Control class that lets Modern apps hook into the system playback control. In Windows 8.1 and 10 it was replaced by the System​Media​Transport​Controls class.

While it supports "Manual control of the System Media Transport Controls" there does not seem to be a way to show/hide the overlay and certainly not from a desktop app.

Going into undocumented territory I found the class name of the overlay and that lead me to HideVolumeOSD. Unfortunately the class names are rather generic so you probably have to look at the size of the window as well to determine if it is the volume overlay.

I don't know if just showing the window will work, Windows is not expecting it to be visible except in response to keyboard and playback events. The HideVolumeOSD app uses keybd_event (volume up/down) to trigger it but this is problematic as noted in the comments...

like image 130
Anders Avatar answered Sep 24 '22 19:09

Anders


I set up an autohotkey to send volume up, the volume down (For shortcut ctrl+pgdn).

^PgDn::
   Send {Volume_Up}
   Send {Volume_Down}
   return     
like image 24
Anna Wang Avatar answered Sep 23 '22 19:09

Anna Wang