Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Decrease Application Volume

Description
This script will decrease the volume of the currently focused application.
Language
C#.net
Minimum Version
Created By
Tyler Holmes60929
Contributors
-
Date Created
Feb 24, 2021
Date Last Modified
Feb 24, 2021

Scripted Function (Macro) Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
	public static void Run(IntPtr windowHandle)
	{
		uint appID = BFS.Application.GetAppIDByWindow(windowHandle);
		float changeBy = -0.02f;
		float currentVol = (float)BFS.Audio.GetApplicationVolume(appID);

		BFS.Audio.SetApplicationVolume(appID, (decimal)(currentVol + changeBy));
	}
}