Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
jipijajay
7 discussion posts
Hi

I am trying to find a script the open TeamSpeak if it is not already running.
Sadly I was not abele to find one in the database and even more sadly I am not able to modify an existing script to to the check. I do not understand enough of C# to copy and paste it. :(
Can someone please help

I thought to do something like this but that obviously does not work.

Code

using System;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms;

// The 'windowHandle' parameter will contain the window handle for the:
//   - Active window when run by hotkey
//   - Window Location target when run by a Window Location rule
//   - TitleBar Button owner when run by a TitleBar Button
//   - Jump List owner when run from a Taskbar Jump List
//   - Currently focused window if none of these match
public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {

        // Prompt for the text to search for
        string searchText = "TeamSpeak"
        
        // Focus the window that contains that text in the title
        
        if ( (BFS.Window.Focus(BFS.Window.GetWindowByText("*" + searchText + "*"))) )
        {
        MessageBox.Show("Process Running");
        }
        else
        {
        MessageBox.Show("Process Not running");
        }
        System.Threading.Thread.Sleep(5 * 1000);
                
        //start Program and get it's application id
       BFS.Application.Start("D:\\APPS\\TSClient\\ts3client_win64.exe", "");
    }
}


BR,
Manuel
Dec 12, 2020  • #1
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Hi Manuel,

I've attached a script that should work for you. Can you let me know how it goes?

Thanks!
Dec 17, 2020  • #2
User Image
jipijajay
7 discussion posts
Hi Owen,

thanks to you. It is running like a charm now.

Thank you for your support. 8)
Dec 29, 2020  • #3
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Hi Manuel,

Glad to hear it's working! If you have any other questions, feel free to reach out to us.

Thanks!
Dec 29, 2020  • #4
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(1)  Login to Vote(-)