aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Main/OpenApplication.cs
blob: 3586a568d82abbffdea7ac70a659d508e31a06a4 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
using System;
using System.IO;
using TimeHACK.Engine;
using TimeHACK.OS.Win95.Win95Apps;
using TimeHACK.Engine.Template;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TimeHACK
{
    public class OpenApplication
    {
        WindowManager wm = new WindowManager();
        public String GetDataFromExe(String path)
        {
            return File.ReadAllText(path);
        }

        public void OpenApp(String appName)
        {
            WinClassic toReturn = new WinClassic();

            switch (appName.ToLower())
            {
                case "notepad":
                    toReturn = wm.startWin95(new WinClassicNotepad(), "Notepad", Properties.Resources.Win95IconNotepad, true, true);
                    Program.AddTaskbarItem(toReturn, toReturn.Tag.ToString(), "Notepad", Properties.Resources.Win95IconNotepad);

                    Program.nonimportantapps.Add(toReturn);
                    Program.nonimportantapps[Program.nonimportantapps.Count - 1].BringToFront();
                    Program.nonimportantapps[Program.nonimportantapps.Count - 1].FormClosing += new FormClosingEventHandler(Program.NonImportantApp_Closing);

                    toReturn.BringToFront();

                    break;
                case "wordpad":
                    toReturn = wm.startWin95(new WinClassicWordPad(), "Wordpad", Properties.Resources.Win95IconWordpad, true, true);
                    Program.AddTaskbarItem(toReturn, toReturn.Tag.ToString(), "Wordpad", Properties.Resources.Win95IconWordpad);

                    Program.nonimportantapps.Add(toReturn);
                    Program.nonimportantapps[Program.nonimportantapps.Count - 1].BringToFront();
                    Program.nonimportantapps[Program.nonimportantapps.Count - 1].FormClosing += new FormClosingEventHandler(Program.NonImportantApp_Closing);

                    break;
                case "addressbook":
                    toReturn = wm.startWin95(new WinClassicAddressBook(), "Address Book", Properties.Resources.WinClassicAddressBook, true, true);
                    Program.AddTaskbarItem(toReturn, toReturn.Tag.ToString(), "Address Book", Properties.Resources.WinClassicAddressBook);

                    Program.nonimportantapps.Add(toReturn);
                    Program.nonimportantapps[Program.nonimportantapps.Count - 1].BringToFront();
                    Program.nonimportantapps[Program.nonimportantapps.Count - 1].FormClosing += new FormClosingEventHandler(Program.NonImportantApp_Closing);

                    break;
                case "ie4":
                    toReturn = wm.startWin95(new WinClassicIE4(), "Internet Explorer 4", Properties.Resources.Win95IconNotepad, true, true);
                    Program.AddTaskbarItem(toReturn, toReturn.Tag.ToString(), "Internet Explorer 4", Properties.Resources.Win95IconNotepad);

                    break;
                case "windowsexplorer":
                    FileDialogBoxManager.IsInOpenDialog = false;
                    FileDialogBoxManager.IsInSaveDialog = false;
                    WinClassicWindowsExplorer we = new WinClassicWindowsExplorer();
                    WinClassic app = wm.startWin95(we, "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true);
                    Program.AddTaskbarItem(app, app.Tag.ToString(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer);

                    Program.nonimportantapps.Add(app);
                    Program.nonimportantapps[Program.nonimportantapps.Count - 1].BringToFront();
                    Program.nonimportantapps[Program.nonimportantapps.Count - 1].FormClosing += new FormClosingEventHandler(Program.NonImportantApp_Closing);

                    app.BringToFront();

                    break;
                case "survivetheday":
                    TimeHACK.OS.Win2K.Win2KApps.SurviveTheDay std = new TimeHACK.OS.Win2K.Win2KApps.SurviveTheDay();
                    toReturn = wm.startWin95(std, "Survive The Day", null, false, false);
                    Program.AddTaskbarItem(toReturn, toReturn.Tag.ToString(), "Survive The Day", null);

                    Program.nonimportantapps.Add(toReturn);
                    Program.nonimportantapps[Program.nonimportantapps.Count - 1].BringToFront();
                    Program.nonimportantapps[Program.nonimportantapps.Count - 1].FormClosing += new FormClosingEventHandler(Program.NonImportantApp_Closing);

                    toReturn.BringToFront();

                    break;
                case "webchat1998":
                    WebChat1998 wc = new WebChat1998();
                    toReturn = wm.startWin95(wc, "Web Chat 1998", null, true, true);
                    Program.AddTaskbarItem(toReturn, toReturn.Tag.ToString(), "Web Chat 1998", null);

                    toReturn.BringToFront();

                    break;
            }
        }
    }
}