forked from EslaMx7/ScreenTask
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
executable file
·36 lines (30 loc) · 1.16 KB
/
Copy pathProgram.cs
File metadata and controls
executable file
·36 lines (30 loc) · 1.16 KB
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
using System;
using System.Windows.Forms;
namespace ScreenTask {
static class Program {
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
using (NotifyIcon icon = FrmMain.getIconRef) {
icon.Icon = Properties.Resources.iconOff;
icon.ContextMenu = new ContextMenu(new MenuItem[] {
new MenuItem("Show main window", (s, e) => { FrmMain.GetForm.Show(); }),
new MenuItem("Hide main window", (s, e) => { FrmMain.GetForm.Hide(); }),
new MenuItem("Exit", (s, e) => { FrmMain.GetForm.Shutdown(); }),
});
icon.Click += new System.EventHandler(ShowApp);
icon.Visible = true;
FrmMain.GetForm.Show();
Application.Run();
icon.Visible = false;
}
}
static void ShowApp(object sender, EventArgs e) {
FrmMain.GetForm.Show();
}
}
}