上传文件至 PUBG2017PSLauncher

This commit is contained in:
才羽青空 2025-09-17 22:27:27 +00:00
parent d246c1ff86
commit 5cf123a8f2
5 changed files with 1089 additions and 0 deletions

View file

@ -0,0 +1,43 @@
using System.Reflection;
using System.Windows;
using System.Drawing;
namespace PUBG2017PSLauncher
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : System.Windows.Application
{
static NotifyIcon trayIcon;
protected override void OnStartup(StartupEventArgs e)
{
trayIcon = new NotifyIcon()
{
Text = "OG:BG 启动器",
Icon = Icon.ExtractAssociatedIcon(Assembly.GetEntryAssembly().ManifestModule.Name),
ContextMenuStrip = new ContextMenuStrip()
{
Items = {new ToolStripMenuItem("退出启动器", null, ExitFromTray)}
},
Visible = true
};
trayIcon.Click += TrayLeftClicked;
base.OnStartup(e);
}
void ExitFromTray(object sender, EventArgs e)
{
Current.Shutdown();
}
void TrayLeftClicked(object sender, EventArgs e)
{
MainWindow.Visibility = Visibility.Visible;
MainWindow.ShowInTaskbar = true;
}
}
}