-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
44 lines (35 loc) · 1.08 KB
/
Program.cs
File metadata and controls
44 lines (35 loc) · 1.08 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
37
38
39
40
41
42
43
44
using System;
using System.Threading;
using System.Windows.Forms;
namespace CopyLine
{
class MainClass
{
// 多重起動を禁止するためのタグ
static Mutex mutex = new Mutex(true, "toshiara_CopyLine");
[STAThread]
private static void Main()
{
if (!mutex.WaitOne(TimeSpan.Zero, true))
{
// 多重起動を禁止
MessageBox.Show(
"アプリケーションはすでに実行されています。",
"警告",
MessageBoxButtons.OK,
MessageBoxIcon.Warning
);
return;
}
CopyLine cl = new CopyLine();
// キーボードフックを設定
DetectEvents myHook = new DetectEvents(cl);
myHook.Hook();
// アプリケーション開始
Application.EnableVisualStyles();
Application.Run(cl);
// アプリ終了時にフックを解除
myHook.HookEnd();
}
}
}