controlapp/ControlApp/MyCustomApplicationContext.cs
Merith-TK 3e31aa0363 Decompile and Rebuild v0.1.2
begin work: base version 0993

move original program for orgnization

golang work

snapshot decompiled code

it builds! (but doesnt run)

source code bump

library stash

decompile 0.1.2, make it build
2025-02-25 21:37:38 -08:00

41 lines
960 B
C#

using System;
using System.Drawing;
using System.Windows.Forms;
namespace ControlApp;
public class MyCustomApplicationContext : ApplicationContext
{
private NotifyIcon trayIcon;
public MyCustomApplicationContext()
{
trayIcon = new NotifyIcon();
trayIcon.Icon = new Icon("App.ico");
trayIcon.ContextMenuStrip = new ContextMenuStrip();
trayIcon.ContextMenuStrip.Items.Add("Exit", null, Exit);
trayIcon.ContextMenuStrip.Items.Add("Open", null, Open);
trayIcon.ContextMenuStrip.Items.Add("Panic", null, Panic);
trayIcon.Visible = true;
}
private void Exit(object sender, EventArgs e)
{
trayIcon.Visible = false;
Application.Exit();
}
private void Open(object sender, EventArgs e)
{
using ControlApp myform = new ControlApp();
myform.ShowDialog();
}
private void Panic(object sender, EventArgs e)
{
foreach (Form openForm in Application.OpenForms)
{
openForm.Close();
}
}
}