diff options
| author | Alex-TIMEHACK <[email protected]> | 2017-05-01 09:54:13 +0100 |
|---|---|---|
| committer | Alex-TIMEHACK <[email protected]> | 2017-05-01 09:54:13 +0100 |
| commit | e0c8a9521719dcb6d702d489fed05ea28c6afe94 (patch) | |
| tree | 242246acd5a750cb7ac3b25ddf467d5a638f9ede /TimeHACK.Engine/WindowManager.cs | |
| parent | 12c253ab76b8117a563b021e969262da13eaec9d (diff) | |
| download | histacom2-e0c8a9521719dcb6d702d489fed05ea28c6afe94.tar.gz histacom2-e0c8a9521719dcb6d702d489fed05ea28c6afe94.tar.bz2 histacom2-e0c8a9521719dcb6d702d489fed05ea28c6afe94.zip | |
Fully working taskbar!
IT WORKS!
Diffstat (limited to 'TimeHACK.Engine/WindowManager.cs')
| -rw-r--r-- | TimeHACK.Engine/WindowManager.cs | 17 |
1 files changed, 10 insertions, 7 deletions
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(); |
