From 3f3c2087d86d0a3a26d6878557c6e37a3e4b625d Mon Sep 17 00:00:00 2001 From: Michael Webb Date: Sat, 6 Apr 2019 14:06:57 -0500 Subject: [EXPERIMENTAL] Fix for the flickering issue, esp. on Bad XP --- Histacom2/OS/Win95/Win95.cs | 51 +++++++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 16 deletions(-) (limited to 'Histacom2/OS/Win95/Win95.cs') diff --git a/Histacom2/OS/Win95/Win95.cs b/Histacom2/OS/Win95/Win95.cs index ad828ba..c0f3622 100644 --- a/Histacom2/OS/Win95/Win95.cs +++ b/Histacom2/OS/Win95/Win95.cs @@ -36,6 +36,17 @@ namespace Histacom2.OS.Win95 ListViewItem heldDownItem; Point heldDownPoint; + + // Overrides the Painting function of the Form, so that you don't see all that crap drawing. + protected override CreateParams CreateParams + { + get + { + CreateParams cp = base.CreateParams; + cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED + return cp; + } + } // Init the form public Windows95() @@ -113,22 +124,6 @@ namespace Histacom2.OS.Win95 // Bring to this the front this.BringToFront(); - //Check if it is the first time - if (!CurrentSave.FTime95) - { - CurrentSave.FTime95 = true; - SaveGame(); - welcome = wm.Init(new Win95Welcome(), "Welcome", null, false, false, resize: false); - AddTaskBarItem(welcome, welcome.Tag.ToString(), "Welcome", null); - - nonimportantapps.Add(welcome); - nonimportantapps[nonimportantapps.Count - 1].BringToFront(); - nonimportantapps[nonimportantapps.Count - 1].FormClosing += new FormClosingEventHandler(NonImportantApp_Closing); - - welcome.BringToFront(); - welcome.Activate(); - } - // Update the Desktop icons DesktopController.RefreshDesktopIcons(new ListViewItem[] { new ListViewItem("My Computer", 0), @@ -648,6 +643,30 @@ namespace Histacom2.OS.Win95 { startmenu.Hide(); } + + private void waitUntil95Loaded_Tick(object sender, EventArgs e) + { + if (Visible) + { + //Check if it is the first time + if (!CurrentSave.FTime95) + { + CurrentSave.FTime95 = true; + SaveGame(); + welcome = wm.Init(new Win95Welcome(), "Welcome", null, false, false, resize: false); + AddTaskBarItem(welcome, welcome.Tag.ToString(), "Welcome", null); + + nonimportantapps.Add(welcome); + nonimportantapps[nonimportantapps.Count - 1].BringToFront(); + nonimportantapps[nonimportantapps.Count - 1].FormClosing += new FormClosingEventHandler(NonImportantApp_Closing); + + welcome.BringToFront(); + welcome.Activate(); + + waitUntil95Loaded.Enabled = false; + } + } + } } } -- cgit v1.2.3