diff options
| author | Alex-TIMEHACK <[email protected]> | 2017-07-21 22:14:23 +0100 |
|---|---|---|
| committer | Alex-TIMEHACK <[email protected]> | 2017-07-21 22:14:23 +0100 |
| commit | 2c87ba5fdef12cb62d40c5a9d2513ce097ac0aa9 (patch) | |
| tree | e3733218d0d4633cd11790c222c6a9366f40b1ae /TimeHACK.Main/OS | |
| parent | 5bfa0d8184b94d22c8bd0cff404acae0ef210a3c (diff) | |
| download | histacom2-2c87ba5fdef12cb62d40c5a9d2513ce097ac0aa9.tar.gz histacom2-2c87ba5fdef12cb62d40c5a9d2513ce097ac0aa9.tar.bz2 histacom2-2c87ba5fdef12cb62d40c5a9d2513ce097ac0aa9.zip | |
A lot of backend work!
Diffstat (limited to 'TimeHACK.Main/OS')
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95.cs | 8 | ||||
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs | 23 | ||||
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.Designer.cs | 3 |
3 files changed, 21 insertions, 13 deletions
diff --git a/TimeHACK.Main/OS/Win95/Win95.cs b/TimeHACK.Main/OS/Win95/Win95.cs index d968dd4..4e61bb7 100644 --- a/TimeHACK.Main/OS/Win95/Win95.cs +++ b/TimeHACK.Main/OS/Win95/Win95.cs @@ -103,7 +103,10 @@ namespace TimeHACK.OS.Win95 this.SendToBack(); // Update the taskbar - UpdateTaskbar(); + UpdateTaskbar(); + + // Bring to this the front + this.BringToFront(); //Check if it is the first time if (CurrentSave.FTime95 == false) @@ -118,8 +121,7 @@ namespace TimeHACK.OS.Win95 nonimportantapps[nonimportantapps.Count - 1].BringToFront(); nonimportantapps[nonimportantapps.Count - 1].FormClosing += new FormClosingEventHandler(NonImportantApp_Closing); - // Bring to this the front - this.BringToFront(); + app.BringToFront(); diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs index 8a57563..f7748fe 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs @@ -25,7 +25,7 @@ namespace TimeHACK.OS.Win95.Win95Apps string currentDirectory = Path.Combine(ProfileDirectory, "folders", "Computer"); string oldLabelText; int fileType = 6; - string attemptedDirectory = ""; + //string attemptedDirectory = ""; WindowManager wm = new WindowManager(); public WinClassicWindowsExplorer() @@ -169,11 +169,14 @@ namespace TimeHACK.OS.Win95.Win95Apps case "explorer": Engine.Template.WinClassic app = wm.StartWin95(new WinClassicWindowsExplorer(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true); Program.AddTaskbarItem(app, app.Tag.ToString(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer); - break; case "calc": - Engine.Template.WinClassic appCalc = wm.StartWin95(new WinClassicCalculator(), "Windows Explorer", Properties.Resources.WinClassicCalc, true, true); - Program.AddTaskbarItem(appCalc, appCalc.Tag.ToString(), "Windows Explorer", Properties.Resources.WinClassicCalc); + Engine.Template.WinClassic appCalc = wm.StartWin95(new WinClassicCalculator(), "Calculator", Properties.Resources.WinClassicCalc, true, true); + Program.AddTaskbarItem(appCalc, appCalc.Tag.ToString(), "Calculator", Properties.Resources.WinClassicCalc); + break; + case "wordpad": + Engine.Template.WinClassic appWP = wm.StartWin95(new WinClassicWordPad(), "Wordpad", Properties.Resources.WinClassicWordpad, true, true); + Program.AddTaskbarItem(appWP, appWP.Tag.ToString(), "Wordpad", Properties.Resources.WinClassicWordpad); break; } } @@ -679,23 +682,29 @@ namespace TimeHACK.OS.Win95.Win95Apps { try { - if (!File.Exists(Path.Combine(currentDirectory, mainView.FocusedItem.Text))) + if (!FileOrDirectoryExists(Path.Combine(currentDirectory, mainView.FocusedItem.Text))) { wm.StartInfobox95("Windows Explorer", "This directory doesn't exist", Properties.Resources.Win95Info); } else { - Directory.Delete(currentDirectory + mainView.FocusedItem.Text, true); + if (Directory.Exists(Path.Combine(currentDirectory, mainView.FocusedItem.Text))) Directory.Delete(Path.Combine(currentDirectory, mainView.FocusedItem.Text), true); + else File.Delete(Path.Combine(currentDirectory, mainView.FocusedItem.Text)); RefreshAll(); } } catch { - + RefreshAll(); } } + internal static bool FileOrDirectoryExists(string path) + { + return (Directory.Exists(path) || File.Exists(path)); + } + private void CloseToolStripMenuItem_Click(object sender, EventArgs e) { ((Form)this.TopLevelControl).Close(); diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.Designer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.Designer.cs index 465e375..710c51c 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.Designer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWordPad.Designer.cs @@ -508,9 +508,6 @@ } #endregion - - private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; - private System.Windows.Forms.ToolStripMenuItem helloToolStripMenuItem; private System.Windows.Forms.MenuStrip topmenu; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; |
