diff options
Diffstat (limited to 'TimeHACK.Engine')
| -rw-r--r-- | TimeHACK.Engine/TaskBarController.cs | 21 | ||||
| -rw-r--r-- | TimeHACK.Engine/WindowManager.cs | 17 | ||||
| -rw-r--r-- | TimeHACK.Engine/bin/Release/TimeHACK.Engine.dll | bin | 185344 -> 185344 bytes | |||
| -rw-r--r-- | TimeHACK.Engine/bin/Release/TimeHACK.Engine.pdb | bin | 46592 -> 48640 bytes | |||
| -rw-r--r-- | TimeHACK.Engine/obj/Release/TimeHACK.Engine.csproj.GenerateResource.Cache | bin | 2531 -> 2531 bytes | |||
| -rw-r--r-- | TimeHACK.Engine/obj/Release/TimeHACK.Engine.dll | bin | 185344 -> 185344 bytes | |||
| -rw-r--r-- | TimeHACK.Engine/obj/Release/TimeHACK.Engine.pdb | bin | 46592 -> 48640 bytes |
7 files changed, 28 insertions, 10 deletions
diff --git a/TimeHACK.Engine/TaskBarController.cs b/TimeHACK.Engine/TaskBarController.cs index a24d73e..3ede876 100644 --- a/TimeHACK.Engine/TaskBarController.cs +++ b/TimeHACK.Engine/TaskBarController.cs @@ -10,9 +10,10 @@ namespace TimeHACK.Engine { public class TaskBarController { + public static int AvalibleApplicationID; - public Panel AddTaskbarItem95(int ApplicationID, string ApplicationName, Image ApplicationIcon, UserControl taskbar_item, Panel oldPanel) + public Panel AddTaskbarItem95(string ApplicationID, string ApplicationName, Image ApplicationIcon, UserControl taskbar_item, Panel oldPanel) { Panel returnPanel = oldPanel; @@ -31,13 +32,27 @@ namespace TimeHACK.Engine List<Form> AppsList = new List<Form>(); foreach (Form form in Application.OpenForms) { - if ((string)form.Tag != "ignoreFormOnTaskbar") + if (form.Tag.ToString() != "ignoreFormOnTaskbar") { AppsList.Add(form); } } - return AppsList; } + + public void FocusAppFromID(string ApplicationID) + { + + foreach (Form form in Application.OpenForms) + { + if (form.Tag.ToString() == ApplicationID) + { + form.Show(); + form.BringToFront(); + form.Focus(); + return; + } + } + } } } diff --git a/TimeHACK.Engine/WindowManager.cs b/TimeHACK.Engine/WindowManager.cs index a3baf42..6bb7cc5 100644 --- a/TimeHACK.Engine/WindowManager.cs +++ b/TimeHACK.Engine/WindowManager.cs @@ -10,7 +10,6 @@ namespace TimeHACK.Engine { public static System.Drawing.Text.PrivateFontCollection pfc = new System.Drawing.Text.PrivateFontCollection(); - public WinClassic startWin95(UserControl content, String title, Image icon, Boolean MaxButton, Boolean MinButton) { // Setup Window @@ -54,14 +53,18 @@ namespace TimeHACK.Engine // Time for the taskbar - // Convert an image to an icon - Bitmap theBitmap = new Bitmap(icon, new Size(icon.Width, icon.Height)); - IntPtr Hicon = theBitmap.GetHicon();// Get an Hicon for myBitmap. - Icon newIcon = Icon.FromHandle(Hicon);// Create a new icon from the handle. + // Convert an image to an icon (for the taskbar) + if (icon != null) + { + Bitmap theBitmap = new Bitmap(icon, new Size(icon.Width, icon.Height)); + IntPtr Hicon = theBitmap.GetHicon(); // Get an Hicon for myBitmap. + Icon newIcon = Icon.FromHandle(Hicon); // Create a new icon from the handle. + app.Icon = newIcon; + } + // Set some values (for the taskbar) app.Tag = TaskBarController.AvalibleApplicationID; - app.Text = title; - app.Icon = newIcon; + app.Text = title; // Show the app app.Show(); diff --git a/TimeHACK.Engine/bin/Release/TimeHACK.Engine.dll b/TimeHACK.Engine/bin/Release/TimeHACK.Engine.dll Binary files differindex 1d4ab6d..7f8ea89 100644 --- a/TimeHACK.Engine/bin/Release/TimeHACK.Engine.dll +++ b/TimeHACK.Engine/bin/Release/TimeHACK.Engine.dll diff --git a/TimeHACK.Engine/bin/Release/TimeHACK.Engine.pdb b/TimeHACK.Engine/bin/Release/TimeHACK.Engine.pdb Binary files differindex 7ffb8c2..36a9e06 100644 --- a/TimeHACK.Engine/bin/Release/TimeHACK.Engine.pdb +++ b/TimeHACK.Engine/bin/Release/TimeHACK.Engine.pdb diff --git a/TimeHACK.Engine/obj/Release/TimeHACK.Engine.csproj.GenerateResource.Cache b/TimeHACK.Engine/obj/Release/TimeHACK.Engine.csproj.GenerateResource.Cache Binary files differindex 0cb0ac1..c981e8d 100644 --- a/TimeHACK.Engine/obj/Release/TimeHACK.Engine.csproj.GenerateResource.Cache +++ b/TimeHACK.Engine/obj/Release/TimeHACK.Engine.csproj.GenerateResource.Cache diff --git a/TimeHACK.Engine/obj/Release/TimeHACK.Engine.dll b/TimeHACK.Engine/obj/Release/TimeHACK.Engine.dll Binary files differindex 1d4ab6d..7f8ea89 100644 --- a/TimeHACK.Engine/obj/Release/TimeHACK.Engine.dll +++ b/TimeHACK.Engine/obj/Release/TimeHACK.Engine.dll diff --git a/TimeHACK.Engine/obj/Release/TimeHACK.Engine.pdb b/TimeHACK.Engine/obj/Release/TimeHACK.Engine.pdb Binary files differindex 7ffb8c2..36a9e06 100644 --- a/TimeHACK.Engine/obj/Release/TimeHACK.Engine.pdb +++ b/TimeHACK.Engine/obj/Release/TimeHACK.Engine.pdb |
