1
0
mirror of https://e.coding.net/circlecloud/CTZLauncher.git synced 2024-11-15 00:58:50 +00:00
CTZLauncher/KMCCC.Shared/Launcher/LaunchHandleExtensions.cs

46 lines
720 B
C#
Raw Normal View History

namespace KMCCC.Launcher
{
#region
using System;
using System.Runtime.InteropServices;
#endregion
public static class LaunchHandleExtensions
{
public static bool SetTitle(this LaunchHandle handle, string title)
{
try
{
SetWindowText(handle.Process.MainWindowHandle, title);
return true;
}
catch
{
return false;
}
}
public static string GetTile(this LaunchHandle handle)
{
try
{
return handle.Process.MainWindowTitle;
}
catch
{
return null;
}
}
public static void Kill(this LaunchHandle handle)
{
handle.Process.Kill();
}
[DllImport("User32.dll")]
public static extern int SetWindowText(IntPtr winHandle, string title);
}
}