Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

Start TeamSpeak if not already open & load Window Position Profile

Description
This script will check if TeamSpeak is running, and if not, it will launch it, then load a Window Position Profile. Make sure to set the path to TeamSpeak on line 15, and the Window Position Profile name on line 29.
Language
C#.net
Minimum Version
Created By
jipijajay95586
Contributors
-
Date Created
Feb 19, 2021
Date Last Modified
Feb 19, 2021

Scripted Function (Macro) Code

using System;
using System.Drawing;
using System.Windows.Forms;
using System.Management;
using System.Threading;

public static class DisplayFusionFunction
{
	public static void Run(IntPtr windowHandle)
	{
        // Set the process name here (leave the asterisk at the start)
        string processName = "*ts3client_win64.exe";
        
        // Set the full path to the process here
        string processFullPath = @"D:\APPS\TSClient\ts3client_win64.exe";
		
		// Check if the app is running
		bool isAppRunning = BFS.Application.IsAppRunningByFile(processName);
		if (isAppRunning)
		{
            // If it's already running, show a message
            //BFS.Dialog.ShowMessageInfo("App is already running");
		}
		else
		{
            // If it's not, then launch it
            BFS.Application.Start(processFullPath, "");
		}
		BFS.DisplayFusion.LoadWindowPositionProfile("TeamSpeak");
	}
}