Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

A recent AVG and Avast antivirus update is preventing DisplayFusion 9.9 from launching on some systems.
If you're running into this issue, please update to the latest DisplayFusion 10.0 Beta.

Decrease Application Volume

Description
This script decreases the volume of the focused window.
Language
C#.net
Minimum Version
Created By
Renan Gonçalves Micheletti
Contributors
-
Date Created
Feb 23, 2022
Date Last Modified
Feb 23, 2022

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);
		const decimal changeBy = 0.02m;

		BFS.Audio.SetApplicationVolume(appID, BFS.Audio.GetApplicationVolume(appID) - changeBy);
	}
}