添加项目文件。
This commit is contained in:
70
AudioVisualizer/Program.cs
Normal file
70
AudioVisualizer/Program.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AudioWallpaper {
|
||||
internal static class Program {
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool FlashWindow(IntPtr hWnd, bool bInvert);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool FlashWindowEx(int pfwi);
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
///
|
||||
[DllImport("kernel32.dll")]
|
||||
public static extern bool AllocConsole();
|
||||
[DllImport("kernel32.dll")]
|
||||
public static extern bool FreeConsole();//<2F>ͷŹ<CDB7><C5B9><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD>̨<EFBFBD><CCA8><EFBFBD><EFBFBD>
|
||||
|
||||
[STAThread]
|
||||
static void Main(String[] args) {
|
||||
// To customize application configuration such as set high DPI settings or default font,
|
||||
// see https://aka.ms/applicationconfiguration.
|
||||
bool createdNew;
|
||||
bool DoesTheGuardianExist = false;
|
||||
// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>Ψһ<CEA8>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ψһ<CEA8><D2BB>
|
||||
using (Mutex mutex = new Mutex(true, "{C8F8E5D9-6F05-4F92-BE10-DF7A4F5F97FB}", out createdNew)) {
|
||||
if (createdNew) {
|
||||
//<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//if (args.Length < 1) {
|
||||
// mutex.ReleaseMutex();
|
||||
// return;
|
||||
//}
|
||||
//if (!args[0].Equals("ManagerStart")) {
|
||||
// mutex.ReleaseMutex();
|
||||
// return;
|
||||
//}
|
||||
//if (!args[1].Equals("1")) {
|
||||
// mutex.ReleaseMutex();
|
||||
// return;
|
||||
//}
|
||||
#if !DEBUG
|
||||
|
||||
Mutex Dmutex = new Mutex(true, "{C9F9E5D9-6F05-4F92-BE10-DF7A4F5F97FB}", out DoesTheGuardianExist);
|
||||
if (DoesTheGuardianExist) {
|
||||
Dmutex.ReleaseMutex();
|
||||
Dmutex.Dispose();
|
||||
mutex.ReleaseMutex();
|
||||
return;
|
||||
}
|
||||
Dmutex.Dispose();
|
||||
#endif
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨
|
||||
AllocConsole();
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>崴<EFBFBD><E5B4B4><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>ǰû<C7B0><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
ApplicationConfiguration.Initialize();
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
FormManager formManager = new FormManager();
|
||||
Application.Run();
|
||||
//<2F>ͷſ<CDB7><C5BF><EFBFBD>̨
|
||||
FreeConsole();
|
||||
mutex.ReleaseMutex(); // <20>ͷŻ<CDB7><C5BB><EFBFBD><EFBFBD><EFBFBD>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user