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.

Run current process as admin (UAC control)

Description
This script runs a new instance of the process for the current window elevated.
Language
C#.net
Minimum Version
Created By
KarolPiechoczek
Contributors
-
Date Created
Aug 3, 2021
Date Last Modified
Aug 3, 2021

Scripted Function (Macro) Code

using System;
using System.Drawing;
using System.Diagnostics;

public static class DisplayFusionFunction
{
	public static void Run(IntPtr windowHandle)
	{
	uint processID = BFS.Application.GetAppIDByWindow(windowHandle);
        Process process = Process.GetProcessById(Convert.ToInt16(processID));
        string processPath = process.MainModule.FileName;

        Process proc = new Process();
        proc.StartInfo.FileName = processPath;
        proc.StartInfo.UseShellExecute = true;
        proc.StartInfo.Verb = "runas";  
        proc.Start();         
	}
}