-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
54 lines (46 loc) · 1.43 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;
using System.Text;
using System.Collections.Generic;
using AIComposer.AISupport;
namespace AIComposer
{
public static class Program
{
[DllImport("user32.dll")]
private static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("user32.dll")]
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
private const int SW_RESTORE = 9;
private const int SW_SHOW = 5;
public static SystemSetting Setting { get; set; }
public static List<AIBase> AIList { get; set; } = new List<AIBase>(){
new TongYiAI(),
new KimiAI(),
new DouBaoAI(),
new ChatGpt(),
new ChatGLM(),
new PoeAI(),
new TiangongAI(),
//new XunFeiAI(),
};
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
using (Mutex mutex = new Mutex(true, "Global\\MyUniqueAppName", out bool createdNew))
{
if (!createdNew)
{
MessageBox.Show("程序已在运行中!");
return;
}
Application.Run(new AIComposer());
}
}
}
}