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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
|
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using TimeHACK.Engine;
using TimeHACK.Engine.Template;
namespace TimeHACK.OS.Win95.Win95Apps
{
public partial class WinClassicIE4 : UserControl
{
public List<string> browsinghistory = new List<string>();
public int historylocation = 0;
public HtmlDocument currentsite;
private Timer loadplz = new Timer();
public WinClassicIE4()
{
InitializeComponent();
}
private void WinClassicIE4_Load(object sender, EventArgs e)
{
browsinghistory.Capacity = 99;
BringToFront();
hidePrograms();
browsinghistory.Add("www.microsoft.com/internetexplorer4/welcome");
for (int i = 0; i < 99; i++) browsinghistory.Add(null);
webBrowser1.DocumentText = resources.GetString("ie4start_HTML");
webBrowser1.Show();
loadplz.Tick += new EventHandler(loadplz_Tick);
foreach (ToolStripMenuItem item in MenuStrip3.Items) item.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((0)));
foreach (Control ctrl in Panel1.Controls) ctrl.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((0)));
}
private void hidePrograms()
{
googlemain.Hide();
googlealpha.Hide();
padamsmain.Hide();
hotmailmain.Hide();
padamsbackgrounds.Hide();
skindows95advertisment.Hide();
secretwebsite.Hide();
padamshidden.Hide();
email1.Hide();
email2.Hide();
email3.Hide();
hotmailpadams.Hide();
}
private void google_LinkClicked(object sender, HtmlElementEventArgs e)
{
goToSite("www.google.com", false);
}
private void padams_LinkClicked(object sender, HtmlElementEventArgs e)
{
goToSite("www.12padams.com", false);
}
private void googleprototypelink_LinkClicked(object sender, HtmlElementEventArgs e)
{
goToSite("www.google.stanford.edu", false);
}
private void googlebetalink_LinkClicked(object sender, HtmlElementEventArgs e)
{
goToSite("www.alpha.google.com", false);
}
private void Label20_Click(object sender, EventArgs e)
{
hidePrograms();
padamshidden.Dock = DockStyle.Fill;
padamshidden.Show();
}
private void Button12_Click(object sender, EventArgs e)
{
}
private void Button9_Click(object sender, EventArgs e)
{
goToSite("www.???.com", false);
}
private void ToolStripMenuItem21_Click(object sender, EventArgs e)
{
((Form)this.TopLevelControl).Close();
}
private void goToSite(string url, bool back)
{
webBrowser1.DocumentText = "";
switch (url)
{
case "www.google.com":
hidePrograms();
webBrowser1.DocumentText = resources.GetString("google_HTML");
break;
case "www.google.stanford.edu":
hidePrograms();
webBrowser1.DocumentText = resources.GetString("prototype_HTML");
break;
case "www.alpha.google.com":
hidePrograms();
googlealpha.Dock = DockStyle.Fill;
googlealpha.Show();
break;
case "www.12padams.com":
hidePrograms();
Story.Hack1.StartObjective();
webBrowser1.DocumentText = resources.GetString("padams_HTML");
break;
case "www.microsoft.com/internetexplorer4/welcome":
hidePrograms();
webBrowser1.DocumentText = resources.GetString("ie4start_HTML");
break;
case "www.???.com":
hidePrograms();
secretwebsite.Dock = DockStyle.Fill;
secretwebsite.Show();
break;
case "www.12padams.com/???":
hidePrograms();
padamshidden.Dock = DockStyle.Fill;
padamshidden.Show();
break;
default:
return;
}
if (!back)
{
if (historylocation >= 98) historylocation = 79;
for (int i = historylocation + 1; i < browsinghistory.Count; i++)
{
browsinghistory[i] = null;
}
int j = 0;
for (int i = 1; i < browsinghistory.Count; i++)
{
if (browsinghistory[i] != null && browsinghistory[i] != "") j++;
}
historylocation = j;
browsinghistory[historylocation + 1] = url;
historylocation++;
}
addressbar.Text = url;
currentsite = webBrowser1.Document;
}
private void BackButton_Click(object sender, EventArgs e)
{
if (!(historylocation <= 0))
{
goToSite(browsinghistory[historylocation - 1], true);
historylocation--;
}
}
private void ForwardButton_Click(object sender, EventArgs e)
{
if(browsinghistory[historylocation+1] != null) goToSite(browsinghistory[historylocation + 1], false);
}
private void HomeButton_Click(object sender, EventArgs e)
{
goToSite("www.microsoft.com/internetexplorer4/welcome", false);
}
private void WCDownloadButton_Click(object sender, HtmlElementEventArgs e)
{
WinClassicDownloader opendownload = new WinClassicDownloader();
WindowManager wm = new WindowManager();
wm.StartWin95(opendownload, "Downloader", null, false, true);
opendownload.appName.Text = "Downloading: Web Chat";
}
private void GoButton_Click(object sender, EventArgs e)
{
goToSite(addressbar.Text, false);
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
loadplz.Start();
}
private void loadplz_Tick(object sender, EventArgs e)
{
try
{
Debug.Print(webBrowser1.Document.Title);
switch (webBrowser1.Document.Title)
{
case "IE4START":
webBrowser1.Document.GetElementById("google").Click += new HtmlElementEventHandler(google_LinkClicked);
webBrowser1.Document.GetElementById("padams").Click += new HtmlElementEventHandler(padams_LinkClicked);
break;
case "12PADAMS":
webBrowser1.Document.GetElementById("wc_b").Click += new HtmlElementEventHandler(WCDownloadButton_Click);
webBrowser1.Document.GetElementById("ftp_b").Click += new HtmlElementEventHandler(FTPDownloadButton_Click);
if (!TitleScreen.frm95.hiddenpadamsFound) webBrowser1.Document.GetElementById("distort").Style += "visibility:hidden;";
break;
case "GOOGLE":
webBrowser1.Document.GetElementById("prototype").Click += new HtmlElementEventHandler(googleprototypelink_LinkClicked);
webBrowser1.Document.GetElementById("alpha").Click += new HtmlElementEventHandler(googlebetalink_LinkClicked);
break;
}
loadplz.Stop();
}
catch
{
}
}
private void FTPDownloadButton_Click(object sender, HtmlElementEventArgs e)
{
WinClassicDownloader opendownload = new WinClassicDownloader();
WindowManager wm = new WindowManager();
wm.StartWin95(opendownload, "Downloader", null, false, true);
opendownload.appName.Text = "Downloading: FTP Client";
}
//TODO: Add more websites
//TODO: Relabel Buttons And Things
}
}
|