diff options
| -rw-r--r-- | Histacom2.Engine/Template/WinClassic.cs | 65 | ||||
| -rw-r--r-- | Histacom2/OS/WinXPBad/Story/Hack4.cs | 19 | ||||
| -rw-r--r-- | Histacom2/OS/WinXPBad/VirusLabel.Designer.cs | 4 | ||||
| -rw-r--r-- | Histacom2/OS/WinXPBad/WinClassicIE6Bad.Designer.cs | 8 | ||||
| -rw-r--r-- | Histacom2/OS/WinXPBad/WinClassicIE6Bad.cs | 20 | ||||
| -rw-r--r-- | Histacom2/OS/WinXPBad/WinClassicIE6Bad.resx | 6 | ||||
| -rw-r--r-- | LICENSE | 2 | ||||
| -rw-r--r-- | README.md | 1 |
8 files changed, 73 insertions, 52 deletions
diff --git a/Histacom2.Engine/Template/WinClassic.cs b/Histacom2.Engine/Template/WinClassic.cs index 79958d6..1f715ab 100644 --- a/Histacom2.Engine/Template/WinClassic.cs +++ b/Histacom2.Engine/Template/WinClassic.cs @@ -88,8 +88,11 @@ namespace Histacom2.Engine.Template { var toDraw = resizer.ToDraw; if (resizable) { - if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X); - if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.X = Cursor.Position.X; + if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) + { + toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X); + toDraw.X = Cursor.Position.X; + } } resizer.ToDraw = toDraw; } @@ -100,8 +103,11 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) toDraw.Y = this.Location.Y; - if (resizable) toDraw.Height = MousePosition.Y - this.Location.Y; + if (resizable) + { + toDraw.Y = this.Location.Y; + toDraw.Height = MousePosition.Y - this.Location.Y; + } resizer.ToDraw = toDraw; } } @@ -111,8 +117,13 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) toDraw.Width = MousePosition.X - this.Location.X; - if (resizable) toDraw.Height = MousePosition.Y - this.Location.Y; + if (resizable) + { + if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) + toDraw.Width = MousePosition.X - this.Location.X; + toDraw.Height = MousePosition.Y - this.Location.Y; + } + resizer.ToDraw = toDraw; } } @@ -122,9 +133,15 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.Width = ((toDraw.Width + toDraw.Location.X) - Cursor.Position.X); - if (resizable) toDraw.Height = Cursor.Position.Y - this.Location.Y; - if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.X = Cursor.Position.X; + if (resizable) + { + if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) + { + toDraw.Width = ((toDraw.Width + toDraw.Location.X) - Cursor.Position.X); + toDraw.X = Cursor.Position.X; + } + toDraw.Height = Cursor.Position.Y - this.Location.Y; + } resizer.ToDraw = toDraw; } } @@ -134,10 +151,16 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X); - if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.X = Cursor.Position.X; - if (resizable) toDraw.Height = ((this.Height + this.Location.Y) - Cursor.Position.Y); - if (resizable) toDraw.Y = Cursor.Position.Y; + if (resizable) + { + if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) + { + toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X); + toDraw.X = Cursor.Position.X; + } + toDraw.Height = ((this.Height + this.Location.Y) - Cursor.Position.Y); + toDraw.Y = Cursor.Position.Y; + } resizer.ToDraw = toDraw; } } @@ -147,8 +170,11 @@ namespace Histacom2.Engine.Template if(e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y); - if (resizable) toDraw.Y = Cursor.Position.Y; + if (resizable) + { + toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y); + toDraw.Y = Cursor.Position.Y; + } resizer.ToDraw = toDraw; } } @@ -158,9 +184,12 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) toDraw.Width = MousePosition.X - this.Location.X; - if (resizable) toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y); - if (resizable) toDraw.Y = Cursor.Position.Y; + if (resizable) + { + if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) toDraw.Width = MousePosition.X - this.Location.X; + toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y); + toDraw.Y = Cursor.Position.Y; + } resizer.ToDraw = toDraw; } } diff --git a/Histacom2/OS/WinXPBad/Story/Hack4.cs b/Histacom2/OS/WinXPBad/Story/Hack4.cs index 3ed2244..ced4a13 100644 --- a/Histacom2/OS/WinXPBad/Story/Hack4.cs +++ b/Histacom2/OS/WinXPBad/Story/Hack4.cs @@ -7,6 +7,7 @@ using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Forms; namespace Histacom2.OS.WinXPBad.Story { @@ -14,6 +15,8 @@ namespace Histacom2.OS.WinXPBad.Story { public static Win95.Win95Apps.WinClassicTerminal Console = new Win95.Win95Apps.WinClassicTerminal(true); static WindowManager wm = new WindowManager(); + public static bool Stop = false; + static Random Rnd = new Random(); public static async void StartObjective() { @@ -73,6 +76,7 @@ namespace Histacom2.OS.WinXPBad.Story public static async void VirusDestruction(WinClassicIE6Bad ie) { + LabelMaker(); Console.ParentForm.Close(); await Task.Delay(10000); ((WinXP)ie.ParentForm).maximizebutton.Image = ((WinXP)ie.ParentForm).closebutton.Image; await Task.Delay(1000); ((WinXP)ie.ParentForm).minimizebutton.Image = ((WinXP)ie.ParentForm).closebutton.Image; @@ -96,6 +100,21 @@ namespace Histacom2.OS.WinXPBad.Story await Task.Delay(1000); ie.backToolStripMenuItem.Visible = false; ie.panel1.Hide(); ie.label1.BackColor = Color.Black; await Task.Delay(1000); ie.label1.BackColor = Color.White; await Task.Delay(1000); ie.Hide(); + Stop = true; + } + + public static async void LabelMaker() + { + while (!Stop) + { + await Task.Delay(1000); + VirusLabel v = new VirusLabel(); + v.WindowState = FormWindowState.Maximized; + v.label1.Location = new Point(Rnd.Next(Screen.PrimaryScreen.Bounds.Width), Rnd.Next(Screen.PrimaryScreen.Bounds.Height)); + v.Show(); + v.TopMost = true; + v.BringToFront(); + } } } } diff --git a/Histacom2/OS/WinXPBad/VirusLabel.Designer.cs b/Histacom2/OS/WinXPBad/VirusLabel.Designer.cs index 34922ed..d711758 100644 --- a/Histacom2/OS/WinXPBad/VirusLabel.Designer.cs +++ b/Histacom2/OS/WinXPBad/VirusLabel.Designer.cs @@ -35,7 +35,6 @@ // // label1 // - this.label1.Dock = System.Windows.Forms.DockStyle.Fill; this.label1.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.ForeColor = System.Drawing.Color.PaleGreen; this.label1.Location = new System.Drawing.Point(0, 0); @@ -66,8 +65,7 @@ } #endregion - - private System.Windows.Forms.Label label1; private System.Windows.Forms.Timer timer1; + public System.Windows.Forms.Label label1; } }
\ No newline at end of file diff --git a/Histacom2/OS/WinXPBad/WinClassicIE6Bad.Designer.cs b/Histacom2/OS/WinXPBad/WinClassicIE6Bad.Designer.cs index 1f51c7d..ca106d0 100644 --- a/Histacom2/OS/WinXPBad/WinClassicIE6Bad.Designer.cs +++ b/Histacom2/OS/WinXPBad/WinClassicIE6Bad.Designer.cs @@ -57,7 +57,6 @@ this.panel3 = new System.Windows.Forms.Panel(); this.label1 = new System.Windows.Forms.Label(); this.originalTimer = new System.Windows.Forms.Timer(this.components); - this.labelTimer = new System.Windows.Forms.Timer(this.components); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.menuStrip1.SuspendLayout(); @@ -318,12 +317,6 @@ this.originalTimer.Enabled = true; this.originalTimer.Tick += new System.EventHandler(this.originalTimer_Tick); // - // labelTimer - // - this.labelTimer.Enabled = true; - this.labelTimer.Interval = 1000; - this.labelTimer.Tick += new System.EventHandler(this.labelTimer_Tick); - // // WinClassicIE6Bad // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -366,7 +359,6 @@ private System.Windows.Forms.PictureBox pictureBox3; private System.Windows.Forms.Panel panel3; private System.Windows.Forms.Timer originalTimer; - private System.Windows.Forms.Timer labelTimer; public System.Windows.Forms.ToolStripMenuItem backToolStripMenuItem; public System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2; public System.Windows.Forms.ToolStripMenuItem toolStripMenuItem3; diff --git a/Histacom2/OS/WinXPBad/WinClassicIE6Bad.cs b/Histacom2/OS/WinXPBad/WinClassicIE6Bad.cs index c4740fc..dfce481 100644 --- a/Histacom2/OS/WinXPBad/WinClassicIE6Bad.cs +++ b/Histacom2/OS/WinXPBad/WinClassicIE6Bad.cs @@ -15,11 +15,10 @@ namespace Histacom2.OS.WinXPBad public partial class WinClassicIE6Bad : UserControl { private bool light = true; - private Random r = new Random(); - private Random r2 = new Random(); + private static readonly Random Rnd = new Random(); - private int maxX; - private int maxY; + private int maxX = Screen.PrimaryScreen.Bounds.Width; + private int maxY = Screen.PrimaryScreen.Bounds.Height; public WinClassicIE6Bad() { @@ -40,19 +39,10 @@ namespace Histacom2.OS.WinXPBad } } - private void labelTimer_Tick(object sender, EventArgs e) - { - VirusLabel v = new VirusLabel(); - v.Location = new Point(r.Next(0, maxX), r2.Next(0, maxY)); - v.Show(); - v.TopMost = true; - v.BringToFront(); - } - private void WinClassicIE6Bad_Load(object sender, EventArgs e) { - maxX = Screen.PrimaryScreen.Bounds.Width; - maxY = Screen.PrimaryScreen.Bounds.Height; + Console.WriteLine($"{maxX}, {maxY}."); + Hack4.VirusDestruction(this); ((WinXP)ParentForm).closeDisabled = true; } diff --git a/Histacom2/OS/WinXPBad/WinClassicIE6Bad.resx b/Histacom2/OS/WinXPBad/WinClassicIE6Bad.resx index 7ce63c0..1f5eeb4 100644 --- a/Histacom2/OS/WinXPBad/WinClassicIE6Bad.resx +++ b/Histacom2/OS/WinXPBad/WinClassicIE6Bad.resx @@ -117,9 +117,6 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>17, 17</value> - </metadata> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <data name="pictureBox1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> @@ -310,7 +307,4 @@ <metadata name="originalTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>247, 17</value> </metadata> - <metadata name="labelTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>370, 17</value> - </metadata> </root>
\ No newline at end of file @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 TimeHACKDevs +Copyright (c) 2017 Histacom2-Devs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -15,7 +15,6 @@ Histacom 2 is currently being developed in Microsoft Visual Studio 2017. Visual Load the ``.sln`` project file into Visual Studio and compile. No further steps are required. This list may grow in the future. ## Links -Histacom 2 has a forum at https://www.ashifter.ml/timehack/forum Histacom 2 has a Discord server at https://discord.gg/FZgQMDe (You can also click on the dark blue Discord Badge) |
