forked from KodeByWrath/NoMoreEdge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm1.cs
108 lines (93 loc) · 3.11 KB
/
Form1.cs
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace NoMoreEdgeSetup
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
protected override void OnMouseDown(MouseEventArgs e)
{
base.OnMouseDown(e);
if (e.Button == MouseButtons.Left)
{
this.Capture = false;
Message msg = Message.Create(this.Handle, 0XA1, new IntPtr(2), IntPtr.Zero);
this.WndProc(ref msg);
}
}
string path = @"C:\Program Files (x86)\Microsoft\Edge\Application\NoMoreEdge.exe";
static string fileName = "NoMoreEdge.exe";
static string edgeaName = "msedge.exe";
static string targetPath = @"C:\PROGRA~2\Microsoft\Edge\Application";
static string destFile = System.IO.Path.Combine(targetPath, fileName);
static string edgepath = System.IO.Path.Combine(targetPath, edgeaName);
static string newedge = System.IO.Path.Combine(targetPath, "msedge_solo.exe");
static string engine = "google";
private void btn_install_Click(object sender, EventArgs e)
{
NoMoreEdgeSetupForm.installApp(path,edgepath,newedge,destFile,engine);
}
public void btn_uninstall_Click(object sender, EventArgs e)
{
NoMoreEdgeSetupForm.uninstallApp(path,newedge);
}
private void btn_exit_Click(object sender, EventArgs e)
{
NoMoreEdgeSetupForm.exitSetup();
}
private void btn_update_Click(object sender, EventArgs e)
{
NoMoreEdgeSetupForm.updateApp(path,engine);
}
private void google_CheckedChanged(object sender, EventArgs e)
{
engine = google.Name;
}
private void duckduckgo_CheckedChanged(object sender, EventArgs e)
{
engine = duckduckgo.Name;
}
private void ask_CheckedChanged(object sender, EventArgs e)
{
engine = ask.Name;
}
private void baidu_CheckedChanged(object sender, EventArgs e)
{
engine = baidu.Name;
}
private void ecosia_CheckedChanged(object sender, EventArgs e)
{
engine = ecosia.Name;
}
private void yahoo_CheckedChanged(object sender, EventArgs e)
{
engine = yahoo.Name;
}
private void sogou_CheckedChanged(object sender, EventArgs e)
{
engine = sogou.Name;
}
private void yandex_CheckedChanged(object sender, EventArgs e)
{
engine = yandex.Name;
}
private void btn_github_Click(object sender, EventArgs e)
{
ProcessStartInfo launcher = new ProcessStartInfo("https://github.com/HarshalKudale/NoMoreEdge")
{
UseShellExecute = true
};
Process.Start(launcher);
}
}
}