aboutsummaryrefslogtreecommitdiff
path: root/Histacom2/OS/Win95/Win95Apps/12padamsViruses/ErrorBlaster95.cs
blob: 3d6f06413866d47436cdafdca85126226eba2682 (plain) (blame)
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Histacom2.Engine;
using System.Drawing.Text;
using static Histacom2.Engine.SaveSystem;
    
namespace Histacom2.OS.Win95.Win95Apps._12padamViruses
{
    public partial class ErrorBlaster95 : UserControl
    {
        Timer messageGen = new Timer();
        Random messageChooser = new Random();
        WindowManager wm = new WindowManager();
        private static PrivateFontCollection pfc = new PrivateFontCollection();
        public ErrorBlaster95()
        {
            InitializeComponent();
            messageGen.Interval = 3000;
            messageGen.Tick += MessageGen_Tick;
            pfc.AddFontFile(DataDirectory + "\\LeviWindows.ttf");
            label1.Font=new Font(pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
        }

        private void MessageGen_Tick(object sender, EventArgs e)
        {
            int messageRandomizer = messageChooser.Next(1, 3);
            switch (messageRandomizer)
            {
                case 1:
                    wm.StartInfobox95("Alert!", "A virus has been detected on your computer! Press OK to disinfect!", Engine.Template.InfoboxType.Error, Engine.Template.InfoboxButtons.OK);
                    messageGen.Interval -= 300;
                    break;

                case 2:
                    wm.StartInfobox95("Microsoft Security Alert", "Microsoft says to install UltraSurpremeAntiVirus1998 to get rid of any viruses!", Engine.Template.InfoboxType.Info, Engine.Template.InfoboxButtons.OK);
                    messageGen.Interval -= 300;
                    break;
                case 3:
                    wm.StartInfobox95("Error", "A BSOD.exe virus has been found on your computer!", Engine.Template.InfoboxType.Warning, Engine.Template.InfoboxButtons.OK);
                    messageGen.Interval -= 300;
                    break;
            }
            if (messageGen.Interval == 300)
            {
                messageGen.Stop();
                
                BSODCreator bs = new BSODCreator();
                
                bs.throw9XBSOD(true, BSODCreator.BSODCauses.Generic);
            }
        }

        private void classicButton3_Click(object sender, EventArgs e)
        {
            ParentForm.Close();
        }

        private void classicButton1_Click(object sender, EventArgs e)
        {
            messageGen.Start();
        }

        private void classicButton2_Click(object sender, EventArgs e)
        {
            messageGen.Stop();
        }
    }
}