I find this program useful when I watch media from a big distance from my screen and reaching to the volume buttons is a pain.
![]()
![]()
This was tested and works in Windows 10, probably Win 8.1 will do as well, previous versions have other API's.
Create a Windows Forms Application in Visual Studio with two buttons:
Double click each button to create click event handlers and write:
privatevoid buttonPlus_Click(object sender, EventArgs e){ Audio.VolUp(Handle);}privatevoid buttonMinus_Click(object sender, EventArgs e){ Audio.VolDown(Handle);}
Now create a new class called Audio and write:
public staticclass Audio{privateconstint APPCOMMAND_VOLUME_MUTE =0x80000;privateconstint APPCOMMAND_VOLUME_UP =0xA0000;privateconstint APPCOMMAND_VOLUME_DOWN =0x90000;privateconstint WM_APPCOMMAND =0x319;[DllImport("user32.dll")]publicstaticextern IntPtr SendMessageW(IntPtr hWnd,int Msg, IntPtr wParam, IntPtr lParam);publicstaticvoid Mute(IntPtr handle){ SendMessageW(handle, WM_APPCOMMAND, handle,(IntPtr)APPCOMMAND_VOLUME_MUTE);}publicstaticvoid VolDown(IntPtr handle){ SendMessageW(handle, WM_APPCOMMAND, handle,(IntPtr)APPCOMMAND_VOLUME_DOWN);}publicstaticvoid VolUp(IntPtr handle){ SendMessageW(handle, WM_APPCOMMAND, handle,(IntPtr)APPCOMMAND_VOLUME_UP);}}
You also have a Mute method in Audio class, so you can add another button for that if you need it.
Try it out and see if it suits you, if you know better ways of doing this leave me an email:
alexandrudanpop@gmail.com
Cheers,
Alex