Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure?

Close Specific Application Windows

Description
This script will find the main window for the given process names and close it.
Language
C#.net
Minimum Version
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
10d ago
Date Last Modified
10d ago

Scripted Function (Macro) Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
	public static void Run(IntPtr windowHandle)
	{
		// Set the process names here
		string[] processNames = {"notepad++.exe","mailbird.exe","firefox.exe"};
		
		// Find the main window and close it
		foreach (string processName in processNames)
		{
			IntPtr window = BFS.Application.GetMainWindowByFile("*" + processName.ToLower());
			BFS.Window.Close(window);
		}
	}
}