From a4212e042bc4dca160fd6f753d7cbf9e412955fa Mon Sep 17 00:00:00 2001 From: Mastercodeon Date: Sat, 21 Jan 2023 19:32:57 -0600 Subject: [PATCH] Main upload --- DarkControls/BlankForm.Designer.cs | 100 ++ DarkControls/BlankForm.cs | 48 + DarkControls/BlankForm.resx | 239 +++ DarkControls/Controls/AppIcon.cs | 171 ++ DarkControls/Controls/CloseButton.cs | 24 + DarkControls/Controls/CustomCheckedListBox.cs | 101 ++ DarkControls/Controls/CustomScrollBar.cs | 342 ++++ DarkControls/Controls/CustomStatusStrip.cs | 52 + DarkControls/Controls/DarkButton.cs | 23 + DarkControls/Controls/DarkCheckBox.cs | 274 ++++ DarkControls/Controls/DarkSelectFileButton.cs | 26 + DarkControls/Controls/DarkTextBox.cs | 50 + DarkControls/Controls/FlatScrollBar.cs | 12 + DarkControls/Controls/FlatScrollBar1.cs | 1384 +++++++++++++++++ DarkControls/Controls/MaximizeButton.cs | 24 + DarkControls/Controls/MinimizeButton.cs | 24 + DarkControls/Controls/NoFocusCueBotton.cs | 24 + DarkControls/Controls/ProgressBarEx.cs | 49 + .../Controls/SimpleColorTransforms.cs | 403 +++++ DarkControls/Controls/TransparentLabel.cs | 27 + .../Controls/WindowsDefaultTitleBarButton.cs | 325 ++++ DarkControls/DarkControls.csproj | 140 ++ DarkControls/Properties/AssemblyInfo.cs | 36 + DarkControls/Properties/Resources.Designer.cs | 103 ++ DarkControls/Properties/Resources.resx | 245 +++ DarkControls/Utils.cs | 26 + .../icons8-crossed-axes-100.png | Bin DarkControls/selectFileBtn.Image.png | Bin 0 -> 690 bytes KsDumper.sln => KsDumper11.sln | 22 +- .../Driver/DriverInterface.cs | 4 +- .../Driver/KsDumperDriver.sys | Bin .../Driver/LoadCapcom.bat | 0 .../Driver/Operations.cs | 4 +- .../Driver/Taigei64.dll | Bin .../Driver/drv64.dll | Bin {KsDumperClient => KsDumper11}/Driver/kdu.exe | Bin .../Dumper.Designer.cs | 9 +- {KsDumperClient => KsDumper11}/Dumper.cs | 8 +- {KsDumperClient => KsDumper11}/Dumper.resx | 0 .../KsDumper11.csproj | 5 +- .../PE/32/PE32File.cs | 4 +- .../PE/32/PE32Header.cs | 4 +- .../PE/64/PE64File.cs | 4 +- .../PE/64/PE64Header.cs | 4 +- .../PE/DOSHeader.cs | 4 +- .../PE/NativePEStructs.cs | 2 +- {KsDumperClient => KsDumper11}/PE/PEFile.cs | 2 +- .../PE/PESection.cs | 4 +- .../ProcessDumper.cs | 8 +- .../ProcessSummary.cs | 6 +- {KsDumperClient => KsDumper11}/Program.cs | 4 +- .../Properties/AssemblyInfo.cs | 0 .../Properties/Resources.Designer.cs | 4 +- .../Properties/Resources.cs | 0 .../Properties/Resources.resources | Bin .../Properties/Resources.resx | 0 KsDumper11/Properties/Settings.Designer.cs | 26 + .../Properties/Settings.settings | 0 .../Utility/Logger.cs | 2 +- .../Utility/MarshalUtility.cs | 2 +- .../Utility/ProcessListView.cs | 2 +- .../Utility/WinApi.cs | 2 +- {KsDumperClient => KsDumper11}/app.config | 0 {KsDumperClient => KsDumper11}/app.manifest | 0 KsDumper11/icons8-crossed-axes-100.png | Bin 0 -> 5318 bytes .../Properties/Settings.Designer.cs | 26 - README.md | 50 + 67 files changed, 4410 insertions(+), 74 deletions(-) create mode 100644 DarkControls/BlankForm.Designer.cs create mode 100644 DarkControls/BlankForm.cs create mode 100644 DarkControls/BlankForm.resx create mode 100644 DarkControls/Controls/AppIcon.cs create mode 100644 DarkControls/Controls/CloseButton.cs create mode 100644 DarkControls/Controls/CustomCheckedListBox.cs create mode 100644 DarkControls/Controls/CustomScrollBar.cs create mode 100644 DarkControls/Controls/CustomStatusStrip.cs create mode 100644 DarkControls/Controls/DarkButton.cs create mode 100644 DarkControls/Controls/DarkCheckBox.cs create mode 100644 DarkControls/Controls/DarkSelectFileButton.cs create mode 100644 DarkControls/Controls/DarkTextBox.cs create mode 100644 DarkControls/Controls/FlatScrollBar.cs create mode 100644 DarkControls/Controls/FlatScrollBar1.cs create mode 100644 DarkControls/Controls/MaximizeButton.cs create mode 100644 DarkControls/Controls/MinimizeButton.cs create mode 100644 DarkControls/Controls/NoFocusCueBotton.cs create mode 100644 DarkControls/Controls/ProgressBarEx.cs create mode 100644 DarkControls/Controls/SimpleColorTransforms.cs create mode 100644 DarkControls/Controls/TransparentLabel.cs create mode 100644 DarkControls/Controls/WindowsDefaultTitleBarButton.cs create mode 100644 DarkControls/DarkControls.csproj create mode 100644 DarkControls/Properties/AssemblyInfo.cs create mode 100644 DarkControls/Properties/Resources.Designer.cs create mode 100644 DarkControls/Properties/Resources.resx create mode 100644 DarkControls/Utils.cs rename {KsDumperClient => DarkControls}/icons8-crossed-axes-100.png (100%) create mode 100644 DarkControls/selectFileBtn.Image.png rename KsDumper.sln => KsDumper11.sln (62%) rename {KsDumperClient => KsDumper11}/Driver/DriverInterface.cs (98%) rename {KsDumperClient => KsDumper11}/Driver/KsDumperDriver.sys (100%) rename {KsDumperClient => KsDumper11}/Driver/LoadCapcom.bat (100%) rename {KsDumperClient => KsDumper11}/Driver/Operations.cs (95%) rename {KsDumperClient => KsDumper11}/Driver/Taigei64.dll (100%) rename {KsDumperClient => KsDumper11}/Driver/drv64.dll (100%) rename {KsDumperClient => KsDumper11}/Driver/kdu.exe (100%) rename {KsDumperClient => KsDumper11}/Dumper.Designer.cs (98%) rename {KsDumperClient => KsDumper11}/Dumper.cs (99%) rename {KsDumperClient => KsDumper11}/Dumper.resx (100%) rename KsDumperClient/KsDumperClient.csproj => KsDumper11/KsDumper11.csproj (98%) rename {KsDumperClient => KsDumper11}/PE/32/PE32File.cs (98%) rename {KsDumperClient => KsDumper11}/PE/32/PE32Header.cs (99%) rename {KsDumperClient => KsDumper11}/PE/64/PE64File.cs (98%) rename {KsDumperClient => KsDumper11}/PE/64/PE64Header.cs (99%) rename {KsDumperClient => KsDumper11}/PE/DOSHeader.cs (97%) rename {KsDumperClient => KsDumper11}/PE/NativePEStructs.cs (99%) rename {KsDumperClient => KsDumper11}/PE/PEFile.cs (98%) rename {KsDumperClient => KsDumper11}/PE/PESection.cs (96%) rename {KsDumperClient => KsDumper11}/ProcessDumper.cs (98%) rename {KsDumperClient => KsDumper11}/ProcessSummary.cs (97%) rename {KsDumperClient => KsDumper11}/Program.cs (97%) rename {KsDumperClient => KsDumper11}/Properties/AssemblyInfo.cs (100%) rename {KsDumperClient => KsDumper11}/Properties/Resources.Designer.cs (95%) rename {KsDumperClient => KsDumper11}/Properties/Resources.cs (100%) rename {KsDumperClient => KsDumper11}/Properties/Resources.resources (100%) rename {KsDumperClient => KsDumper11}/Properties/Resources.resx (100%) create mode 100644 KsDumper11/Properties/Settings.Designer.cs rename {KsDumperClient => KsDumper11}/Properties/Settings.settings (100%) rename {KsDumperClient => KsDumper11}/Utility/Logger.cs (96%) rename {KsDumperClient => KsDumper11}/Utility/MarshalUtility.cs (97%) rename {KsDumperClient => KsDumper11}/Utility/ProcessListView.cs (99%) rename {KsDumperClient => KsDumper11}/Utility/WinApi.cs (98%) rename {KsDumperClient => KsDumper11}/app.config (100%) rename {KsDumperClient => KsDumper11}/app.manifest (100%) create mode 100644 KsDumper11/icons8-crossed-axes-100.png delete mode 100644 KsDumperClient/Properties/Settings.Designer.cs diff --git a/DarkControls/BlankForm.Designer.cs b/DarkControls/BlankForm.Designer.cs new file mode 100644 index 0000000..a8c1b79 --- /dev/null +++ b/DarkControls/BlankForm.Designer.cs @@ -0,0 +1,100 @@ +namespace DarkControls +{ + partial class BlankForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BlankForm)); + this.transparentLabel1 = new DarkControls.Controls.TransparentLabel(); + this.closeBtn = new DarkControls.Controls.WindowsDefaultTitleBarButton(); + this.appIcon1 = new DarkControls.Controls.AppIcon(); + ((System.ComponentModel.ISupportInitialize)(this.appIcon1)).BeginInit(); + this.SuspendLayout(); + // + // transparentLabel1 + // + this.transparentLabel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.transparentLabel1.Location = new System.Drawing.Point(32, 4); + this.transparentLabel1.Name = "transparentLabel1"; + this.transparentLabel1.Size = new System.Drawing.Size(108, 20); + this.transparentLabel1.TabIndex = 8; + this.transparentLabel1.Text = "Form1"; + // + // closeBtn + // + this.closeBtn.ButtonType = DarkControls.Controls.WindowsDefaultTitleBarButton.Type.Close; + this.closeBtn.ClickColor = System.Drawing.Color.Red; + this.closeBtn.ClickIconColor = System.Drawing.Color.Black; + this.closeBtn.HoverColor = System.Drawing.Color.OrangeRed; + this.closeBtn.HoverIconColor = System.Drawing.Color.Black; + this.closeBtn.IconColor = System.Drawing.Color.Black; + this.closeBtn.IconLineThickness = 2; + this.closeBtn.Location = new System.Drawing.Point(776, 0); + this.closeBtn.Name = "closeBtn"; + this.closeBtn.Size = new System.Drawing.Size(40, 40); + this.closeBtn.TabIndex = 7; + this.closeBtn.Text = "windowsDefaultTitleBarButton1"; + this.closeBtn.UseVisualStyleBackColor = true; + // + // appIcon1 + // + this.appIcon1.AppIconImage = ((System.Drawing.Image)(resources.GetObject("appIcon1.AppIconImage"))); + this.appIcon1.Image = ((System.Drawing.Image)(resources.GetObject("appIcon1.Image"))); + this.appIcon1.Location = new System.Drawing.Point(0, 1); + this.appIcon1.Name = "appIcon1"; + this.appIcon1.Scale = 3.5F; + this.appIcon1.Size = new System.Drawing.Size(28, 28); + this.appIcon1.TabIndex = 9; + this.appIcon1.TabStop = false; + // + // Form1 + // + this.AllowDrop = true; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(33)))), ((int)(((byte)(33))))); + this.ClientSize = new System.Drawing.Size(816, 489); + this.Controls.Add(this.appIcon1); + this.Controls.Add(this.transparentLabel1); + this.Controls.Add(this.closeBtn); + this.DoubleBuffered = true; + this.ForeColor = System.Drawing.Color.Silver; + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "Form1"; + this.Text = "Basic File Box"; + ((System.ComponentModel.ISupportInitialize)(this.appIcon1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + private DarkControls.Controls.WindowsDefaultTitleBarButton closeBtn; + private DarkControls.Controls.TransparentLabel transparentLabel1; + private DarkControls.Controls.AppIcon appIcon1; + } +} + diff --git a/DarkControls/BlankForm.cs b/DarkControls/BlankForm.cs new file mode 100644 index 0000000..68e70ad --- /dev/null +++ b/DarkControls/BlankForm.cs @@ -0,0 +1,48 @@ +using System; +using System.IO; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Runtime.InteropServices; +using System.Diagnostics; +using DarkControls; + +namespace DarkControls +{ + public partial class BlankForm : Form + { + protected override CreateParams CreateParams + { + get + { + // Activate double buffering at the form level. All child controls will be double buffered as well. + CreateParams cp = base.CreateParams; + cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED + return cp; + } + } + + public BlankForm() + { + + InitializeComponent(); + + this.FormBorderStyle = FormBorderStyle.None; + this.Region = Region.FromHrgn(Utils.CreateRoundRectRgn(0, 0, Width, Height, 10, 10)); + this.closeBtn.Region = Region.FromHrgn(Utils.CreateRoundRectRgn(0, 0, closeBtn.Width, closeBtn.Height, 10, 10)); + } + + protected override void WndProc(ref Message m) + { + base.WndProc(ref m); + if (m.Msg == Utils.WM_NCHITTEST) + m.Result = (IntPtr)(Utils.HT_CAPTION); + } + } +} diff --git a/DarkControls/BlankForm.resx b/DarkControls/BlankForm.resx new file mode 100644 index 0000000..bd3c983 --- /dev/null +++ b/DarkControls/BlankForm.resx @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL + EQAACxEBf2RfkQAAFCZJREFUeF7tXQl0lFWaDTraYzvTdJ8ZbRfEFpFNNgk7gSAECFsgQBaSACKLEPal + XRuxu1EYQA5JUeACsp2wJOyETTAhUaGitEoGgTmSEefM6T5OZ0bbdoOq4s79Ku9V3v+nQqUSSALWPeee + 1P+++33ve+/W++tPHYMRYYQRRhhhhBFGGGGEEUYYYYQRRhhhhBFGGGGEETrunYZ+98/AlvtmoIg/998/ + HZMiJ+M2Fa4ztFqI2++ficnsK1d6I7Pum44YFb4JsRC3PDANjgemAwF44r5p+BelrHXI3NKDrSfNTOld + SW8WoEHjaVj94DSgMjZOxyf3Tsa/qoRaQ+Op+NWD6fgwUE+a7H3dDW1Kkylo/VA6nm8yFZvIdU3SsY+E + wQ9+k44x1Gy0jE/Fxy1q8aTIXDKnrYdN0htff2AZlzXIWhiXtT2cjkdVmfqLZnyHN52KveQVEoH48FQU + tkrHP6mUCF4vtsSn1I4pMofMZZl7KpaocETbebiT8QIzbuOVplOwR9asUuoXWj6FR5o9hYvNpwBXYYFp + hkbzp7DYonvq+poitWUO25x+MzTapuFOxgosOhtlzbJ2lVI/0GwiHmo5Gf/NxlAZWzwV2AwNahbb9NfF +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1FKoQVspue7GUDqrQVrwNn/G6VEHPFKtwuURNbzOti3nzNxKxx4b3iuWDURGKk+VKDPCa + b3ZIgdsVCvx6RqJHuVamxFC5AnW8/tdUylHVEEZUFwi7YzI8URmEycMhKDwcjP3Mu1XD/sqOB5A9zxwL + wlHR9mDUy9BSK8MvJ0IQ85EcHnUBuFEjwzvCllhdUSej63VyuNYHQ3uCZwPQJOy10eqH9tN++KbRFwU9 + Mlg3++LrJv+Fze7BtIoWX1xr9CGrU74oZD232/zQIuzV0e2B+l5XjHV4UNmIgh7r8sJEuzdKhb2EDm9U + dHniJkm0rsOLys64YLx7K2qFfX/6XLC/1x/XOqbnlH2BeK7fDRO9Wxees+U464Hyc24Y/9yHnu2Z/E3F + Zoz1OSNH2MvzhTN6Lvj9+e5g+2zigCsmzzsvvYzLcf5llA+44NZI82zSBR8cZ70rX9pBR/IcccToFVuM + Dm9BnpBXzbAT3uC9lxxx+ZLTwpvnvlzfTE9eccAmsVwzX70Em8m/vVMf8h8iSX8BwCCUC3RVqvIAAAAA + SUVORK5CYII= + + + \ No newline at end of file diff --git a/DarkControls/Controls/AppIcon.cs b/DarkControls/Controls/AppIcon.cs new file mode 100644 index 0000000..8dc0dbe --- /dev/null +++ b/DarkControls/Controls/AppIcon.cs @@ -0,0 +1,171 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Drawing; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +using System.ComponentModel; + +namespace DarkControls.Controls +{ + public class AppIcon : PictureBox + { + private float _Scale = 3.5f; + + [ +Description("The value used to scale down the icon"), + DefaultValue("3.5"), + RefreshProperties(RefreshProperties.All) +] + public float Scale + { + get + { + return _Scale; + } + set + { + _Scale = value; + this.Size = Size.Empty; + } + } + + [ + DefaultValue("50, 50"), + RefreshProperties(RefreshProperties.All) +] + public new Size Size + { + get + { + return base.Size; + } + set + { + SizeF sz = calcImgSize(); + this.Image = ResizeImage(appIconImg, (int)sz.Width, (int)sz.Height); + base.Size = new Size((int)sz.Width, (int)sz.Height); + } + } + private bool drag = false; // determine if we should be moving the form + private Point startPoint = new Point(0, 0); // also for the moving + public Form DragForm { get; set; } = null; + + private Image appIconImg = Properties.Resources.icons8_crossed_axes_100; + + [ +Description("The image that will be used for the icon"), + RefreshProperties(RefreshProperties.All) +] + public Image AppIconImage + { + get + { + return appIconImg; + } + set + { + appIconImg = value; + } + } + + public AppIcon() + { + SetStyle(ControlStyles.SupportsTransparentBackColor, true); + //BackColor = Color.Transparent; + + this.MouseDown += AppLogo_MouseDown; + this.MouseUp += AppLogo_MouseUp; + this.MouseMove += AppLogo_MouseMove; + SizeF sz = calcImgSize(); + this.Image = ResizeImage(appIconImg, (int)sz.Width, (int)sz.Height); + this.Size = new Size((int)sz.Width, (int)sz.Height); + + if (this.DesignMode == false) + { + if (DragForm != null) DragForm.Load += DragForm_Load; + } + } + + private SizeF calcImgSize() + { + float scale = 3.5f; + SizeF sz = new SizeF(appIconImg.Width, appIconImg.Height); + float x = sz.Width / (float)scale; + float y = sz.Height / (float)scale; + return new SizeF(x, y); + } + + private void DragForm_Load(object sender, EventArgs e) + { + SizeF sz = calcImgSize(); + this.Image = ResizeImage(appIconImg, (int)sz.Width, (int)sz.Height); + this.Size = new Size((int)sz.Width, (int)sz.Height); + this.Invalidate(); + } + + private void AppLogo_MouseMove(object sender, MouseEventArgs e) + { + if (this.drag) + { // if we should be dragging it, we need to figure out some movement + Point p1 = new Point(e.X, e.Y); + Point p2 = DragForm.PointToScreen(p1); + Point p3 = new Point(p2.X - this.startPoint.X, + p2.Y - this.startPoint.Y); + DragForm.Location = p3; + } + } + + private void AppLogo_MouseUp(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + this.drag = false; + } + } + + private void AppLogo_MouseDown(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + this.startPoint = e.Location; + this.drag = true; + } + } + + /// + /// Resize the image to the specified width and height. + /// + /// The image to resize. + /// The width to resize to. + /// The height to resize to. + /// The resized image. + public static Bitmap ResizeImage(Image image, int width, int height) + { + var destRect = new Rectangle(0, 0, width, height); + var destImage = new Bitmap(width, height); + + destImage.SetResolution(image.HorizontalResolution, image.VerticalResolution); + + using (var graphics = Graphics.FromImage(destImage)) + { + graphics.CompositingMode = CompositingMode.SourceCopy; + graphics.CompositingQuality = CompositingQuality.HighQuality; + graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; + graphics.SmoothingMode = SmoothingMode.HighQuality; + graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; + + using (var wrapMode = new ImageAttributes()) + { + wrapMode.SetWrapMode(WrapMode.TileFlipXY); + graphics.DrawImage(image, destRect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, wrapMode); + } + } + + return destImage; + } + } +} diff --git a/DarkControls/Controls/CloseButton.cs b/DarkControls/Controls/CloseButton.cs new file mode 100644 index 0000000..267e1d8 --- /dev/null +++ b/DarkControls/Controls/CloseButton.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DarkControls.Controls +{ + public class CloseButton : WindowsDefaultTitleBarButton + { + public CloseButton() + { + this.ButtonType = DarkControls.Controls.WindowsDefaultTitleBarButton.Type.Close; + this.ClickColor = System.Drawing.Color.Red; + this.ClickIconColor = System.Drawing.Color.Black; + this.HoverColor = System.Drawing.Color.OrangeRed; + this.HoverIconColor = System.Drawing.Color.Black; + this.IconColor = System.Drawing.Color.Black; + this.IconLineThickness = 2; + this.Size = new System.Drawing.Size(40, 40); + this.UseVisualStyleBackColor = true; + } + } +} diff --git a/DarkControls/Controls/CustomCheckedListBox.cs b/DarkControls/Controls/CustomCheckedListBox.cs new file mode 100644 index 0000000..67532b2 --- /dev/null +++ b/DarkControls/Controls/CustomCheckedListBox.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Drawing; +using System.Drawing.Text; +using System.Drawing.Drawing2D; + +namespace DarkControls.Controls +{ + public class CustomCheckedListBox : CheckedListBox + { + public CustomCheckedListBox() + { + //this.SetStyle( + // ControlStyles.OptimizedDoubleBuffer | + // ControlStyles.ResizeRedraw, + // //ControlStyles.UserPaint, + // true); + //this.DrawMode = DrawMode.OwnerDrawFixed; + + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(33)))), ((int)(((byte)(33))))); + this.ForeColor = Color.Silver; + this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.CheckedItemColor = System.Drawing.Color.Silver; + this.CheckOnClick = true; + } + + + + protected override void OnPaint(PaintEventArgs e) + { + Region iRegion = new Region(e.ClipRectangle); + e.Graphics.FillRegion(new SolidBrush(this.BackColor), iRegion); + if (this.Items.Count > 0) + { + for (int i = 0; i < this.Items.Count; ++i) + { + System.Drawing.Rectangle irect = this.GetItemRectangle(i); + if (e.ClipRectangle.IntersectsWith(irect)) + { + if ((this.SelectionMode == SelectionMode.One && this.SelectedIndex == i) + || (this.SelectionMode == SelectionMode.MultiSimple && this.SelectedIndices.Contains(i)) + || (this.SelectionMode == SelectionMode.MultiExtended && this.SelectedIndices.Contains(i))) + { + OnDrawItem(new DrawItemEventArgs(e.Graphics, this.Font, + irect, i, + DrawItemState.Selected, this.ForeColor, + this.BackColor)); + } + else + { + OnDrawItem(new DrawItemEventArgs(e.Graphics, this.Font, + irect, i, + DrawItemState.Default, this.ForeColor, + this.BackColor)); + } + iRegion.Complement(irect); + } + } + } + base.OnPaint(e); + } + + protected override void OnDrawItem(DrawItemEventArgs e) + { + Size checkSize = CheckBoxRenderer.GetGlyphSize(e.Graphics, System.Windows.Forms.VisualStyles.CheckBoxState.CheckedNormal); + int dx = (e.Bounds.Height - checkSize.Width) / 2; + e.DrawBackground(); + //e.DrawFocusRectangle(); + if (this.Items.Count > 0) + { + //var isChecked = GetItemChecked(e.Index) ? CheckState.Checked : CheckState.Unchecked; + bool isChecked = GetItemChecked(e.Index);//For some reason e.State doesn't work so we have to do this instead. + //CheckBoxRenderer.DrawCheckBox(e.Graphics, new Point(dx, e.Bounds.Top + dx), isChecked ? System.Windows.Forms.VisualStyles.CheckBoxState.CheckedNormal : System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedNormal); + DarkCheckBox.DrawCheckBox(e.Graphics, new Point(dx, e.Bounds.Top + dx), this.GetItemCheckState(e.Index)); + using (StringFormat sf = new StringFormat { LineAlignment = StringAlignment.Center }) + { + using (Brush brush = new SolidBrush(isChecked ? CheckedItemColor : ForeColor)) + { + e.Graphics.DrawString(Items[e.Index].ToString(), Font, brush, new Rectangle(e.Bounds.Height, e.Bounds.Top, e.Bounds.Width - e.Bounds.Height, e.Bounds.Height), sf); + } + } + } + + //base.OnDrawItem(e); + } + Color checkedItemColor = Color.Green; + public Color CheckedItemColor + { + get { return checkedItemColor; } + set + { + checkedItemColor = value; + //Invalidate(); + } + } + } +} diff --git a/DarkControls/Controls/CustomScrollBar.cs b/DarkControls/Controls/CustomScrollBar.cs new file mode 100644 index 0000000..e13a6cf --- /dev/null +++ b/DarkControls/Controls/CustomScrollBar.cs @@ -0,0 +1,342 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms.VisualStyles; +using System.Windows.Forms; + +namespace DarkControls.Controls +{ + public class CustomScrollBar : Control + { + private Rectangle clickedBarRectangle; + private Rectangle thumbRectangle; + private Rectangle leftArrowRectangle; + private Rectangle rightArrowRectangle; + private bool leftArrowClicked = false; + private bool rightArrowClicked = false; + private bool leftBarClicked = false; + private bool rightBarClicked = false; + private bool thumbClicked = false; + private ScrollBarState thumbState = ScrollBarState.Normal; + private ScrollBarArrowButtonState leftButtonState = + ScrollBarArrowButtonState.LeftNormal; + private ScrollBarArrowButtonState rightButtonState = + ScrollBarArrowButtonState.RightNormal; + + // This control does not allow these widths to be altered. + private int thumbWidth = 15; + private int arrowWidth = 17; + + // Set the right limit of the thumb's right border. + private int thumbRightLimitRight = 0; + + // Set the right limit of the thumb's left border. + private int thumbRightLimitLeft = 0; + + // Set the left limit of thumb's left border. + private int thumbLeftLimit = 0; + + // Set the distance from the left edge of the thumb to the + // cursor tip. + private int thumbPosition = 0; + + // Set the distance from the left edge of the scroll bar track + // to the cursor tip. + private int trackPosition = 0; + + // This timer draws the moving thumb while the scroll arrows or + // track are pressed. + private Timer progressTimer = new Timer(); + + public CustomScrollBar() + : base() + { + this.Location = new Point(10, 10); + this.Width = 200; + this.Height = 20; + this.DoubleBuffered = true; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(33)))), ((int)(((byte)(33))))); + + SetUpScrollBar(); + progressTimer.Interval = 20; + progressTimer.Tick += new EventHandler(progressTimer_Tick); + } + + // Calculate the sizes of the scroll bar elements. + private void SetUpScrollBar() + { + clickedBarRectangle = ClientRectangle; + thumbRectangle = new Rectangle( + ClientRectangle.X + ClientRectangle.Width / 2, + ClientRectangle.Y, thumbWidth, + ClientRectangle.Height); + leftArrowRectangle = new Rectangle( + ClientRectangle.X, ClientRectangle.Y, + arrowWidth, ClientRectangle.Height); + rightArrowRectangle = new Rectangle( + ClientRectangle.Right - arrowWidth, + ClientRectangle.Y, arrowWidth, + ClientRectangle.Height); + + // Set the default starting thumb position. + thumbPosition = thumbWidth / 2; + + // Set the right limit of the thumb's right border. + thumbRightLimitRight = ClientRectangle.Right - arrowWidth; + + // Set the right limit of the thumb's left border. + thumbRightLimitLeft = thumbRightLimitRight - thumbWidth; + + // Set the left limit of the thumb's left border. + thumbLeftLimit = ClientRectangle.X + arrowWidth; + } + + // Draw the scroll bar in its normal state. + protected override void OnPaint(PaintEventArgs e) + { + e.Graphics.Clear(BackColor); + base.OnPaint(e); + + // Visual styles are not enabled. + if (!ScrollBarRenderer.IsSupported) + { + this.Parent.Text = "CustomScrollBar Disabled"; + return; + } + + this.Parent.Text = "CustomScrollBar Enabled"; + + // Draw the scroll bar track. + ScrollBarRenderer.DrawRightHorizontalTrack(e.Graphics, + ClientRectangle, ScrollBarState.Normal); + + // Draw the thumb and thumb grip in the current state. + ScrollBarRenderer.DrawHorizontalThumb(e.Graphics, + thumbRectangle, thumbState); + ScrollBarRenderer.DrawHorizontalThumbGrip(e.Graphics, + thumbRectangle, thumbState); + + // Draw the scroll arrows in the current state. + ScrollBarRenderer.DrawArrowButton(e.Graphics, + leftArrowRectangle, leftButtonState); + ScrollBarRenderer.DrawArrowButton(e.Graphics, + rightArrowRectangle, rightButtonState); + + // Draw a highlighted rectangle in the left side of the scroll + // bar track if the user has clicked between the left arrow + // and thumb. + if (leftBarClicked) + { + clickedBarRectangle.X = thumbLeftLimit; + clickedBarRectangle.Width = thumbRectangle.X - thumbLeftLimit; + ScrollBarRenderer.DrawLowerVerticalTrack(e.Graphics, + clickedBarRectangle, ScrollBarState.Pressed); + } + + // Draw a highlighted rectangle in the right side of the scroll + // bar track if the user has clicked between the right arrow + // and thumb. + else if (rightBarClicked) + { + clickedBarRectangle.X = + thumbRectangle.X + thumbRectangle.Width; + clickedBarRectangle.Width = + thumbRightLimitRight - clickedBarRectangle.X; + ScrollBarRenderer.DrawRightHorizontalTrack(e.Graphics, + clickedBarRectangle, ScrollBarState.Pressed); + } + } + + // Handle a mouse click in the scroll bar. + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + + if (!ScrollBarRenderer.IsSupported) + return; + + // When the thumb is clicked, update the distance from the left + // edge of the thumb to the cursor tip. + if (thumbRectangle.Contains(e.Location)) + { + thumbClicked = true; + thumbPosition = e.Location.X - thumbRectangle.X; + thumbState = ScrollBarState.Pressed; + } + + // When the left arrow is clicked, start the timer to scroll + // while the arrow is held down. + else if (leftArrowRectangle.Contains(e.Location)) + { + leftArrowClicked = true; + leftButtonState = ScrollBarArrowButtonState.LeftPressed; + progressTimer.Start(); + } + + // When the right arrow is clicked, start the timer to scroll + // while the arrow is held down. + else if (rightArrowRectangle.Contains(e.Location)) + { + rightArrowClicked = true; + rightButtonState = ScrollBarArrowButtonState.RightPressed; + progressTimer.Start(); + } + + // When the scroll bar is clicked, start the timer to move the + // thumb while the mouse is held down. + else + { + trackPosition = e.Location.X; + + if (e.Location.X < this.thumbRectangle.X) + { + leftBarClicked = true; + } + else + { + rightBarClicked = true; + } + progressTimer.Start(); + } + + Invalidate(); + } + + // Draw the track. + protected override void OnMouseUp(MouseEventArgs e) + { + base.OnMouseUp(e); + + if (!ScrollBarRenderer.IsSupported) + return; + + // Update the thumb position, if the new location is within + // the bounds. + if (thumbClicked) + { + thumbClicked = false; + thumbState = ScrollBarState.Normal; + + if (e.Location.X > (thumbLeftLimit + thumbPosition) && + e.Location.X < (thumbRightLimitLeft + thumbPosition)) + { + thumbRectangle.X = e.Location.X - thumbPosition; + thumbClicked = false; + } + } + + // If one of the four thumb movement areas was clicked, + // stop the timer. + else if (leftArrowClicked) + { + leftArrowClicked = false; + leftButtonState = ScrollBarArrowButtonState.LeftNormal; + progressTimer.Stop(); + } + + else if (rightArrowClicked) + { + rightArrowClicked = false; + rightButtonState = ScrollBarArrowButtonState.RightNormal; + progressTimer.Stop(); + } + + else if (leftBarClicked) + { + leftBarClicked = false; + progressTimer.Stop(); + } + + else if (rightBarClicked) + { + rightBarClicked = false; + progressTimer.Stop(); + } + + Invalidate(); + } + + // Track mouse movements if the user clicks on the scroll bar thumb. + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + + if (!ScrollBarRenderer.IsSupported) + return; + + // Update the thumb position, if the new location is + // within the bounds. + if (thumbClicked) + { + // The thumb is all the way to the left. + if (e.Location.X <= (thumbLeftLimit + thumbPosition)) + { + thumbRectangle.X = thumbLeftLimit; + } + + // The thumb is all the way to the right. + else if (e.Location.X >= (thumbRightLimitLeft + thumbPosition)) + { + thumbRectangle.X = thumbRightLimitLeft; + } + + // The thumb is between the ends of the track. + else + { + thumbRectangle.X = e.Location.X - thumbPosition; + } + + Invalidate(); + } + } + + // Recalculate the sizes of the scroll bar elements. + protected override void OnSizeChanged(EventArgs e) + { + base.OnSizeChanged(e); + SetUpScrollBar(); + } + + // Handle the timer tick by updating the thumb position. + private void progressTimer_Tick(object sender, EventArgs myEventArgs) + { + if (!ScrollBarRenderer.IsSupported) + return; + + // If an arrow is clicked, move the thumb in small increments. + if (rightArrowClicked && thumbRectangle.X < thumbRightLimitLeft) + { + thumbRectangle.X++; + } + else if (leftArrowClicked && thumbRectangle.X > thumbLeftLimit) + { + thumbRectangle.X--; + } + + // If the track bar to right of the thumb is clicked, move the + // thumb to the right in larger increments until the right edge + // of the thumb hits the cursor. + else if (rightBarClicked && + thumbRectangle.X < thumbRightLimitLeft && + thumbRectangle.X + thumbRectangle.Width < trackPosition) + { + thumbRectangle.X += 3; + } + + // If the track bar to left of the thumb is clicked, move the + // thumb to the left in larger increments until the left edge + // of the thumb hits the cursor. + else if (leftBarClicked && + thumbRectangle.X > thumbLeftLimit && + thumbRectangle.X > trackPosition) + { + thumbRectangle.X -= 3; + } + + Invalidate(); + } + } +} diff --git a/DarkControls/Controls/CustomStatusStrip.cs b/DarkControls/Controls/CustomStatusStrip.cs new file mode 100644 index 0000000..fd055dc --- /dev/null +++ b/DarkControls/Controls/CustomStatusStrip.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace DarkControls.Controls +{ + public class CustomStatusStrip : StatusStrip + { + protected override void OnPaint(PaintEventArgs e) + { + // Set the background color to RGB value 33, 33, 33 + this.BackColor = Color.FromArgb(33, 33, 33); + + // Set the foreground color to Silver + this.ForeColor = Color.Silver; + + e.Graphics.Clear(this.BackColor); + + // Call the base OnPaint method to handle the actual rendering + base.OnPaint(e); + } + + //protected override void OnRender (ToolStripRenderEventArgs e) + //{ + // // Set the background color to RGB value 33, 33, 33 + // e.Graphics.Clear(Color.FromArgb(33, 33, 33)); + // base.OnRenderToolStripBackground(e); + //} + + //protected override void OnRenderToolStripContentPanelBackground(ToolStripContentPanelRenderEventArgs e) + //{ + // e.Graphics.Clear(Color.FromArgb(33, 33, 33)); + // base.OnRenderToolStripContentPanelBackground(e); + //} + + //protected override void OnRenderItem(ToolStripItemRenderEventArgs e) + //{ + // // Set the background color to RGB value 33, 33, 33 + // e.Item.BackColor = Color.FromArgb(33, 33, 33); + + // // Set the foreground color to Silver + // e.Item.ForeColor = Color.Silver; + + // // Call the base OnRenderItem method to handle the actual rendering + // base.OnRenderItem(e); + //} + } +} diff --git a/DarkControls/Controls/DarkButton.cs b/DarkControls/Controls/DarkButton.cs new file mode 100644 index 0000000..4a1106c --- /dev/null +++ b/DarkControls/Controls/DarkButton.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Drawing; + +namespace DarkControls.Controls +{ + public class DarkButton : Button + { + public DarkButton() + { + this.BackColor = Color.FromArgb(33, 33, 33); + this.ForeColor = Color.Silver; + + this.Size = new Size(75, 23); + this.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.UseVisualStyleBackColor = true; + } + } +} diff --git a/DarkControls/Controls/DarkCheckBox.cs b/DarkControls/Controls/DarkCheckBox.cs new file mode 100644 index 0000000..ede9618 --- /dev/null +++ b/DarkControls/Controls/DarkCheckBox.cs @@ -0,0 +1,274 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Runtime.InteropServices; +using SystemMath = System.Math; + +namespace DarkControls.Controls +{ + public class DarkCheckBox : CheckBox + { + [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")] + private static extern IntPtr CreateRoundRectRgn +( +int nLeftRect, // x-coordinate of upper-left corner +int nTopRect, // y-coordinate of upper-left corner +int nRightRect, // x-coordinate of lower-right corner +int nBottomRect, // y-coordinate of lower-right corner +int nWidthEllipse, // width of ellipse +int nHeightEllipse // height of ellipse +); + + public Color CheckColor { get; set; } = Color.CornflowerBlue; + public Color BoxFillColor { get; set; } = Color.FromArgb(33, 33, 33); + public Color BoxBorderColor { get; set; } = Color.DarkSlateBlue; + public DarkCheckBox() + { + Appearance = System.Windows.Forms.Appearance.Button; + FlatStyle = System.Windows.Forms.FlatStyle.Flat; + TextAlign = ContentAlignment.MiddleRight; + FlatAppearance.BorderSize = 0; + AutoSize = false; + Height = 16; + } + + public static GraphicsPath RoundedRect(Rectangle bounds, int radius) + { + int diameter = radius * 2; + Size size = new Size(diameter, diameter); + Rectangle arc = new Rectangle(bounds.Location, size); + GraphicsPath path = new GraphicsPath(); + + if (radius == 0) + { + path.AddRectangle(bounds); + return path; + } + + // top left arc + path.AddArc(arc, 180, 90); + + // top right arc + arc.X = bounds.Right - diameter; + path.AddArc(arc, 270, 90); + + // bottom right arc + arc.Y = bounds.Bottom - diameter; + path.AddArc(arc, 0, 90); + + // bottom left arc + arc.X = bounds.Left; + path.AddArc(arc, 90, 90); + + path.CloseFigure(); + return path; + } + + bool mouseEntered = false; + bool mouseDown = false; + + protected override void OnMouseEnter(EventArgs eventargs) + { + mouseEntered = true; + base.OnMouseEnter(eventargs); + } + + protected override void OnMouseLeave(EventArgs eventargs) + { + mouseEntered = false; + base.OnMouseLeave(eventargs); + } + + protected override void OnMouseDown(MouseEventArgs mevent) + { + if (mevent.Button == MouseButtons.Left) + { + mouseDown = true; + this.Invalidate(); + } + base.OnMouseDown(mevent); + } + + //protected override void OnMouseMove(MouseEventArgs mevent) + //{ + // if (mevent.Button == MouseButtons.Left) + // { + // mouseDown = true; + // this.Invalidate(); + // } + // base.OnMouseMove(mevent); + //} + + protected override void OnMouseUp(MouseEventArgs mevent) + { + if (mevent.Button == MouseButtons.Left) + { + mouseDown = false; + this.Invalidate(); + } + base.OnMouseUp(mevent); + } + + public static void DrawCheckBox(Graphics g, Point p, CheckState Checked) + { + Color BoxFillColor = Color.FromArgb(33, 33, 33); + //using (SolidBrush brush = new SolidBrush(BoxFillColor)) + // g.DrawString(Text, Font, brush, 26, 6); + + Point pt = new Point(4, 4); + Rectangle rect = new Rectangle(p, new Size(12, 12)); + + //if (mouseEntered) + //{ + // if (mouseDown) + // { + // Color col = Color.FromArgb(BoxFillColor.R - 4, BoxFillColor.G - 4, BoxFillColor.B - 4); + // using (GraphicsPath path = RoundedRect(rect, 4)) + // { + // g.FillPath(new SolidBrush(col), path); + // } + // } + // else + // { + // Color col = Color.FromArgb(BoxFillColor.R + 22, BoxFillColor.G + 22, BoxFillColor.B + 22); + // using (GraphicsPath path = RoundedRect(rect, 4)) + // { + // g.FillPath(new SolidBrush(col), path); + // } + // } + //} + //else + { + using (GraphicsPath path = RoundedRect(rect, 4)) + { + g.FillPath(new SolidBrush(BoxFillColor), path); + } + } + + if (Checked == CheckState.Checked) + { + using (SolidBrush brush = new SolidBrush(Color.CornflowerBlue)) + using (Font wing = new Font("Wingdings", 12f)) + g.DrawString("ü", wing, brush, p.X - 2f, p.Y - 2f); + } + else if (Checked == CheckState.Indeterminate) + { + using (GraphicsPath path = RoundedRect(rect, 4)) + { + g.FillPath(new SolidBrush(Color.CornflowerBlue), path); + } + } + + using (GraphicsPath path = RoundedRect(rect, 4)) + { + g.DrawPath(new Pen(Color.Silver), path); + } + } + + protected override void OnPaint(PaintEventArgs pevent) + { + //base.OnPaint(pevent); + + pevent.Graphics.Clear(BackColor); + + if (this.Enabled) + { + using (SolidBrush brush = new SolidBrush(ForeColor)) + pevent.Graphics.DrawString(Text, Font, brush, 26, 6); + + Point pt = new Point(4, 4); + Rectangle rect = new Rectangle(pt, new Size(16, 16)); + + if (mouseEntered) + { + if (mouseDown) + { + Color col = Color.FromArgb(BoxFillColor.R - 4, BoxFillColor.G - 4, BoxFillColor.B - 4); + using (GraphicsPath path = RoundedRect(rect, 4)) + { + pevent.Graphics.FillPath(new SolidBrush(col), path); + } + } + else + { + Color col = Color.FromArgb(BoxFillColor.R + 22, BoxFillColor.G + 22, BoxFillColor.B + 22); + using (GraphicsPath path = RoundedRect(rect, 4)) + { + pevent.Graphics.FillPath(new SolidBrush(col), path); + } + } + } + else + { + using (GraphicsPath path = RoundedRect(rect, 4)) + { + pevent.Graphics.FillPath(new SolidBrush(BoxFillColor), path); + } + } + + if (Checked) + { + using (SolidBrush brush = new SolidBrush(CheckColor)) + using (Font wing = new Font("Wingdings", 12f)) + pevent.Graphics.DrawString("ü", wing, brush, 3, 5); + } + + using (GraphicsPath path = RoundedRect(rect, 4)) + { + pevent.Graphics.DrawPath(new Pen(BoxBorderColor), path); + } + } + else + { + double brightnessDim = 0.4; + double[] hsbForeColor = SimpleColorTransforms.RgBtoHsb(ForeColor); + double[] hsBoxFillColor = SimpleColorTransforms.RgBtoHsb(BoxFillColor); + double[] hsBoxBorderColor = SimpleColorTransforms.RgBtoHsb(BoxBorderColor); + double[] hsCheckColor = SimpleColorTransforms.RgBtoHsb(CheckColor); + + hsbForeColor[1] = 0.0; + hsbForeColor[2] -= brightnessDim; + + hsBoxFillColor[1] = 0.0; + //hsBoxFillColor[2] -= brightnessDim; + + hsBoxBorderColor[1] = 0.0; + hsBoxBorderColor[2] -= brightnessDim; + + hsCheckColor[1] = 0.0; + hsCheckColor[2] -= brightnessDim; + + Color foreColor = SimpleColorTransforms.HsBtoRgb(hsbForeColor[0], hsbForeColor[1], hsbForeColor[2]); + Color boxFillColor = SimpleColorTransforms.HsBtoRgb(hsBoxFillColor[0], hsBoxFillColor[1], hsBoxFillColor[2]); + Color boxBorderColor = SimpleColorTransforms.HsBtoRgb(hsBoxBorderColor[0], hsBoxBorderColor[1], hsBoxBorderColor[2]); + Color checkColor = SimpleColorTransforms.HsBtoRgb(hsCheckColor[0], hsCheckColor[1], hsCheckColor[2]); + + + using (SolidBrush brush = new SolidBrush(foreColor)) + pevent.Graphics.DrawString(Text, Font, brush, 26, 6); + + Point pt = new Point(4, 4); + Rectangle rect = new Rectangle(pt, new Size(16, 16)); + + pevent.Graphics.FillRectangle(new SolidBrush(boxFillColor), rect); + + if (Checked) + { + using (SolidBrush brush = new SolidBrush(checkColor)) + using (Font wing = new Font("Wingdings", 12f)) + pevent.Graphics.DrawString("ü", wing, brush, 3, 5); + } + + using (GraphicsPath path = RoundedRect(rect, 4)) + { + pevent.Graphics.DrawPath(new Pen(boxBorderColor), path); + } + } + } + } +} diff --git a/DarkControls/Controls/DarkSelectFileButton.cs b/DarkControls/Controls/DarkSelectFileButton.cs new file mode 100644 index 0000000..09f7081 --- /dev/null +++ b/DarkControls/Controls/DarkSelectFileButton.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Drawing; + +namespace DarkControls.Controls +{ + public class DarkSelectFileButton : Button + { + public DarkSelectFileButton() + { + this.BackColor = Color.FromArgb(33, 33, 33); + this.ForeColor = Color.Silver; + this.FlatAppearance.BorderColor = System.Drawing.Color.Silver; + this.FlatAppearance.BorderSize = 0; + this.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Silver; + this.Image = Properties.Resources.selectFileBtn_Image; + this.Size = new Size(75, 23); + this.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.UseVisualStyleBackColor = true; + } + } +} diff --git a/DarkControls/Controls/DarkTextBox.cs b/DarkControls/Controls/DarkTextBox.cs new file mode 100644 index 0000000..5530637 --- /dev/null +++ b/DarkControls/Controls/DarkTextBox.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Drawing; +using System.Windows.Forms.VisualStyles; +using System.Diagnostics; + +namespace DarkControls.Controls +{ + public class DarkTextBox : System.Windows.Forms.TextBox + { + public DarkTextBox() + { + // Initialize the renderer + + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(33)))), ((int)(((byte)(33))))); + this.ForeColor = Color.Silver; + + this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + } + + protected override void OnPaint(PaintEventArgs e) + { + //Debugger.Break(); + if (ScrollBarRenderer.IsSupported) + { + Debugger.Break(); + // Draw the custom scrollbar + ScrollBarRenderer.DrawUpperVerticalTrack(e.Graphics, new Rectangle(this.Right - 18, this.Top, 18, this.Height), ScrollBarState.Normal); + ScrollBarRenderer.DrawLowerVerticalTrack(e.Graphics, new Rectangle(this.Right - 18, this.Top, 18, this.Height), ScrollBarState.Normal); + ScrollBarRenderer.DrawVerticalThumb(e.Graphics, new Rectangle(this.Right - 18, this.Top, 18, this.Height), ScrollBarState.Normal); + ScrollBarRenderer.DrawVerticalThumbGrip(e.Graphics, new Rectangle(this.Right - 18, this.Top, 18, this.Height), ScrollBarState.Normal); + } + + base.OnPaint(e); + } + + //protected override void WndProc(ref Message m) + //{ + // base.WndProc(ref m); + // if (m.Msg == 0x00F7) + // { + // m.Result = (IntPtr)1; + // } + //} + } +} diff --git a/DarkControls/Controls/FlatScrollBar.cs b/DarkControls/Controls/FlatScrollBar.cs new file mode 100644 index 0000000..a3fb39f --- /dev/null +++ b/DarkControls/Controls/FlatScrollBar.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DarkControls.Controls +{ + internal class FlatScrollBar + { + } +} diff --git a/DarkControls/Controls/FlatScrollBar1.cs b/DarkControls/Controls/FlatScrollBar1.cs new file mode 100644 index 0000000..12751ae --- /dev/null +++ b/DarkControls/Controls/FlatScrollBar1.cs @@ -0,0 +1,1384 @@ +//using System; +//// Copyright (c) Smart PC Utilities, Ltd. +//// All rights reserved. + +//#region References +//using System.Windows.Forms; + +//using System.ComponentModel; +//using System.Linq; + +//#endregion + +//namespace DarkControls.Controls +//{ + +// [Designer(typeof(FlatScrollBarDesigner))] +// [ToolboxBitmap(typeof(ScrollBar))] +// [DefaultEvent("Scroll")] +// [DefaultProperty("Value")] +// public partial class FlatScrollBar : Control, ITheme +// { + +// #region Private Members + +// private const int SETREDRAW = 11; // Redraw constant + +// private bool _isUpdating; // Indicates many changes to the scrollbar are happening, so stop painting till finished. + +// private ScrollBarOrientation _orientation = ScrollBarOrientation.Vertical; // The scrollbar orientation - horizontal / vertical. +// private ScrollOrientation _scrollOrientation = ScrollOrientation.VerticalScroll; // The scroll orientation in scroll events. + +// private Rectangle _rectClickedBar; // The clicked channel rectangle. +// private Rectangle _rectThumb; +// private Rectangle _rectTopArrow; +// private Rectangle _rectBottomArrow; +// private Rectangle _rectChannel; + +// private bool _topArrowClicked; // Indicates if top arrow was clicked. +// private bool _bottomArrowClicked; // Indicates if down arrow was clicked. +// private bool _topBarClicked; // Indicates if channel rectangle above the thumb was clicked. +// private bool _bottomBarClicked; // Indicates if channel rectangle under the thumb was clicked. +// private bool _thumbClicked; // Indicates if the thumb was clicked. + +// private ScrollBarState _thumbState = ScrollBarState.Normal; // The state of the thumb. + +// private ScrollBarArrowButtonState _topButtonState = ScrollBarArrowButtonState.UpNormal; // The state of the top arrow. +// private ScrollBarArrowButtonState _bottomButtonState = ScrollBarArrowButtonState.DownNormal; // The state of the bottom arrow. + +// private int _minimum; +// private int _maximum = 100; +// private int _smallChange = 1; +// private int _largeChange = 10; +// private int _value; + +// private int _thumbWidth = 15; +// private int _thumbHeight; + +// private int _arrowWidth = 15; +// private int _arrowHeight = 17; + +// private int _thumbBottomLimitBottom; // The bottom limit for the thumb bottom. +// private int _thumbBottomLimitTop; // The bottom limit for the thumb top. +// private int _thumbTopLimit; // The top limit for the thumb top. +// private int _thumbPosition; // The current position of the thumb. + +// private int _trackPosition; // The track position. + +// private readonly Timer progressTimer = new DateAndTime.Timer(); // The progress timer for moving the thumb. + +// private UITheme _theme = UITheme.VS2019LightBlue; + +// private Color _backColor = Color.FromArgb(245, 245, 245); + +// private Color _borderColor = Color.FromArgb(245, 245, 245); +// private Color _borderColorDisabled = Color.FromArgb(245, 245, 245); + +// private readonly Color[] _thumbColors = new Color[4]; +// private readonly Color[] _arrowColors = new Color[4]; + +// #endregion + +// #region Constructor + +// public FlatScrollBar() +// { + +// SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.Selectable | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true); + +// SetUpScrollBar(); // Setup the ScrollBar + +// progressTimer.Interval = 20; +// this.progressTimer.Tick += ProgressTimerTick; + +// _thumbColors[0] = Color.FromArgb(194, 195, 201); // Normal state +// _thumbColors[1] = Color.FromArgb(104, 104, 104); // Hover state +// _thumbColors[2] = Color.FromArgb(91, 91, 91); // Pressed state + +// _arrowColors[0] = Color.FromArgb(134, 137, 153); // Normal state +// _arrowColors[1] = Color.FromArgb(28, 151, 234); // Hover state +// _arrowColors[2] = Color.FromArgb(0, 122, 204); // Pressed state + +// } + +// #endregion + +// #region Events + +// /// +// /// Raised when the ScrollBar control is scrolled. +// /// +// [Category("Behavior")] +// [Description("Raised when the ScrollBar control is scrolled.")] +// public event ScrollEventHandler Scroll; + +// #endregion + +// #region Public Properties + +// [Category("Layout")] +// [Description("Gets or sets the ScrollBar orientation.")] +// [DefaultValue(ScrollBarOrientation.Vertical)] +// public ScrollBarOrientation Orientation +// { +// get +// { +// return _orientation; +// } +// set +// { + +// if (value != _orientation) +// { + +// _orientation = value; +// _scrollOrientation = value == ScrollBarOrientation.Vertical ? ScrollOrientation.VerticalScroll : ScrollOrientation.HorizontalScroll; + +// if (DesignMode) // only in DesignMode switch width and height +// { +// Size = new Size(Height, Width); +// } + +// SetUpScrollBar(); + +// } + +// } +// } + +// [Category("Behavior")] +// [Description("Gets or sets the ScrollBar minimum value.")] +// [DefaultValue(0)] +// public int Minimum +// { +// get +// { +// return _minimum; +// } +// set +// { + +// if (_minimum == value || value < 0 || value >= _maximum) +// { +// return; +// } + +// _minimum = value; + +// // Current value less than new minimum value - adjust +// if (_value < value) +// { +// _value = value; +// } + +// // Current large change value invalid - adjust +// if (_largeChange > _maximum - _minimum) +// { +// _largeChange = _maximum - _minimum; +// } + +// SetUpScrollBar(); + +// if (_value < value) // Current value less than new minimum value - adjust +// { +// Value = value; +// } +// else +// { +// ChangeThumbPosition(GetThumbPosition()); // Current value is valid - adjust thumb position +// Refresh(); +// } + +// } +// } + +// [Category("Behavior")] +// [Description("Gets or sets the ScrollBar maximum value.")] +// [DefaultValue(100)] +// public int Maximum +// { +// get +// { +// return _maximum; +// } +// set +// { + +// if (value == _maximum || value < 1 || value <= _minimum) +// { +// return; +// } + +// _maximum = value; + +// if (_largeChange > _maximum - _minimum) +// { +// _largeChange = _maximum - _minimum; +// } + +// SetUpScrollBar(); + +// if (_value > _maximum) +// { +// Value = _maximum; +// } +// else +// { +// ChangeThumbPosition(GetThumbPosition()); +// Refresh(); +// } + +// } +// } + +// [Category("Behavior")] +// [Description("Gets or sets the ScrollBar small change value.")] +// [DefaultValue(1)] +// public int SmallChange +// { +// get +// { +// return _smallChange; +// } +// set +// { + +// if (value == _smallChange || value < 1 || value >= _largeChange) +// { +// return; +// } + +// _smallChange = value; +// SetUpScrollBar(); + +// } +// } + +// [Category("Behavior")] +// [Description("Gets or sets the ScrollBar large change value.")] +// [DefaultValue(10)] +// public int LargeChange +// { +// get +// { +// return _largeChange; +// } +// set +// { + +// if (value == _largeChange || value < _smallChange || value < 2) +// { +// return; +// } + +// if (value > _maximum - _minimum) +// { +// _largeChange = _maximum - _minimum; +// } +// else +// { +// _largeChange = value; +// } + +// SetUpScrollBar(); + +// } +// } + +// [Category("Behavior")] +// [Description("Gets or sets the ScrollBar current value.")] +// [DefaultValue(0)] +// public int Value +// { +// get +// { +// return _value; +// } +// set +// { + +// if (_value == value || value < _minimum || value > _maximum) +// { +// return; +// } + +// _value = value; +// ChangeThumbPosition(GetThumbPosition()); +// OnScroll(new ScrollEventArgs(ScrollEventType.ThumbPosition, -1, _value, _scrollOrientation)); +// Refresh(); + +// } +// } + +// [Category("Appearance")] +// [Description("The theme to apply to the Flat ScrollBar control.")] +// [DefaultValue(typeof(UITheme), "1")] +// public UITheme Theme +// { +// get +// { +// return _theme; +// } +// set +// { +// _theme = value; + +// if (_theme == UITheme.VS2019DarkBlue) +// { + +// _backColor = Color.FromArgb(62, 62, 66); + +// _borderColor = Color.FromArgb(62, 62, 66); +// _borderColorDisabled = Color.FromArgb(62, 62, 66); + +// _thumbColors[0] = Color.FromArgb(104, 104, 104); +// _thumbColors[1] = Color.FromArgb(158, 158, 158); +// _thumbColors[2] = Color.FromArgb(239, 235, 239); + +// _arrowColors[0] = Color.FromArgb(153, 153, 153); +// _arrowColors[1] = Color.FromArgb(28, 151, 234); +// _arrowColors[2] = Color.FromArgb(0, 122, 204); +// } + +// else if (_theme == UITheme.VS2019LightBlue) +// { + +// _backColor = Color.FromArgb(245, 245, 245); + +// _borderColor = Color.FromArgb(245, 245, 245); +// _borderColorDisabled = Color.FromArgb(245, 245, 245); + +// _thumbColors[0] = Color.FromArgb(194, 195, 201); // Normal state +// _thumbColors[1] = Color.FromArgb(104, 104, 104); // Hover state +// _thumbColors[2] = Color.FromArgb(91, 91, 91); // Pressed state + +// _arrowColors[0] = Color.FromArgb(134, 137, 153); // Normal state +// _arrowColors[1] = Color.FromArgb(28, 151, 234); // Hover state +// _arrowColors[2] = Color.FromArgb(0, 122, 204); // Pressed state +// } + +// else if (_theme == UITheme.Custom) +// { +// ParentTheme = false; + +// } + +// Invalidate(); +// } +// } + +// [Category("Appearance")] +// [Description("True to allow the control to inherit the parent control style.")] +// [DefaultValue(true)] +// public bool ParentTheme { get; set; } = true; + +// #endregion + +// #region Public Methods + +// public void BeginUpdate() +// { +// NativeMethods.SendMessage(Handle, SETREDRAW, false, 0); +// _isUpdating = true; +// } + +// public void EndUpdate() +// { +// NativeMethods.SendMessage(Handle, SETREDRAW, true, 0); +// _isUpdating = false; +// SetUpScrollBar(); +// Refresh(); +// } + +// #endregion + +// #region Overridden Methods + +// protected virtual void OnScroll(ScrollEventArgs e) +// { +// ; +//#error Cannot convert RaiseEventStatementSyntax - see comment for details +// /* Cannot convert ArgumentListSyntax, System.NullReferenceException: Object reference not set to an instance of an object. +// at ICSharpCode.CodeConverter.Util.SymbolExtensions.GetParameters(ISymbol symbol) in D:\GitWorkspace\CodeConverter\CodeConverter\Util\SymbolExtensions.cs:line 18 +// at ICSharpCode.CodeConverter.CSharp.ExpressionNodeVisitor.<>c__DisplayClass127_0.<g__ConvertArg|0>d.MoveNext() in D:\GitWorkspace\CodeConverter\CodeConverter\CSharp\ExpressionNodeVisitor.cs:line 1585 +// --- End of stack trace from previous location --- +// at ICSharpCode.CodeConverter.Common.AsyncEnumerableTaskExtensions.SelectAsync[TArg,TResult](IEnumerable`1 source, Func`2 selector) in D:\GitWorkspace\CodeConverter\CodeConverter\Common\AsyncEnumerableTaskExtensions.cs:line 0 +// at ICSharpCode.CodeConverter.Common.AsyncEnumerableTaskExtensions.SelectAsync[TArg,TResult](IEnumerable`1 nodes, Func`3 selector) in D:\GitWorkspace\CodeConverter\CodeConverter\Common\AsyncEnumerableTaskExtensions.cs:line 0 +// at ICSharpCode.CodeConverter.CSharp.ExpressionNodeVisitor.ConvertArgumentsAsync(ArgumentListSyntax node) in D:\GitWorkspace\CodeConverter\CodeConverter\CSharp\ExpressionNodeVisitor.cs:line 1579 +// at ICSharpCode.CodeConverter.CSharp.ExpressionNodeVisitor.VisitArgumentList(ArgumentListSyntax node) in D:\GitWorkspace\CodeConverter\CodeConverter\CSharp\ExpressionNodeVisitor.cs:line 489 +// at ICSharpCode.CodeConverter.CSharp.CommentConvertingVisitorWrapper.ConvertHandledAsync[T](VisualBasicSyntaxNode vbNode, SourceTriviaMapKind sourceTriviaMap) in D:\GitWorkspace\CodeConverter\CodeConverter\CSharp\CommentConvertingVisitorWrapper.cs:line 36 + +// Input: (Me, e) + +// Context: +// RaiseEvent Scroll(Me, e) + +// */ +// } + +// protected override void OnPaint(PaintEventArgs e) +// { + +// var g = e.Graphics; +// g.SmoothingMode = SmoothingMode.None; + +// DrawBackground(g, ClientRectangle); +// DrawThumb(g, _rectThumb, _thumbState); +// DrawArrowButton(g, _rectTopArrow, _topButtonState, true, _orientation); +// DrawArrowButton(g, _rectBottomArrow, _bottomButtonState, false, _orientation); + +// if (_topBarClicked) +// { + +// if (_orientation == ScrollBarOrientation.Vertical) +// { +// _rectClickedBar.Y = _thumbTopLimit; +// _rectClickedBar.Height = _rectThumb.Y - _thumbTopLimit; +// } +// else +// { +// _rectClickedBar.X = _thumbTopLimit; +// _rectClickedBar.Width = _rectThumb.X - _thumbTopLimit; +// } +// } + +// else if (_bottomBarClicked) +// { + +// if (_orientation == ScrollBarOrientation.Vertical) +// { +// _rectClickedBar.Y = _rectThumb.Bottom + 1; +// _rectClickedBar.Height = _thumbBottomLimitBottom - _rectClickedBar.Y + 1; +// } +// else +// { +// _rectClickedBar.X = _rectThumb.Right + 1; +// _rectClickedBar.Width = _thumbBottomLimitBottom - _rectClickedBar.X + 1; +// } + +// } + +// using (var p = new Pen(Enabled ? _borderColor : _borderColorDisabled)) +// { +// e.Graphics.DrawRectangle(p, 0, 0, Width - 1, Height - 1); +// } + +// } + +// protected override void OnMouseDown(MouseEventArgs e) +// { +// base.OnMouseDown(e); +// Focus(); + +// if (e.Button == MouseButtons.Left) +// { + +// Point mouseLocation = e.Location; + +// if (_rectThumb.Contains(mouseLocation)) +// { + +// _thumbClicked = true; +// _thumbPosition = Conversions.ToInteger(_orientation == ScrollBarOrientation.Vertical ? mouseLocation.Y - _rectThumb.Y : mouseLocation.X - _rectThumb.X); +// _thumbState = ScrollBarState.Pressed; +// Invalidate(_rectThumb); +// } + +// else if (_rectTopArrow.Contains(mouseLocation)) +// { + +// _topArrowClicked = true; +// _topButtonState = ScrollBarArrowButtonState.UpPressed; +// Invalidate(_rectTopArrow); +// ProgressThumb(true); +// } + +// else if (_rectBottomArrow.Contains(mouseLocation)) +// { + +// _bottomArrowClicked = true; +// _bottomButtonState = ScrollBarArrowButtonState.DownPressed; +// Invalidate(_rectBottomArrow); +// ProgressThumb(true); +// } + +// else +// { +// _trackPosition = Conversions.ToInteger(_orientation == ScrollBarOrientation.Vertical ? mouseLocation.Y : mouseLocation.X); + +// if (Conversions.ToBoolean(Operators.ConditionalCompareObjectLess(_trackPosition, _orientation == ScrollBarOrientation.Vertical ? _rectThumb.Y : _rectThumb.X, false))) +// { +// _topBarClicked = true; +// } +// else +// { +// _bottomBarClicked = true; +// } + +// ProgressThumb(true); + +// } +// } + +// else if (e.Button == MouseButtons.Right) +// { +// _trackPosition = Conversions.ToInteger(_orientation == ScrollBarOrientation.Vertical ? e.Y : e.X); +// } + +// } + +// protected override void OnMouseUp(MouseEventArgs e) +// { +// base.OnMouseUp(e); + +// if (e.Button == MouseButtons.Left) +// { + +// if (_thumbClicked) +// { +// _thumbClicked = false; +// _thumbState = ScrollBarState.Normal; +// OnScroll(new ScrollEventArgs(ScrollEventType.EndScroll, -1, _value, _scrollOrientation)); +// } + +// else if (_topArrowClicked) +// { +// _topArrowClicked = false; +// _topButtonState = ScrollBarArrowButtonState.UpNormal; +// StopTimer(); +// } + +// else if (_bottomArrowClicked) +// { +// _bottomArrowClicked = false; +// _bottomButtonState = ScrollBarArrowButtonState.DownNormal; +// StopTimer(); +// } + +// else if (_topBarClicked) +// { +// _topBarClicked = false; +// StopTimer(); +// } + +// else if (_bottomBarClicked) +// { +// _bottomBarClicked = false; +// StopTimer(); + +// } + +// Invalidate(); + +// } + +// } + +// protected override void OnMouseLeave(EventArgs e) +// { +// base.OnMouseLeave(e); +// ResetScrollStatus(); +// } + +// protected override void OnMouseMove(MouseEventArgs e) +// { +// base.OnMouseMove(e); + +// if (e.Button == MouseButtons.Left) // Moving and holding the left mouse button +// { + +// if (_thumbClicked) +// { + +// int oldScrollValue = _value; + +// int pos = Conversions.ToInteger(_orientation == ScrollBarOrientation.Vertical ? e.Location.Y : e.Location.X); + +// if (pos <= _thumbTopLimit + _thumbPosition) // The thumb is all the way to the top +// { +// ChangeThumbPosition(_thumbTopLimit); +// _value = _minimum; +// } + +// else if (pos >= _thumbBottomLimitTop + _thumbPosition) // The thumb is all the way to the bottom +// { +// ChangeThumbPosition(_thumbBottomLimitTop); +// _value = _maximum; +// } + +// else // The thumb is between the ends of the track. +// { + +// ChangeThumbPosition(pos - _thumbPosition); + +// int pixelRange, thumbPos, arrowSize; + +// // Calculate the value - first some helper variables dependent on the current orientation + +// if (_orientation == ScrollBarOrientation.Vertical) +// { +// pixelRange = Height - 2 * _arrowHeight - _thumbHeight; +// thumbPos = _rectThumb.Y; +// arrowSize = _arrowHeight; +// } +// else +// { +// pixelRange = Width - 2 * _arrowWidth - _thumbWidth; +// thumbPos = _rectThumb.X; +// arrowSize = _arrowWidth; +// } + +// float perc = 0f; + +// if (pixelRange != 0) +// { +// perc = (thumbPos - arrowSize) / (float)pixelRange; +// } + +// _value = Convert.ToInt32(perc * (_maximum - _minimum) + _minimum); + +// } + +// if (oldScrollValue != _value) +// { +// OnScroll(new ScrollEventArgs(ScrollEventType.ThumbTrack, oldScrollValue, _value, _scrollOrientation)); +// Refresh(); +// } + +// } +// } + +// else if (!ClientRectangle.Contains(e.Location)) +// { +// ResetScrollStatus(); +// } + +// else if (e.Button == MouseButtons.None) // Only moving the mouse +// { + +// if (_rectTopArrow.Contains(e.Location)) +// { +// _topButtonState = ScrollBarArrowButtonState.UpHot; +// Invalidate(_rectTopArrow); +// } + +// else if (_rectBottomArrow.Contains(e.Location)) +// { +// _bottomButtonState = ScrollBarArrowButtonState.DownHot; +// Invalidate(_rectBottomArrow); +// } + +// else if (_rectThumb.Contains(e.Location)) +// { +// _thumbState = ScrollBarState.Hot; +// Invalidate(_rectThumb); + +// } + +// } + +// } + +// protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified) +// { + +// if (DesignMode) +// { + +// if (_orientation == ScrollBarOrientation.Vertical) +// { + +// if (height < 2 * _arrowHeight + 10) +// height = 2 * _arrowHeight + 10; +// width = SystemInformation.VerticalScrollBarWidth; +// } + +// else +// { + +// if (width < 2 * _arrowWidth + 10) +// width = 2 * _arrowWidth + 10; +// height = SystemInformation.VerticalScrollBarWidth; + +// } + +// } + +// base.SetBoundsCore(x, y, width, height, specified); + +// if (DesignMode) +// SetUpScrollBar(); + +// } + +// protected override void OnSizeChanged(EventArgs e) +// { +// base.OnSizeChanged(e); +// SetUpScrollBar(); +// } + +// protected override bool ProcessDialogKey(Keys keyData) +// { + +// Keys keyUp = Keys.Up; +// Keys keyDown = Keys.Down; + +// if (_orientation == ScrollBarOrientation.Horizontal) +// { +// keyUp = Keys.Left; +// keyDown = Keys.Right; +// } + +// if (keyData == keyUp) +// { +// Value -= _smallChange; +// return true; +// } + +// if (keyData == keyDown) +// { +// Value += _smallChange; +// return true; +// } + +// if (keyData == Keys.PageUp) +// { +// Value = GetValue(false, true); +// return true; +// } + +// if (keyData == Keys.PageDown) +// { + +// if (Value + _largeChange > _maximum) +// { +// Value = _maximum; +// } +// else +// { +// Value += _largeChange; +// } + +// return true; + +// } + +// if (keyData == Keys.Home) +// { +// Value = _minimum; +// return true; +// } + +// if (keyData == Keys.End) +// { +// Value = _maximum; +// return true; +// } + +// return base.ProcessDialogKey(keyData); + +// } + +// protected override void OnEnabledChanged(EventArgs e) +// { +// base.OnEnabledChanged(e); + +// if (Enabled) +// { +// _thumbState = ScrollBarState.Normal; +// _topButtonState = ScrollBarArrowButtonState.UpNormal; +// _bottomButtonState = ScrollBarArrowButtonState.DownNormal; +// } +// else +// { +// _thumbState = ScrollBarState.Disabled; +// _topButtonState = ScrollBarArrowButtonState.UpDisabled; +// _bottomButtonState = ScrollBarArrowButtonState.DownDisabled; +// } + +// Refresh(); + +// } + +// #endregion + +// #region Overriden Properties + +// protected override Size DefaultSize +// { +// get +// { +// return new Size(SystemInformation.VerticalScrollBarWidth, 200); +// } +// } + +// #endregion + +// #region Private Methods + +// private void SetUpScrollBar() +// { + +// if (_isUpdating) +// return; + +// if (_orientation == ScrollBarOrientation.Vertical) +// { +// _arrowHeight = 17; +// _arrowWidth = 15; +// _thumbWidth = 13; +// _thumbHeight = GetThumbSize(); +// _rectClickedBar = ClientRectangle; +// _rectClickedBar.Inflate(-1, -1); +// _rectClickedBar.Y += _arrowHeight; +// _rectClickedBar.Height -= _arrowHeight * 2; +// _rectChannel = _rectClickedBar; +// _rectThumb = new Rectangle(ClientRectangle.Right / 2 - (int)Math.Round(_thumbWidth / 2d), ClientRectangle.Y + _arrowHeight + 1, _thumbWidth, _thumbHeight); +// _rectTopArrow = new Rectangle(ClientRectangle.Right / 2 - (int)Math.Round(_arrowWidth / 2d) + 1, ClientRectangle.Y + 1, _arrowWidth, _arrowHeight); +// _rectBottomArrow = new Rectangle(ClientRectangle.Right / 2 - (int)Math.Round(_arrowWidth / 2d), ClientRectangle.Bottom - _arrowHeight - 1, _arrowWidth, _arrowHeight); +// _thumbPosition = _rectThumb.Height / 2; +// _thumbBottomLimitBottom = ClientRectangle.Bottom - _arrowHeight - 2; +// _thumbBottomLimitTop = _thumbBottomLimitBottom - _rectThumb.Height; +// _thumbTopLimit = ClientRectangle.Y + _arrowHeight + 2; +// } +// else +// { +// _arrowHeight = 15; +// _arrowWidth = 17; +// _thumbHeight = 13; +// _thumbWidth = GetThumbSize(); +// _rectClickedBar = ClientRectangle; +// _rectClickedBar.Inflate(-1, -1); +// _rectClickedBar.X += _arrowWidth; +// _rectClickedBar.Width -= _arrowWidth * 2; +// _rectChannel = _rectClickedBar; +// _rectThumb = new Rectangle(ClientRectangle.X + _arrowWidth + 1, ClientRectangle.Bottom / 2 - (int)Math.Round(_thumbHeight / 2d), _thumbWidth, _thumbHeight); +// _rectTopArrow = new Rectangle(ClientRectangle.X + 2, ClientRectangle.Bottom / 2 - (int)Math.Round(_arrowHeight / 2d) + 1, _arrowWidth, _arrowHeight); +// _rectBottomArrow = new Rectangle(ClientRectangle.Right - _arrowWidth - 2, ClientRectangle.Bottom / 2 - (int)Math.Round(_arrowHeight / 2d), _arrowWidth, _arrowHeight); +// _thumbPosition = _rectThumb.Width / 2; +// _thumbBottomLimitBottom = ClientRectangle.Right - _arrowWidth - 3; +// _thumbBottomLimitTop = _thumbBottomLimitBottom - _rectThumb.Width; +// _thumbTopLimit = ClientRectangle.X + _arrowWidth + 3; +// } + +// ChangeThumbPosition(GetThumbPosition()); +// Refresh(); + +// } + +// private void ResetScrollStatus() +// { + +// Point pos = PointToClient(Cursor.Position); + +// if (ClientRectangle.Contains(pos)) +// { + +// if (_rectThumb.Contains(pos)) +// { + +// _thumbState = ScrollBarState.Hot; +// _topButtonState = ScrollBarArrowButtonState.UpNormal; +// _bottomButtonState = ScrollBarArrowButtonState.DownNormal; +// } + +// else if (_rectTopArrow.Contains(pos)) +// { + +// _thumbState = ScrollBarState.Normal; +// _topButtonState = ScrollBarArrowButtonState.UpActive; +// _bottomButtonState = ScrollBarArrowButtonState.DownNormal; +// } + +// else if (_rectBottomArrow.Contains(pos)) +// { + +// _thumbState = ScrollBarState.Normal; +// _topButtonState = ScrollBarArrowButtonState.UpNormal; +// _bottomButtonState = ScrollBarArrowButtonState.DownActive; +// } + +// else +// { +// _thumbState = ScrollBarState.Normal; +// _topButtonState = ScrollBarArrowButtonState.UpNormal; +// _bottomButtonState = ScrollBarArrowButtonState.DownNormal; +// } +// } + +// else +// { +// _thumbState = ScrollBarState.Normal; +// _topButtonState = ScrollBarArrowButtonState.UpNormal; +// _bottomButtonState = ScrollBarArrowButtonState.DownNormal; +// } + +// _topArrowClicked = false; +// _bottomArrowClicked = false; +// _topBarClicked = false; +// _bottomBarClicked = false; + +// StopTimer(); +// Refresh(); + +// } + +// private int GetValue(bool smallIncrement, bool up) +// { + +// int newValue; + +// if (up) +// { + +// newValue = _value - (smallIncrement ? _smallChange : _largeChange); +// if (newValue < _minimum) +// newValue = _minimum; +// } + +// else +// { + +// newValue = _value + (smallIncrement ? _smallChange : _largeChange); +// if (newValue > _maximum) +// newValue = _maximum; + +// } + +// return newValue; + +// } + +// private int GetThumbPosition() +// { + +// int pixelRange, arrowSize; + +// if (_orientation == ScrollBarOrientation.Vertical) +// { +// pixelRange = Height; +// arrowSize = _arrowHeight; +// } +// else +// { +// pixelRange = Width; +// arrowSize = _arrowWidth; +// } + +// int realRange = _maximum - _minimum; +// float perc = 0f; + +// if (realRange != 0) +// { +// perc = (_value - (float)_minimum) / realRange; +// } + +// return Math.Max(_thumbTopLimit, Math.Min(_thumbBottomLimitTop, Convert.ToInt32(perc * pixelRange + arrowSize))); + +// } + +// private int GetThumbSize() +// { + +// int trackSize = Conversions.ToInteger(_orientation == ScrollBarOrientation.Vertical ? Height - 2 * _arrowHeight : Width - 2 * _arrowWidth); + +// if (_maximum == 0 || _largeChange == 0) +// { +// return trackSize; +// } + +// float newThumbSize = _largeChange * (float)trackSize / _maximum; + +// return Convert.ToInt32(Math.Min(trackSize, Math.Max(newThumbSize, 10.0f))); + +// } + +// private void ChangeThumbPosition(int position) +// { + +// if (_orientation == ScrollBarOrientation.Vertical) +// { +// _rectThumb.Y = position; +// } +// else +// { +// _rectThumb.X = position; +// } + +// } + +// private void ProgressThumb(bool enableTimer) +// { + +// int scrollOldValue = _value; +// ScrollEventType type = ScrollEventType.First; +// int thumbSize, thumbPos; + +// if (_orientation == ScrollBarOrientation.Vertical) +// { +// thumbPos = _rectThumb.Y; +// thumbSize = _rectThumb.Height; +// } +// else +// { +// thumbPos = _rectThumb.X; +// thumbSize = _rectThumb.Width; +// } + +// if (_bottomArrowClicked || _bottomBarClicked && thumbPos + thumbSize < _trackPosition) +// { + +// type = _bottomArrowClicked ? ScrollEventType.SmallIncrement : ScrollEventType.LargeIncrement; +// _value = GetValue(_bottomArrowClicked, false); + +// if (_value == _maximum) +// { +// ChangeThumbPosition(_thumbBottomLimitTop); +// type = ScrollEventType.Last; +// } +// else +// { +// ChangeThumbPosition(Math.Min(_thumbBottomLimitTop, GetThumbPosition())); +// } +// } + +// else if (_topArrowClicked || _topBarClicked && thumbPos > _trackPosition) +// { + +// type = _topArrowClicked ? ScrollEventType.SmallDecrement : ScrollEventType.LargeDecrement; +// _value = GetValue(_topArrowClicked, true); + +// if (_value == _minimum) +// { +// ChangeThumbPosition(_thumbTopLimit); +// type = ScrollEventType.First; +// } +// else +// { +// ChangeThumbPosition(Math.Max(_thumbTopLimit, GetThumbPosition())); +// } +// } + +// else if (!(_topArrowClicked && thumbPos == _thumbTopLimit || _bottomArrowClicked && thumbPos == _thumbBottomLimitTop)) +// { + +// ResetScrollStatus(); +// return; + +// } + +// if (scrollOldValue != _value) +// { + +// OnScroll(new ScrollEventArgs(type, scrollOldValue, _value, _scrollOrientation)); +// Invalidate(_rectChannel); + +// if (enableTimer) +// StartTimer(); +// } + +// else +// { + +// if (_topArrowClicked) +// { +// type = ScrollEventType.SmallDecrement; +// } +// else if (_bottomArrowClicked) +// { +// type = ScrollEventType.SmallIncrement; +// } + +// OnScroll(new ScrollEventArgs(type, _value)); + +// } + +// } + +// #endregion + +// #region Timer Methods + +// private void ProgressTimerTick(object sender, EventArgs e) +// { +// ProgressThumb(true); +// } + +// private void StartTimer() +// { + +// if (!progressTimer.Enabled) +// { +// progressTimer.Interval = 600; +// progressTimer.Start(); +// } +// else +// { +// progressTimer.Interval = 10; +// } + +// } + +// private void StopTimer() +// { +// progressTimer.Stop(); +// } + +// #endregion + +// #region Drawing Methods + +// private void DrawBackground(Graphics g, Rectangle rect) +// { + +// if (g is null || rect.IsEmpty || g.IsVisibleClipEmpty || !g.VisibleClipBounds.IntersectsWith(rect)) +// return; + +// using (var sb = new SolidBrush(_backColor)) +// { +// g.FillRectangle(sb, rect); +// } + +// } + +// private void DrawThumb(Graphics g, Rectangle rect, ScrollBarState state) +// { + +// if (g is null || rect.IsEmpty || g.IsVisibleClipEmpty || !g.VisibleClipBounds.IntersectsWith(rect) || state == ScrollBarState.Disabled) +// { +// return; +// } + +// int index = 0; + +// switch (state) +// { + +// case ScrollBarState.Hot: +// { +// index = 1; +// break; +// } + +// case ScrollBarState.Pressed: +// { +// index = 2; +// break; +// } + +// } + +// using (var sb = new SolidBrush(_thumbColors[index])) +// { +// g.FillRectangle(sb, rect); +// } + +// } + +// private void DrawArrowButton(Graphics g, Rectangle rect, ScrollBarArrowButtonState state, bool arrowUp, ScrollBarOrientation orientation) +// { + +// if (g is null || rect.IsEmpty || g.IsVisibleClipEmpty || !g.VisibleClipBounds.IntersectsWith(rect)) +// { +// return; +// } + +// if (orientation == ScrollBarOrientation.Vertical) +// { +// DrawArrowButtonVertical(g, rect, state, arrowUp); +// } +// else +// { +// DrawArrowButtonHorizontal(g, rect, state, arrowUp); +// } + +// } + +// private void DrawArrowButtonVertical(Graphics g, Rectangle rect, ScrollBarArrowButtonState state, bool arrowUp) +// { + +// using (var img = GetArrowDownButtonImage(state)) +// { + +// if (arrowUp) +// img.RotateFlip(RotateFlipType.Rotate180FlipNone); +// g.DrawImage(img, rect); + +// } + +// } + +// private void DrawArrowButtonHorizontal(Graphics g, Rectangle rect, ScrollBarArrowButtonState state, bool arrowUp) +// { + +// using (var img = GetArrowDownButtonImage(state)) +// { + +// if (arrowUp) +// { +// img.RotateFlip(RotateFlipType.Rotate90FlipNone); +// } +// else +// { +// img.RotateFlip(RotateFlipType.Rotate270FlipNone); +// } + +// g.DrawImage(img, rect); + +// } + +// } + +// private Image GetArrowDownButtonImage(ScrollBarArrowButtonState state) +// { + +// var rect = new Rectangle(0, 0, _arrowWidth, _arrowHeight); +// var bitmap = new Bitmap(_arrowWidth, _arrowHeight, PixelFormat.Format32bppArgb); + +// using (Graphics g = Graphics.FromImage(bitmap)) +// { + +// g.SmoothingMode = SmoothingMode.None; +// g.InterpolationMode = InterpolationMode.HighQualityBicubic; + +// int index = 0; + +// switch (state) +// { + +// case ScrollBarArrowButtonState.UpHot: +// case ScrollBarArrowButtonState.DownHot: +// { +// index = 1; +// break; +// } + +// case ScrollBarArrowButtonState.UpActive: +// case ScrollBarArrowButtonState.DownActive: +// { +// index = 1; +// break; +// } + +// case ScrollBarArrowButtonState.UpPressed: +// case ScrollBarArrowButtonState.DownPressed: +// { +// index = 2; +// break; +// } + +// } + +// using (var sb = new SolidBrush(_arrowColors[index])) +// { +// g.FillPolygon(sb, GetDownArrow(rect)); +// } + +// } + +// return bitmap; + +// } + +// private static Point[] GetDownArrow(Rectangle r) +// { + +// var middle = new Point(r.Left + r.Width / 2 - 1, r.Top + r.Height / 2 + 1); +// return new[] { new Point(middle.X - 3, middle.Y - 2), new Point(middle.X + 4, middle.Y - 2), new Point(middle.X, middle.Y + 2) }; + +// } + +// #endregion + +// #region Enumerations + +// private enum ScrollBarArrowButtonState +// { + +// /// +// /// Indicates the up arrow is in normal state. +// /// +// UpNormal, + +// /// +// /// Indicates the up arrow is in hot state. +// /// +// UpHot, + +// /// +// /// Indicates the up arrow is in active state. +// /// +// UpActive, + +// /// +// /// Indicates the up arrow is in pressed state. +// /// +// UpPressed, + +// /// +// /// Indicates the up arrow is in disabled state. +// /// +// UpDisabled, + +// /// +// /// Indicates the down arrow is in normal state. +// /// +// DownNormal, + +// /// +// /// Indicates the down arrow is in hot state. +// /// +// DownHot, + +// /// +// /// Indicates the down arrow is in active state. +// /// +// DownActive, + +// /// +// /// Indicates the down arrow is in pressed state. +// /// +// DownPressed, + +// /// +// /// Indicates the down arrow is in disabled state. +// /// +// DownDisabled + +// } + +// private enum ScrollBarState +// { + +// /// +// /// Indicates a normal scrollbar state. +// /// +// Normal, + +// /// +// /// Indicates a hot scrollbar state. +// /// +// Hot, + +// /// +// /// Indicates an active scrollbar state. +// /// +// Active, + +// /// +// /// Indicates a pressed scrollbar state. +// /// +// Pressed, + +// /// +// /// Indicates a disabled scrollbar state. +// /// +// Disabled + +// } + +// #endregion + +// } + +//} \ No newline at end of file diff --git a/DarkControls/Controls/MaximizeButton.cs b/DarkControls/Controls/MaximizeButton.cs new file mode 100644 index 0000000..39f7f39 --- /dev/null +++ b/DarkControls/Controls/MaximizeButton.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DarkControls.Controls +{ + public class MaximizeButton : WindowsDefaultTitleBarButton + { + public MaximizeButton() + { + this.ButtonType = DarkControls.Controls.WindowsDefaultTitleBarButton.Type.Maximize; + this.ClickColor = System.Drawing.Color.Red; + this.ClickIconColor = System.Drawing.Color.Black; + this.HoverColor = System.Drawing.Color.OrangeRed; + this.HoverIconColor = System.Drawing.Color.Black; + this.IconColor = System.Drawing.Color.Black; + this.IconLineThickness = 2; + this.Size = new System.Drawing.Size(40, 40); + this.UseVisualStyleBackColor = true; + } + } +} diff --git a/DarkControls/Controls/MinimizeButton.cs b/DarkControls/Controls/MinimizeButton.cs new file mode 100644 index 0000000..1403612 --- /dev/null +++ b/DarkControls/Controls/MinimizeButton.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DarkControls.Controls +{ + public class MinimizeButton : WindowsDefaultTitleBarButton + { + public MinimizeButton() + { + this.ButtonType = DarkControls.Controls.WindowsDefaultTitleBarButton.Type.Minimize; + this.ClickColor = System.Drawing.Color.Red; + this.ClickIconColor = System.Drawing.Color.Black; + this.HoverColor = System.Drawing.Color.OrangeRed; + this.HoverIconColor = System.Drawing.Color.Black; + this.IconColor = System.Drawing.Color.Black; + this.IconLineThickness = 2; + this.Size = new System.Drawing.Size(40, 40); + this.UseVisualStyleBackColor = true; + } + } +} diff --git a/DarkControls/Controls/NoFocusCueBotton.cs b/DarkControls/Controls/NoFocusCueBotton.cs new file mode 100644 index 0000000..9bdc43c --- /dev/null +++ b/DarkControls/Controls/NoFocusCueBotton.cs @@ -0,0 +1,24 @@ +using System.ComponentModel; +using System.Windows.Forms; + +namespace DarkControls.Controls +{ + /// + /// Modified button which has no focus rectangles when the form which contains this button loses fucus while the button was focused. + /// + [ToolboxItem(typeof(NoFocusCueBotton))] + public class NoFocusCueBotton : Button + { + protected override bool ShowFocusCues => false; + + /// + /// Creates a new instance of a + /// + public NoFocusCueBotton() { } + + public override void NotifyDefault(bool value) + { + base.NotifyDefault(false); + } + } +} \ No newline at end of file diff --git a/DarkControls/Controls/ProgressBarEx.cs b/DarkControls/Controls/ProgressBarEx.cs new file mode 100644 index 0000000..5eb7687 --- /dev/null +++ b/DarkControls/Controls/ProgressBarEx.cs @@ -0,0 +1,49 @@ +using System; +using System.Windows.Forms; +using System.Drawing; +using System.Drawing.Drawing2D; + +namespace DarkControls.Controls +{ + public class ProgressBarEx : ProgressBar + { + public ProgressBarEx() + { + this.SetStyle(ControlStyles.UserPaint, true); + } + + protected override void OnPaintBackground(PaintEventArgs pevent) + { + // None... Helps control the flicker. + } + + protected override void OnPaint(PaintEventArgs e) + { + const int inset = 2; // A single inset value to control teh sizing of the inner rect. + + using (Image offscreenImage = new Bitmap(this.Width, this.Height)) + { + using (Graphics offscreen = Graphics.FromImage(offscreenImage)) + { + offscreen.Clear(this.BackColor); + Rectangle rect = new Rectangle(0, 0, this.Width, this.Height); + offscreen.DrawRectangle(new Pen(Color.Silver, 2), rect); + + //if (ProgressBarRenderer.IsSupported) + // ProgressBarRenderer.DrawHorizontalBar(offscreen, rect); + + rect.Inflate(new Size(-inset, -inset)); // Deflate inner rect. + rect.Width = (int)(rect.Width * ((double)this.Value / this.Maximum)); + if (rect.Width == 0) rect.Width = 1; // Can't draw rec with width of 0. + + //LinearGradientBrush brush = new LinearGradientBrush(rect, this.BackColor, this.ForeColor, LinearGradientMode.Horizontal); + SolidBrush brush = new SolidBrush(this.ForeColor); + + offscreen.FillRectangle(brush, inset, inset, rect.Width, rect.Height); + + e.Graphics.DrawImage(offscreenImage, 0, 0); + } + } + } + } +} diff --git a/DarkControls/Controls/SimpleColorTransforms.cs b/DarkControls/Controls/SimpleColorTransforms.cs new file mode 100644 index 0000000..1dbc86f --- /dev/null +++ b/DarkControls/Controls/SimpleColorTransforms.cs @@ -0,0 +1,403 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Runtime.InteropServices; +using SystemMath = System.Math; + +namespace DarkControls.Controls +{ + /// + /// Static methods for transforming argb spaces and argb values. + /// + public static class SimpleColorTransforms + { + private static double tolerance + => 0.000000000000001; + + + /// + /// Defines brightness levels. + /// + public enum Brightness + : byte + { + Bright = 255, + MediumBright = 210, + Medium = 142, + Dim = 98, + XDim = 50 + } + + + /// + /// Defines alpha levels. + /// + public enum Alpha + : byte + { + Opaque = 255, + MediumHigh = 230, + Medium = 175, + MediumLow = 142, + Low = 109, + XLow = 45 + } + + + /// + /// Defines hint alpha levels. + /// + public enum HintAlpha + : byte + { + Low = 64, + XLow = 48, + XxLow = 32, + XxxLow = 16 + } + + + /// + /// Specifies a mode for argb transformations. + /// + public enum ColorTransformMode + : byte + { + Hsl, + Hsb + } + + + /// + /// Converts RGB to HSL. Alpha is ignored. + /// Output is: { H: [0, 360], S: [0, 1], L: [0, 1] }. + /// + /// The color to convert. + public static double[] RgBtoHsl(Color color) + { + double h = 0D; + double s = 0D; + double l; + + // normalize red, green, blue values + double r = color.R / 255D; + double g = color.G / 255D; + double b = color.B / 255D; + + double max = SystemMath.Max(r, SystemMath.Max(g, b)); + double min = SystemMath.Min(r, SystemMath.Min(g, b)); + + // hue + if (SystemMath.Abs(max - min) < SimpleColorTransforms.tolerance) + h = 0D; // undefined + else if ((SystemMath.Abs(max - r) < SimpleColorTransforms.tolerance) + && (g >= b)) + h = (60D * (g - b)) / (max - min); + else if ((SystemMath.Abs(max - r) < SimpleColorTransforms.tolerance) + && (g < b)) + h = ((60D * (g - b)) / (max - min)) + 360D; + else if (SystemMath.Abs(max - g) < SimpleColorTransforms.tolerance) + h = ((60D * (b - r)) / (max - min)) + 120D; + else if (SystemMath.Abs(max - b) < SimpleColorTransforms.tolerance) + h = ((60D * (r - g)) / (max - min)) + 240D; + + // luminance + l = (max + min) / 2D; + + // saturation + if ((SystemMath.Abs(l) < SimpleColorTransforms.tolerance) + || (SystemMath.Abs(max - min) < SimpleColorTransforms.tolerance)) + s = 0D; + else if ((0D < l) + && (l <= .5D)) + s = (max - min) / (max + min); + else if (l > .5D) + s = (max - min) / (2D - (max + min)); //(max-min > 0)? + + return new[] + { + SystemMath.Max(0D, SystemMath.Min(360D, double.Parse($"{h:0.##}"))), + SystemMath.Max(0D, SystemMath.Min(1D, double.Parse($"{s:0.##}"))), + SystemMath.Max(0D, SystemMath.Min(1D, double.Parse($"{l:0.##}"))) + }; + } + + + /// + /// Converts HSL to RGB, with a specified output Alpha. + /// Arguments are limited to the defined range: + /// does not raise exceptions. + /// + /// Hue, must be in [0, 360]. + /// Saturation, must be in [0, 1]. + /// Luminance, must be in [0, 1]. + /// Output Alpha, must be in [0, 255]. + public static Color HsLtoRgb(double h, double s, double l, int a = 255) + { + h = SystemMath.Max(0D, SystemMath.Min(360D, h)); + s = SystemMath.Max(0D, SystemMath.Min(1D, s)); + l = SystemMath.Max(0D, SystemMath.Min(1D, l)); + a = SystemMath.Max(0, SystemMath.Min(255, a)); + + // achromatic argb (gray scale) + if (SystemMath.Abs(s) < SimpleColorTransforms.tolerance) + { + return Color.FromArgb( + a, + SystemMath.Max(0, SystemMath.Min(255, Convert.ToInt32(double.Parse($"{l * 255D:0.00}")))), + SystemMath.Max(0, SystemMath.Min(255, Convert.ToInt32(double.Parse($"{l * 255D:0.00}")))), + SystemMath.Max(0, SystemMath.Min(255, Convert.ToInt32(double.Parse($"{l * 255D:0.00}"))))); + } + + double q = l < .5D + ? l * (1D + s) + : (l + s) - (l * s); + double p = (2D * l) - q; + + double hk = h / 360D; + double[] T = new double[3]; + T[0] = hk + (1D / 3D); // Tr + T[1] = hk; // Tb + T[2] = hk - (1D / 3D); // Tg + + for (int i = 0; i < 3; i++) + { + if (T[i] < 0D) + T[i] += 1D; + if (T[i] > 1D) + T[i] -= 1D; + + if ((T[i] * 6D) < 1D) + T[i] = p + ((q - p) * 6D * T[i]); + else if ((T[i] * 2D) < 1) + T[i] = q; + else if ((T[i] * 3D) < 2) + T[i] = p + ((q - p) * ((2D / 3D) - T[i]) * 6D); + else + T[i] = p; + } + + return Color.FromArgb( + a, + SystemMath.Max(0, SystemMath.Min(255, Convert.ToInt32(double.Parse($"{T[0] * 255D:0.00}")))), + SystemMath.Max(0, SystemMath.Min(255, Convert.ToInt32(double.Parse($"{T[1] * 255D:0.00}")))), + SystemMath.Max(0, SystemMath.Min(255, Convert.ToInt32(double.Parse($"{T[2] * 255D:0.00}"))))); + } + + + /// + /// Converts RGB to HSB. Alpha is ignored. + /// Output is: { H: [0, 360], S: [0, 1], B: [0, 1] }. + /// + /// The color to convert. + public static double[] RgBtoHsb(Color color) + { + // normalize red, green and blue values + double r = color.R / 255D; + double g = color.G / 255D; + double b = color.B / 255D; + + // conversion start + double max = SystemMath.Max(r, SystemMath.Max(g, b)); + double min = SystemMath.Min(r, SystemMath.Min(g, b)); + + double h = 0D; + if ((SystemMath.Abs(max - r) < SimpleColorTransforms.tolerance) + && (g >= b)) + h = (60D * (g - b)) / (max - min); + else if ((SystemMath.Abs(max - r) < SimpleColorTransforms.tolerance) + && (g < b)) + h = ((60D * (g - b)) / (max - min)) + 360D; + else if (SystemMath.Abs(max - g) < SimpleColorTransforms.tolerance) + h = ((60D * (b - r)) / (max - min)) + 120D; + else if (SystemMath.Abs(max - b) < SimpleColorTransforms.tolerance) + h = ((60D * (r - g)) / (max - min)) + 240D; + + double s = SystemMath.Abs(max) < SimpleColorTransforms.tolerance + ? 0D + : 1D - (min / max); + + return new[] + { + SystemMath.Max(0D, SystemMath.Min(360D, h)), + SystemMath.Max(0D, SystemMath.Min(1D, s)), + SystemMath.Max(0D, SystemMath.Min(1D, max)) + }; + } + + + /// + /// Converts HSB to RGB, with a specified output Alpha. + /// Arguments are limited to the defined range: + /// does not raise exceptions. + /// + /// Hue, must be in [0, 360]. + /// Saturation, must be in [0, 1]. + /// Brightness, must be in [0, 1]. + /// Output Alpha, must be in [0, 255]. + public static Color HsBtoRgb(double h, double s, double b, int a = 255) + { + h = SystemMath.Max(0D, SystemMath.Min(360D, h)); + s = SystemMath.Max(0D, SystemMath.Min(1D, s)); + b = SystemMath.Max(0D, SystemMath.Min(1D, b)); + a = SystemMath.Max(0, SystemMath.Min(255, a)); + + double r = 0D; + double g = 0D; + double bl = 0D; + + if (SystemMath.Abs(s) < SimpleColorTransforms.tolerance) + r = g = bl = b; + else + { + // the argb wheel consists of 6 sectors. Figure out which sector + // you're in. + double sectorPos = h / 60D; + int sectorNumber = (int)SystemMath.Floor(sectorPos); + // get the fractional part of the sector + double fractionalSector = sectorPos - sectorNumber; + + // calculate values for the three axes of the argb. + double p = b * (1D - s); + double q = b * (1D - (s * fractionalSector)); + double t = b * (1D - (s * (1D - fractionalSector))); + + // assign the fractional colors to r, g, and b based on the sector + // the angle is in. + switch (sectorNumber) + { + case 0: + r = b; + g = t; + bl = p; + break; + case 1: + r = q; + g = b; + bl = p; + break; + case 2: + r = p; + g = b; + bl = t; + break; + case 3: + r = p; + g = q; + bl = b; + break; + case 4: + r = t; + g = p; + bl = b; + break; + case 5: + r = b; + g = p; + bl = q; + break; + } + } + + return Color.FromArgb( + a, + SystemMath.Max(0, SystemMath.Min(255, Convert.ToInt32(double.Parse($"{r * 255D:0.00}")))), + SystemMath.Max(0, SystemMath.Min(255, Convert.ToInt32(double.Parse($"{g * 255D:0.00}")))), + SystemMath.Max(0, SystemMath.Min(255, Convert.ToInt32(double.Parse($"{bl * 250D:0.00}"))))); + } + + + /// + /// Multiplies the Color's Luminance or Brightness by the argument; + /// and optionally specifies the output Alpha. + /// + /// The color to transform. + /// Transform mode. + /// The transformation multiplier. + /// Can optionally specify the Alpha to directly + /// set on the output. If null, then the input + /// Alpha is used. + public static Color TransformBrightness( + Color color, + ColorTransformMode colorTransformMode, + double brightnessTransform, + byte? outputAlpha = null) + { + double[] hsl = colorTransformMode == ColorTransformMode.Hsl + ? SimpleColorTransforms.RgBtoHsl(color) + : SimpleColorTransforms.RgBtoHsb(color); + if ((SystemMath.Abs(hsl[2]) < SimpleColorTransforms.tolerance) + && (brightnessTransform > 1D)) + hsl[2] = brightnessTransform - 1D; + else + hsl[2] *= brightnessTransform; + return colorTransformMode == ColorTransformMode.Hsl + ? SimpleColorTransforms.HsLtoRgb(hsl[0], hsl[1], hsl[2], outputAlpha ?? color.A) + : SimpleColorTransforms.HsBtoRgb(hsl[0], hsl[1], hsl[2], outputAlpha ?? color.A); + } + + + /// + /// Multiplies the Color's Saturation, and Luminance or Brightness by the argument; + /// and optionally specifies the output Alpha. + /// + /// The color to transform. + /// Transform mode. + /// The transformation multiplier. + /// The transformation multiplier. + /// Can optionally specify the Alpha to directly + /// set on the output. If null, then the input + /// Alpha is used. + public static Color TransformSaturationAndBrightness( + Color color, + ColorTransformMode colorTransformMode, + double saturationTransform, + double brightnessTransform, + byte? outputAlpha = null) + { + double[] hsl = colorTransformMode == ColorTransformMode.Hsl + ? SimpleColorTransforms.RgBtoHsl(color) + : SimpleColorTransforms.RgBtoHsb(color); + if ((SystemMath.Abs(hsl[1]) < SimpleColorTransforms.tolerance) + && (saturationTransform > 1D)) + hsl[1] = saturationTransform - 1D; + else + hsl[1] *= saturationTransform; + if ((SystemMath.Abs(hsl[2]) < SimpleColorTransforms.tolerance) + && (brightnessTransform > 1D)) + hsl[2] = brightnessTransform - 1D; + else + hsl[2] *= brightnessTransform; + return colorTransformMode == ColorTransformMode.Hsl + ? SimpleColorTransforms.HsLtoRgb(hsl[0], hsl[1], hsl[2], outputAlpha ?? color.A) + : SimpleColorTransforms.HsBtoRgb(hsl[0], hsl[1], hsl[2], outputAlpha ?? color.A); + } + + + /// + /// Creates a new Color by combining R, G, and B from each Color, scaled by the Color's Alpha. + /// The R, G, B of each Color is scaled by the Color's Alpha. The R, G, B of both results is + /// then added together and divided by 2. The valuea are limited to [0, 255]. + /// The Alpha of the output Color is specified; and is also limited to [0, 255] + /// (does not raise exceptions). + /// + /// Combined by scaling RGB by the A. + /// Combined by scaling RGB by the A. + /// The Alpha of the output Color. + public static Color AlphaCombine(Color color1, Color color2, byte outputAlpha) + { + double a1 = color1.A / 255D; + double a2 = color2.A / 255D; + return Color.FromArgb( + outputAlpha, + (byte)SystemMath.Max(0D, SystemMath.Min(255D, ((color1.R * a1) + (color2.R * a2)) * .5D)), + (byte)SystemMath.Max(0D, SystemMath.Min(255D, ((color1.G * a1) + (color2.G * a2)) * .5D)), + (byte)SystemMath.Max(0D, SystemMath.Min(255D, ((color1.B * a1) + (color2.B * a2)) * .5D))); + } + } +} diff --git a/DarkControls/Controls/TransparentLabel.cs b/DarkControls/Controls/TransparentLabel.cs new file mode 100644 index 0000000..ad93466 --- /dev/null +++ b/DarkControls/Controls/TransparentLabel.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace DarkControls.Controls +{ + public class TransparentLabel : Label + { + protected override void WndProc(ref Message m) + { + const int WM_NCHITTEST = 0x0084; + const int HTTRANSPARENT = (-1); + + if (m.Msg == WM_NCHITTEST) + { + m.Result = (IntPtr)HTTRANSPARENT; + } + else + { + base.WndProc(ref m); + } + } + } +} diff --git a/DarkControls/Controls/WindowsDefaultTitleBarButton.cs b/DarkControls/Controls/WindowsDefaultTitleBarButton.cs new file mode 100644 index 0000000..22f7399 --- /dev/null +++ b/DarkControls/Controls/WindowsDefaultTitleBarButton.cs @@ -0,0 +1,325 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace DarkControls.Controls +{ + /// + /// Button which represents the default close, minimize or maximize buttons of the windows 10 aero theme. + /// + [ToolboxItem(true)] + public class WindowsDefaultTitleBarButton : NoFocusCueBotton + { + /// + /// Represents the 3 possible types of the windows border buttons. + /// + public enum Type + { + Close, + Maximize, + Minimize + } + + private Pen activeIconColorPen; + private Brush activeIconColorBrush; + private Brush activeColorBrush; + + /// + /// The type which defines the buttons behaviour. + /// + + [RefreshProperties(System.ComponentModel.RefreshProperties.All)] + [EditorBrowsable(EditorBrowsableState.Always)] + [Browsable(true)] + [Category("Appearance")] + [Description("The type which defines the buttons behaviour.")] + public Type ButtonType { get; set; } + + /// + /// The background color of the button when the mouse is inside the buttons bounds. + /// + + [RefreshProperties(System.ComponentModel.RefreshProperties.All)] + [EditorBrowsable(EditorBrowsableState.Always)] + [Browsable(true)] + [Category("Appearance")] + [Description("The background color of the button when the mouse is inside the buttons bounds.")] + public Color HoverColor { get; set; } + + /// + /// The background color of the button when the button is clicked. + /// + + [RefreshProperties(System.ComponentModel.RefreshProperties.All)] + [EditorBrowsable(EditorBrowsableState.Always)] + [Browsable(true)] + [Category("Appearance")] + [Description("The background color of the button when the button is clicked.")] + public Color ClickColor { get; set; } + + /// + /// The default color of the icon. + /// + + [RefreshProperties(System.ComponentModel.RefreshProperties.All)] + [EditorBrowsable(EditorBrowsableState.Always)] + [Browsable(true)] + [Category("Appearance")] + [Description("The default color of the icon.")] + public Color IconColor { get; set; } + + /// + /// The color of the icon when the mouse is inside the buttons bounds. + /// + + [RefreshProperties(System.ComponentModel.RefreshProperties.All)] + [EditorBrowsable(EditorBrowsableState.Always)] + [Browsable(true)] + [Category("Appearance")] + [Description("The color of the icon when the mouse is inside the buttons bounds.")] + public Color HoverIconColor { get; set; } + + /// + /// The color of the icon when the mouse is inside the buttons bounds. + /// + + [RefreshProperties(System.ComponentModel.RefreshProperties.All)] + [EditorBrowsable(EditorBrowsableState.Always)] + [Browsable(true)] + [Category("Appearance")] + [DefaultValue("2")] + [Description("The thickness of the lines making up the icon")] + public int IconLineThickness { get; set; } + + /// + /// The color of the icon when the button is clicked. + /// + + [RefreshProperties(System.ComponentModel.RefreshProperties.All)] + [EditorBrowsable(EditorBrowsableState.Always)] + [Browsable(true)] + [Category("Appearance")] + [Description("The color of the icon when the button is clicked.")] + public Color ClickIconColor { get; set; } + + /// + /// Property which returns the active background color of the button depending on if the button is clicked or hovered. + /// + /// + + [RefreshProperties(System.ComponentModel.RefreshProperties.All)] + [EditorBrowsable(EditorBrowsableState.Always)] + [Browsable(true)] + public virtual Color ActiveColor + { + get + { + if (this.DesignMode == false) + { + if (this.Clicked) + return this.ClickColor; + + if (this.Hovered) + return this.HoverColor; + + return BackColor; + } + else + { + return this.HoverColor; +/* switch (this.ButtonType) + { + case Type.Close: + { + return Color.Red; + } + case Type.Maximize: + { + return Color.SkyBlue; + } + case Type.Minimize: + { + return Color.SkyBlue; + } + }*/ + } + return Color.Empty; + } + } + + /// + /// Property which returns the active color of the buttons icon depending on if the button is clicked or hovered. + /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [RefreshProperties(System.ComponentModel.RefreshProperties.All)] + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + public virtual Color ActiveIconColor + { + get + { + if (this.DesignMode == false) + { + if (this.Clicked) + return this.ClickIconColor; + + if (this.Hovered) + return this.HoverIconColor; + + return IconColor; + } + else + { + return Color.Black; + } + } + } + + /// + /// Property which indicates if the mouse is currently inside the bounds of the button. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + [DefaultValue(false)] + public bool Hovered { get; set; } + + /// + /// Property which indicates if the left mouse button was pressed down inside the buttons bounds. Can be true before the click event is triggered. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + [DefaultValue(false)] + public bool Clicked { get; set; } + + public WindowsDefaultTitleBarButton() { } + + protected override void OnMouseEnter(EventArgs e) + { + base.OnMouseEnter(e); + Hovered = true; + } + + protected override void OnMouseLeave(EventArgs e) + { + base.OnMouseLeave(e); + Hovered = false; + } + + protected override void OnMouseDown(MouseEventArgs mevent) + { + base.OnMouseDown(mevent); + Clicked = true; + } + + protected override void OnMouseUp(MouseEventArgs mevent) + { + base.OnMouseUp(mevent); + Clicked = false; + } + + protected override void OnClick(EventArgs e) + { + if (ButtonType == Type.Close) + this.FindForm()?.Close(); + else if (ButtonType == Type.Maximize) + this.FindForm().WindowState = this.FindForm().WindowState == FormWindowState.Maximized ? FormWindowState.Normal : FormWindowState.Maximized; + else + this.FindForm().WindowState = FormWindowState.Minimized; + + base.OnClick(e); + } + + protected override void OnPaint(PaintEventArgs pevent) + { + System.Diagnostics.Trace.WriteLine(pevent.ClipRectangle.ToString()); + + activeColorBrush?.Dispose(); + activeColorBrush = new SolidBrush(ActiveColor); + + pevent.Graphics.FillRectangle(new SolidBrush(ActiveColor), pevent.ClipRectangle); + pevent.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + + activeIconColorBrush?.Dispose(); + activeIconColorPen?.Dispose(); + + activeIconColorBrush = new SolidBrush(ActiveIconColor); + activeIconColorPen = new Pen(activeIconColorBrush, IconLineThickness); + + if (ButtonType == Type.Close) + { + drawCloseIcon(pevent, new Rectangle(0, 0, this.Width, this.Height)); + } + else if (ButtonType == Type.Maximize) + { + drawMaximizeIcon(pevent, new Rectangle(0, 0, this.Width, this.Height)); + } + else + { + drawMinimizeIcon(pevent, new Rectangle(0, 0, this.Width, this.Height)); + } + } + + protected virtual void drawCloseIcon(PaintEventArgs e, Rectangle drawRect) + { + int size = 12; + e.Graphics.DrawLine( + activeIconColorPen, + drawRect.X + drawRect.Width / 2 - (size / 2), + drawRect.Y + drawRect.Height / 2 - (size / 2), + drawRect.X + drawRect.Width / 2 + (size / 2), + drawRect.Y + drawRect.Height / 2 + (size / 2)); + + e.Graphics.DrawLine( + activeIconColorPen, + drawRect.X + drawRect.Width / 2 - (size / 2), + drawRect.Y + drawRect.Height / 2 + (size / 2), + drawRect.X + drawRect.Width / 2 + (size / 2), + drawRect.Y + drawRect.Height / 2 - (size / 2)); + } + + protected virtual void drawMaximizeIcon(PaintEventArgs e, Rectangle drawRect) + { + if (this.FindForm().WindowState == FormWindowState.Normal) + { + int size = 10; + Rectangle rect = new Rectangle( + drawRect.X + drawRect.Width / 2 - (size / 2), + drawRect.Y + drawRect.Height / 2 - (size / 2), + size, size); + Rectangle r2 = new Rectangle(rect.X, rect.Y, rect.Width, 2); + e.Graphics.DrawRectangle(activeIconColorPen, rect); + + e.Graphics.FillRectangle(new SolidBrush(activeIconColorPen.Color), r2); + } + else if (this.FindForm().WindowState == FormWindowState.Maximized) + { + e.Graphics.DrawRectangle( + activeIconColorPen, + new Rectangle( + drawRect.X + drawRect.Width / 2 - 3, + drawRect.Y + drawRect.Height / 2 - 5, + 8, 8)); + + Rectangle rect = new Rectangle( + drawRect.X + drawRect.Width / 2 - 5, + drawRect.Y + drawRect.Height / 2 - 3, + 8, 8); + + e.Graphics.FillRectangle(activeIconColorBrush, rect); + e.Graphics.DrawRectangle(activeIconColorPen, rect); + } + } + + protected virtual void drawMinimizeIcon(PaintEventArgs e, Rectangle drawRect) + { + int lower = 3; + e.Graphics.DrawLine( + activeIconColorPen, + drawRect.X + drawRect.Width / 2 - 5, + drawRect.Y + drawRect.Height / 2 + lower, + drawRect.X + drawRect.Width / 2 + 5, + drawRect.Y + drawRect.Height / 2 + lower); + } + } +} \ No newline at end of file diff --git a/DarkControls/DarkControls.csproj b/DarkControls/DarkControls.csproj new file mode 100644 index 0000000..7e7ccf7 --- /dev/null +++ b/DarkControls/DarkControls.csproj @@ -0,0 +1,140 @@ + + + + + Debug + AnyCPU + {66C94ACB-63C7-42A3-9D83-A3801CED4F1C} + Library + Properties + DarkControls + DarkControls + v4.8 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + 7.3 + prompt + true + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + 7.3 + prompt + + + + + + + + + + + + + + + + + + Component + + + Component + + + Component + + + Component + + + Component + + + Component + + + Component + + + Component + + + + Component + + + Component + + + Component + + + Component + + + + Component + + + Component + + + Form + + + + Component + + + + True + True + Resources.resx + + + + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + + + \ No newline at end of file diff --git a/DarkControls/Properties/AssemblyInfo.cs b/DarkControls/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..8a20c55 --- /dev/null +++ b/DarkControls/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Lib")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Lib")] +[assembly: AssemblyCopyright("Copyright © 2023")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("66c94acb-63c7-42a3-9d83-a3801ced4f1c")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DarkControls/Properties/Resources.Designer.cs b/DarkControls/Properties/Resources.Designer.cs new file mode 100644 index 0000000..bf31ba6 --- /dev/null +++ b/DarkControls/Properties/Resources.Designer.cs @@ -0,0 +1,103 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DarkControls.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DarkControls.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap appIcon1_AppIconImage { + get { + object obj = ResourceManager.GetObject("appIcon1.AppIconImage", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap appIcon1_Image { + get { + object obj = ResourceManager.GetObject("appIcon1.Image", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap icons8_crossed_axes_100 { + get { + object obj = ResourceManager.GetObject("icons8_crossed_axes_100", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap selectFileBtn_Image { + get { + object obj = ResourceManager.GetObject("selectFileBtn_Image", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/DarkControls/Properties/Resources.resx b/DarkControls/Properties/Resources.resx new file mode 100644 index 0000000..e6c83a8 --- /dev/null +++ b/DarkControls/Properties/Resources.resx @@ -0,0 +1,245 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL + EAAACxABrSO9dQAAFCZJREFUeF7tXQl0lFWaDTraYzvTdJ8ZbRfEFpFNNgk7gSAECFsgQBaSACKLEPal + XRuxu1EYQA5JUeACsp2wJOyETTAhUaGitEoGgTmSEefM6T5OZ0bbdoOq4s79Ku9V3v+nQqUSSALWPeee + 1P+++33ve+/W++tPHYMRYYQRRhhhhBFGGGGEEUYYYYQRRhhhhBFGGGGEETrunYZ+98/AlvtmoIg/998/ + HZMiJ+M2Fa4ztFqI2++ficnsK1d6I7Pum44YFb4JsRC3PDANjgemAwF44r5p+BelrHXI3NKDrSfNTOld + SW8WoEHjaVj94DSgMjZOxyf3Tsa/qoRaQ+Op+NWD6fgwUE+a7H3dDW1Kkylo/VA6nm8yFZvIdU3SsY+E + wQ9+k44x1Gy0jE/Fxy1q8aTIXDKnrYdN0htff2AZlzXIWhiXtT2cjkdVmfqLZnyHN52KveQVEoH48FQU + tkrHP6mUCF4vtsSn1I4pMofMZZl7KpaocETbebiT8QIzbuOVplOwR9asUuoXWj6FR5o9hYvNpwBXYYFp + hkbzp7DYonvq+poitWUO25x+MzTapuFOxgosOhtlzbJ2lVI/0GwiHmo5Gf/NxlAZWzwV2AwNahbb9NfF + FKkptc25yApmaIgp0rtNbyXXL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T5UoM8JpvdkiB2xUK/HpGoke5 + VqbEULkCdbz+11TKUdUQRlQXCLtjMjxRGYTJwyEoPByM/cy7VcP+yo4HkD3PHAvCUdH2YNTL0FIrwy8n + QhDzkRwedQG4USPDO8KWWF1RJ6PrdXK41gdDe4JnA9Ak7LXR6of20374ptEXBT0yWDf74usm/4XN7sG0 + ihZfXGv0IatTvihkPbfb/NAi7NXR7YH6XleMdXhQ2YiCHuvywkS7N0qFvYQOb1R0eeImSbSuw4vKzrhg + vHsraoV9f/pcsL/XH9c6pueUfYF4rt8NE71bF56z5TjrgfJzbhj/3Iee7Zn8TcVmjPU5I0fYy/OFM3ou + +P357mD7bOKAKybPOy+9jMtx/mWUD7jg1kjzbNIFHxxnvStf2kFH8hxxxOgVW4wOb0GekFfNsBPe4L2X + HHH5ktPCm+e+XN9MT15xwCaxXDNfvQSbyb+9Ux/yHyJJfwHAIJQLdFWq8gAAAABJRU5ErkJggg== + + + + + ..\icons8-crossed-axes-100.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\selectFileBtn.Image.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/DarkControls/Utils.cs b/DarkControls/Utils.cs new file mode 100644 index 0000000..9518c6c --- /dev/null +++ b/DarkControls/Utils.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace DarkControls +{ + public class Utils + { + [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")] + public static extern IntPtr CreateRoundRectRgn + ( + int nLeftRect, // x-coordinate of upper-left corner + int nTopRect, // y-coordinate of upper-left corner + int nRightRect, // x-coordinate of lower-right corner + int nBottomRect, // y-coordinate of lower-right corner + int nWidthEllipse, // width of ellipse + int nHeightEllipse // height of ellipse + ); + + public static int WM_NCHITTEST = 0x84; + public static int HT_CAPTION = 0x2; + } +} diff --git a/KsDumperClient/icons8-crossed-axes-100.png b/DarkControls/icons8-crossed-axes-100.png similarity index 100% rename from KsDumperClient/icons8-crossed-axes-100.png rename to DarkControls/icons8-crossed-axes-100.png diff --git a/DarkControls/selectFileBtn.Image.png b/DarkControls/selectFileBtn.Image.png new file mode 100644 index 0000000000000000000000000000000000000000..45313d493b66f9d70cfe85df15510ab5f9108575 GIT binary patch literal 690 zcmV;j0!{siP) z?_rjCp6~a4=Y4i25)u+p4pDh0VSI`(bJj}=w#~m$5V$h-N-gn32FsZye_W?7}>Rn89Cyfig2DgqIZ|vCmf^zyW2(Al3M7nP5R( z;yx@no$~|`5Y^}dqjz3{fJ>lXifS}tNoCF(;4FxKaB!dDWo60()F(dGDjL59tC4Q; zSyY-FZo%W|B_mc8Tg&-702ELt%v~E>$+kaVTdr2EQ{O%|jF>hY@{XdJjDG?!Q@^8s zfAw~&a0GIKP}ki00!+{SqL~ag02x}k1gkHk*6sJQMm}Xnlze&sEUI)Saa}o33 z_|!bOx3H5EV^ggL(%X7d+{}p&9JDwEI3z?fx{1c8OD~ZsRqVriZjLz@(IF%xq>M=9 Y58GAE)piD6`Tzg`07*qoM6N<$f?^jrCIA2c literal 0 HcmV?d00001 diff --git a/KsDumper.sln b/KsDumper11.sln similarity index 62% rename from KsDumper.sln rename to KsDumper11.sln index 2d294e1..a2be5f7 100644 --- a/KsDumper.sln +++ b/KsDumper11.sln @@ -3,39 +3,55 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.4.33205.214 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KsDumperClient", "KsDumperClient\KsDumperClient.csproj", "{7881B99D-0B5A-44E7-AF34-80A0ECFFD5DB}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KsDumper11", "KsDumper11\KsDumper11.csproj", "{7881B99D-0B5A-44E7-AF34-80A0ECFFD5DB}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DarkControls", "..\DarkControls\DarkControls\DarkControls.csproj", "{66C94ACB-63C7-42A3-9D83-A3801CED4F1C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DarkControls", "DarkControls\DarkControls.csproj", "{66C94ACB-63C7-42A3-9D83-A3801CED4F1C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{79B0AE0A-4D49-4102-9971-04F5375BF272}" + ProjectSection(SolutionItems) = preProject + .gitignore = .gitignore + README.md = README.md + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {7881B99D-0B5A-44E7-AF34-80A0ECFFD5DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7881B99D-0B5A-44E7-AF34-80A0ECFFD5DB}.Debug|Any CPU.Build.0 = Debug|Any CPU {7881B99D-0B5A-44E7-AF34-80A0ECFFD5DB}.Debug|x64.ActiveCfg = Debug|x64 {7881B99D-0B5A-44E7-AF34-80A0ECFFD5DB}.Debug|x64.Build.0 = Debug|x64 + {7881B99D-0B5A-44E7-AF34-80A0ECFFD5DB}.Debug|x86.ActiveCfg = Debug|x86 + {7881B99D-0B5A-44E7-AF34-80A0ECFFD5DB}.Debug|x86.Build.0 = Debug|x86 {7881B99D-0B5A-44E7-AF34-80A0ECFFD5DB}.Release|Any CPU.ActiveCfg = Release|Any CPU {7881B99D-0B5A-44E7-AF34-80A0ECFFD5DB}.Release|Any CPU.Build.0 = Release|Any CPU {7881B99D-0B5A-44E7-AF34-80A0ECFFD5DB}.Release|x64.ActiveCfg = Release|x64 {7881B99D-0B5A-44E7-AF34-80A0ECFFD5DB}.Release|x64.Build.0 = Release|x64 + {7881B99D-0B5A-44E7-AF34-80A0ECFFD5DB}.Release|x86.ActiveCfg = Release|x86 + {7881B99D-0B5A-44E7-AF34-80A0ECFFD5DB}.Release|x86.Build.0 = Release|x86 {66C94ACB-63C7-42A3-9D83-A3801CED4F1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {66C94ACB-63C7-42A3-9D83-A3801CED4F1C}.Debug|Any CPU.Build.0 = Debug|Any CPU {66C94ACB-63C7-42A3-9D83-A3801CED4F1C}.Debug|x64.ActiveCfg = Debug|x64 {66C94ACB-63C7-42A3-9D83-A3801CED4F1C}.Debug|x64.Build.0 = Debug|x64 + {66C94ACB-63C7-42A3-9D83-A3801CED4F1C}.Debug|x86.ActiveCfg = Debug|Any CPU + {66C94ACB-63C7-42A3-9D83-A3801CED4F1C}.Debug|x86.Build.0 = Debug|Any CPU {66C94ACB-63C7-42A3-9D83-A3801CED4F1C}.Release|Any CPU.ActiveCfg = Release|Any CPU {66C94ACB-63C7-42A3-9D83-A3801CED4F1C}.Release|Any CPU.Build.0 = Release|Any CPU {66C94ACB-63C7-42A3-9D83-A3801CED4F1C}.Release|x64.ActiveCfg = Release|x64 {66C94ACB-63C7-42A3-9D83-A3801CED4F1C}.Release|x64.Build.0 = Release|x64 + {66C94ACB-63C7-42A3-9D83-A3801CED4F1C}.Release|x86.ActiveCfg = Release|Any CPU + {66C94ACB-63C7-42A3-9D83-A3801CED4F1C}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {B97C5D1A-00B8-411D-9716-A3805DA64FD6} + SolutionGuid = {EBFFF900-7478-45AA-95F6-F453BC9C3035} EndGlobalSection EndGlobal diff --git a/KsDumperClient/Driver/DriverInterface.cs b/KsDumper11/Driver/DriverInterface.cs similarity index 98% rename from KsDumperClient/Driver/DriverInterface.cs rename to KsDumper11/Driver/DriverInterface.cs index 16ae836..2ced40e 100644 --- a/KsDumperClient/Driver/DriverInterface.cs +++ b/KsDumper11/Driver/DriverInterface.cs @@ -1,9 +1,9 @@ using System; using System.IO; using System.Runtime.InteropServices; -using KsDumperClient.Utility; +using KsDumper11.Utility; -namespace KsDumperClient.Driver +namespace KsDumper11.Driver { // Token: 0x02000014 RID: 20 public class DriverInterface diff --git a/KsDumperClient/Driver/KsDumperDriver.sys b/KsDumper11/Driver/KsDumperDriver.sys similarity index 100% rename from KsDumperClient/Driver/KsDumperDriver.sys rename to KsDumper11/Driver/KsDumperDriver.sys diff --git a/KsDumperClient/Driver/LoadCapcom.bat b/KsDumper11/Driver/LoadCapcom.bat similarity index 100% rename from KsDumperClient/Driver/LoadCapcom.bat rename to KsDumper11/Driver/LoadCapcom.bat diff --git a/KsDumperClient/Driver/Operations.cs b/KsDumper11/Driver/Operations.cs similarity index 95% rename from KsDumperClient/Driver/Operations.cs rename to KsDumper11/Driver/Operations.cs index c255b3f..173ed9a 100644 --- a/KsDumperClient/Driver/Operations.cs +++ b/KsDumper11/Driver/Operations.cs @@ -1,7 +1,7 @@ using System; -using KsDumperClient.Utility; +using KsDumper11.Utility; -namespace KsDumperClient.Driver +namespace KsDumper11.Driver { // Token: 0x02000015 RID: 21 public static class Operations diff --git a/KsDumperClient/Driver/Taigei64.dll b/KsDumper11/Driver/Taigei64.dll similarity index 100% rename from KsDumperClient/Driver/Taigei64.dll rename to KsDumper11/Driver/Taigei64.dll diff --git a/KsDumperClient/Driver/drv64.dll b/KsDumper11/Driver/drv64.dll similarity index 100% rename from KsDumperClient/Driver/drv64.dll rename to KsDumper11/Driver/drv64.dll diff --git a/KsDumperClient/Driver/kdu.exe b/KsDumper11/Driver/kdu.exe similarity index 100% rename from KsDumperClient/Driver/kdu.exe rename to KsDumper11/Driver/kdu.exe diff --git a/KsDumperClient/Dumper.Designer.cs b/KsDumper11/Dumper.Designer.cs similarity index 98% rename from KsDumperClient/Dumper.Designer.cs rename to KsDumper11/Dumper.Designer.cs index 2d39a39..2734ed5 100644 --- a/KsDumperClient/Dumper.Designer.cs +++ b/KsDumper11/Dumper.Designer.cs @@ -1,4 +1,4 @@ -namespace KsDumperClient +namespace KsDumper11 { // Token: 0x02000002 RID: 2 public partial class Dumper : global::System.Windows.Forms.Form @@ -35,7 +35,7 @@ this.refreshBtn = new System.Windows.Forms.Button(); this.autoRefreshCheckBox = new DarkControls.Controls.DarkCheckBox(); this.hideSystemProcessBtn = new System.Windows.Forms.Button(); - this.processList = new KsDumperClient.Utility.ProcessListView(); + this.processList = new KsDumper11.Utility.ProcessListView(); this.PIDHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.NameHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.PathHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); @@ -128,9 +128,8 @@ // // appIcon1 // - this.appIcon1.AppIconImage = global::KsDumperClient.Properties.Resources.icons8_crossed_axes_100; + this.appIcon1.AppIconImage = global::KsDumper11.Properties.Resources.icons8_crossed_axes_100; this.appIcon1.DragForm = this; - this.appIcon1.Image = ((System.Drawing.Image)(resources.GetObject("appIcon1.Image"))); this.appIcon1.Location = new System.Drawing.Point(5, 4); this.appIcon1.Name = "appIcon1"; this.appIcon1.Scale = 3.5F; @@ -315,7 +314,7 @@ private global::System.ComponentModel.IContainer components = null; // Token: 0x04000013 RID: 19 - private global::KsDumperClient.Utility.ProcessListView processList; + private global::KsDumper11.Utility.ProcessListView processList; // Token: 0x04000014 RID: 20 private global::System.Windows.Forms.ColumnHeader PIDHeader; diff --git a/KsDumperClient/Dumper.cs b/KsDumper11/Dumper.cs similarity index 99% rename from KsDumperClient/Dumper.cs rename to KsDumper11/Dumper.cs index 4d72fc2..b7be388 100644 --- a/KsDumperClient/Dumper.cs +++ b/KsDumper11/Dumper.cs @@ -8,11 +8,11 @@ using System.Threading.Tasks; using System.Windows.Forms; using DarkControls; using DarkControls.Controls; -using KsDumperClient.Driver; -using KsDumperClient.PE; -using KsDumperClient.Utility; +using KsDumper11.Driver; +using KsDumper11.PE; +using KsDumper11.Utility; -namespace KsDumperClient +namespace KsDumper11 { // Token: 0x02000002 RID: 2 public partial class Dumper : Form diff --git a/KsDumperClient/Dumper.resx b/KsDumper11/Dumper.resx similarity index 100% rename from KsDumperClient/Dumper.resx rename to KsDumper11/Dumper.resx diff --git a/KsDumperClient/KsDumperClient.csproj b/KsDumper11/KsDumper11.csproj similarity index 98% rename from KsDumperClient/KsDumperClient.csproj rename to KsDumper11/KsDumper11.csproj index b411cac..134edae 100644 --- a/KsDumperClient/KsDumperClient.csproj +++ b/KsDumper11/KsDumper11.csproj @@ -6,8 +6,8 @@ AnyCPU {7881B99D-0B5A-44E7-AF34-80A0ECFFD5DB} WinExe - KsDumperClient - KsDumperClient + KsDumper11 + KsDumper11 v4.8 512 true @@ -154,7 +154,6 @@ - Always diff --git a/KsDumperClient/PE/32/PE32File.cs b/KsDumper11/PE/32/PE32File.cs similarity index 98% rename from KsDumperClient/PE/32/PE32File.cs rename to KsDumper11/PE/32/PE32File.cs index 5f0a910..fc2076c 100644 --- a/KsDumperClient/PE/32/PE32File.cs +++ b/KsDumper11/PE/32/PE32File.cs @@ -1,9 +1,9 @@ using System.IO; using System.Runtime.InteropServices; -using static KsDumperClient.PE.NativePEStructs; +using static KsDumper11.PE.NativePEStructs; -namespace KsDumperClient.PE +namespace KsDumper11.PE { public class PE32File : PEFile { diff --git a/KsDumperClient/PE/32/PE32Header.cs b/KsDumper11/PE/32/PE32Header.cs similarity index 99% rename from KsDumperClient/PE/32/PE32Header.cs rename to KsDumper11/PE/32/PE32Header.cs index 04ca600..0436abb 100644 --- a/KsDumperClient/PE/32/PE32Header.cs +++ b/KsDumper11/PE/32/PE32Header.cs @@ -1,9 +1,9 @@ using System.IO; using System.Linq; -using static KsDumperClient.PE.NativePEStructs; +using static KsDumper11.PE.NativePEStructs; -namespace KsDumperClient.PE +namespace KsDumper11.PE { public class PE32Header { diff --git a/KsDumperClient/PE/64/PE64File.cs b/KsDumper11/PE/64/PE64File.cs similarity index 98% rename from KsDumperClient/PE/64/PE64File.cs rename to KsDumper11/PE/64/PE64File.cs index a1abc79..ae91013 100644 --- a/KsDumperClient/PE/64/PE64File.cs +++ b/KsDumper11/PE/64/PE64File.cs @@ -1,9 +1,9 @@ using System.IO; using System.Runtime.InteropServices; -using static KsDumperClient.PE.NativePEStructs; +using static KsDumper11.PE.NativePEStructs; -namespace KsDumperClient.PE +namespace KsDumper11.PE { public class PE64File : PEFile { diff --git a/KsDumperClient/PE/64/PE64Header.cs b/KsDumper11/PE/64/PE64Header.cs similarity index 99% rename from KsDumperClient/PE/64/PE64Header.cs rename to KsDumper11/PE/64/PE64Header.cs index 3a5356c..dbe9792 100644 --- a/KsDumperClient/PE/64/PE64Header.cs +++ b/KsDumper11/PE/64/PE64Header.cs @@ -1,9 +1,9 @@ using System.IO; using System.Linq; -using static KsDumperClient.PE.NativePEStructs; +using static KsDumper11.PE.NativePEStructs; -namespace KsDumperClient.PE +namespace KsDumper11.PE { public class PE64Header { diff --git a/KsDumperClient/PE/DOSHeader.cs b/KsDumper11/PE/DOSHeader.cs similarity index 97% rename from KsDumperClient/PE/DOSHeader.cs rename to KsDumper11/PE/DOSHeader.cs index cf7b500..c60b5d2 100644 --- a/KsDumperClient/PE/DOSHeader.cs +++ b/KsDumper11/PE/DOSHeader.cs @@ -1,8 +1,8 @@ using System.IO; -using static KsDumperClient.PE.NativePEStructs; +using static KsDumper11.PE.NativePEStructs; -namespace KsDumperClient.PE +namespace KsDumper11.PE { public class DOSHeader { diff --git a/KsDumperClient/PE/NativePEStructs.cs b/KsDumper11/PE/NativePEStructs.cs similarity index 99% rename from KsDumperClient/PE/NativePEStructs.cs rename to KsDumper11/PE/NativePEStructs.cs index a39285e..090961f 100644 --- a/KsDumperClient/PE/NativePEStructs.cs +++ b/KsDumper11/PE/NativePEStructs.cs @@ -1,7 +1,7 @@ using System; using System.Runtime.InteropServices; -namespace KsDumperClient.PE +namespace KsDumper11.PE { public static class NativePEStructs { diff --git a/KsDumperClient/PE/PEFile.cs b/KsDumper11/PE/PEFile.cs similarity index 98% rename from KsDumperClient/PE/PEFile.cs rename to KsDumper11/PE/PEFile.cs index 368022a..9d4b772 100644 --- a/KsDumperClient/PE/PEFile.cs +++ b/KsDumper11/PE/PEFile.cs @@ -2,7 +2,7 @@ using System.IO; using System.Linq; -namespace KsDumperClient.PE +namespace KsDumper11.PE { public abstract class PEFile { diff --git a/KsDumperClient/PE/PESection.cs b/KsDumper11/PE/PESection.cs similarity index 96% rename from KsDumperClient/PE/PESection.cs rename to KsDumper11/PE/PESection.cs index 2e6028e..f8a256f 100644 --- a/KsDumperClient/PE/PESection.cs +++ b/KsDumper11/PE/PESection.cs @@ -1,8 +1,8 @@ using System.IO; -using static KsDumperClient.PE.NativePEStructs; +using static KsDumper11.PE.NativePEStructs; -namespace KsDumperClient.PE +namespace KsDumper11.PE { public class PESection { diff --git a/KsDumperClient/ProcessDumper.cs b/KsDumper11/ProcessDumper.cs similarity index 98% rename from KsDumperClient/ProcessDumper.cs rename to KsDumper11/ProcessDumper.cs index 1796b98..80ef9f8 100644 --- a/KsDumperClient/ProcessDumper.cs +++ b/KsDumper11/ProcessDumper.cs @@ -1,11 +1,11 @@ using System; using System.Diagnostics; using System.Runtime.InteropServices; -using KsDumperClient.Driver; -using KsDumperClient.PE; -using KsDumperClient.Utility; +using KsDumper11.Driver; +using KsDumper11.PE; +using KsDumper11.Utility; -namespace KsDumperClient +namespace KsDumper11 { // Token: 0x02000003 RID: 3 public class ProcessDumper diff --git a/KsDumperClient/ProcessSummary.cs b/KsDumper11/ProcessSummary.cs similarity index 97% rename from KsDumperClient/ProcessSummary.cs rename to KsDumper11/ProcessSummary.cs index 361345e..28e7945 100644 --- a/KsDumperClient/ProcessSummary.cs +++ b/KsDumper11/ProcessSummary.cs @@ -3,10 +3,10 @@ using System.Diagnostics; using System.IO; using System.Runtime.CompilerServices; using System.Text; -using KsDumperClient.Driver; -using KsDumperClient.Utility; +using KsDumper11.Driver; +using KsDumper11.Utility; -namespace KsDumperClient +namespace KsDumper11 { // Token: 0x02000004 RID: 4 public class ProcessSummary diff --git a/KsDumperClient/Program.cs b/KsDumper11/Program.cs similarity index 97% rename from KsDumperClient/Program.cs rename to KsDumper11/Program.cs index e9ecc45..17d9839 100644 --- a/KsDumperClient/Program.cs +++ b/KsDumper11/Program.cs @@ -3,9 +3,9 @@ using System.Diagnostics; using System.IO; using System.Runtime.CompilerServices; using System.Windows.Forms; -using KsDumperClient.Driver; +using KsDumper11.Driver; -namespace KsDumperClient +namespace KsDumper11 { // Token: 0x02000005 RID: 5 internal static class Program diff --git a/KsDumperClient/Properties/AssemblyInfo.cs b/KsDumper11/Properties/AssemblyInfo.cs similarity index 100% rename from KsDumperClient/Properties/AssemblyInfo.cs rename to KsDumper11/Properties/AssemblyInfo.cs diff --git a/KsDumperClient/Properties/Resources.Designer.cs b/KsDumper11/Properties/Resources.Designer.cs similarity index 95% rename from KsDumperClient/Properties/Resources.Designer.cs rename to KsDumper11/Properties/Resources.Designer.cs index 9f1ea98..c628a47 100644 --- a/KsDumperClient/Properties/Resources.Designer.cs +++ b/KsDumper11/Properties/Resources.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace KsDumperClient.Properties { +namespace KsDumper11.Properties { using System; @@ -39,7 +39,7 @@ namespace KsDumperClient.Properties { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("KsDumperClient.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("KsDumper11.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; diff --git a/KsDumperClient/Properties/Resources.cs b/KsDumper11/Properties/Resources.cs similarity index 100% rename from KsDumperClient/Properties/Resources.cs rename to KsDumper11/Properties/Resources.cs diff --git a/KsDumperClient/Properties/Resources.resources b/KsDumper11/Properties/Resources.resources similarity index 100% rename from KsDumperClient/Properties/Resources.resources rename to KsDumper11/Properties/Resources.resources diff --git a/KsDumperClient/Properties/Resources.resx b/KsDumper11/Properties/Resources.resx similarity index 100% rename from KsDumperClient/Properties/Resources.resx rename to KsDumper11/Properties/Resources.resx diff --git a/KsDumper11/Properties/Settings.Designer.cs b/KsDumper11/Properties/Settings.Designer.cs new file mode 100644 index 0000000..652aaa9 --- /dev/null +++ b/KsDumper11/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace KsDumper11.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/KsDumperClient/Properties/Settings.settings b/KsDumper11/Properties/Settings.settings similarity index 100% rename from KsDumperClient/Properties/Settings.settings rename to KsDumper11/Properties/Settings.settings diff --git a/KsDumperClient/Utility/Logger.cs b/KsDumper11/Utility/Logger.cs similarity index 96% rename from KsDumperClient/Utility/Logger.cs rename to KsDumper11/Utility/Logger.cs index 596ca73..c026179 100644 --- a/KsDumperClient/Utility/Logger.cs +++ b/KsDumper11/Utility/Logger.cs @@ -3,7 +3,7 @@ using System.Diagnostics; using System.Runtime.CompilerServices; using System.Threading; -namespace KsDumperClient.Utility +namespace KsDumper11.Utility { // Token: 0x02000009 RID: 9 public static class Logger diff --git a/KsDumperClient/Utility/MarshalUtility.cs b/KsDumper11/Utility/MarshalUtility.cs similarity index 97% rename from KsDumperClient/Utility/MarshalUtility.cs rename to KsDumper11/Utility/MarshalUtility.cs index 286c46b..4292a03 100644 --- a/KsDumperClient/Utility/MarshalUtility.cs +++ b/KsDumper11/Utility/MarshalUtility.cs @@ -1,7 +1,7 @@ using System; using System.Runtime.InteropServices; -namespace KsDumperClient.Utility +namespace KsDumper11.Utility { // Token: 0x0200000A RID: 10 public static class MarshalUtility diff --git a/KsDumperClient/Utility/ProcessListView.cs b/KsDumper11/Utility/ProcessListView.cs similarity index 99% rename from KsDumperClient/Utility/ProcessListView.cs rename to KsDumper11/Utility/ProcessListView.cs index 147e4f0..8023182 100644 --- a/KsDumperClient/Utility/ProcessListView.cs +++ b/KsDumper11/Utility/ProcessListView.cs @@ -7,7 +7,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows.Forms; -namespace KsDumperClient.Utility +namespace KsDumper11.Utility { // Token: 0x0200000B RID: 11 public class ProcessListView : ListView diff --git a/KsDumperClient/Utility/WinApi.cs b/KsDumper11/Utility/WinApi.cs similarity index 98% rename from KsDumperClient/Utility/WinApi.cs rename to KsDumper11/Utility/WinApi.cs index 4e43b1e..042d6ae 100644 --- a/KsDumperClient/Utility/WinApi.cs +++ b/KsDumper11/Utility/WinApi.cs @@ -3,7 +3,7 @@ using System.IO; using System.Runtime.InteropServices; using System.Text; -namespace KsDumperClient.Utility +namespace KsDumper11.Utility { // Token: 0x02000008 RID: 8 public static class WinApi diff --git a/KsDumperClient/app.config b/KsDumper11/app.config similarity index 100% rename from KsDumperClient/app.config rename to KsDumper11/app.config diff --git a/KsDumperClient/app.manifest b/KsDumper11/app.manifest similarity index 100% rename from KsDumperClient/app.manifest rename to KsDumper11/app.manifest diff --git a/KsDumper11/icons8-crossed-axes-100.png b/KsDumper11/icons8-crossed-axes-100.png new file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tSwfU+Jy+`(H8Vp(x zr?QmVvq!Q=LLuH5m6QFd5L*TS-%r+%-ak%&#^xx%KRYTBJA%d#Q+i+p?z3k!NRuKm=^x~)iwi^ktp3|_P2DV)1QiXnH}8pyFFjen5_ zgHT~26OVAqdO?Jd1vY@KH@5Vqw&G88hd8;rwU8s0k`v%y@`71 z&t)h$N{@P9ZU1c|lzcF<*Y38rd&BI^zS}OJ0iQVU;=3>%YH-0itfOzj$z*E)1_>XUcZC4dS@>>2MU6 zdC1Wz^$W&@UjLGz*Kd=qr1c4wz3;T_}YOqsRar?T$fNq>G|A)gs+ zM)Mf)A9ldlk?_9$zhWT9Z!w98Wk*Yx98CT<>0uB4E!Ed=IX3_4q_bI?edhzH6norx zWFY@lW<9*gOa5G4LSkhR&&-b}iop5s@?zs(fuFA?$gZN0$cW2!+j5*TFwl-jUP1KE z)VziJC%J_ zQd=brk;`|PqgMB978`D3MFR{yPbB=fX4lYrMONn>Ym^4#5F~^$>eOK^Sa)1ELXxt3 zuE?rHgtB{?*QIq9(sS(+<+qlo#`b?zL8H#;ZJ3%Ld~rNo5C1Vq08`Ocu7JYB{s$)m BJ465g literal 0 HcmV?d00001 diff --git a/KsDumperClient/Properties/Settings.Designer.cs b/KsDumperClient/Properties/Settings.Designer.cs deleted file mode 100644 index 865e1c2..0000000 --- a/KsDumperClient/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.CodeDom.Compiler; -using System.Configuration; -using System.Runtime.CompilerServices; - -namespace KsDumperClient.Properties -{ - // Token: 0x02000007 RID: 7 - [CompilerGenerated] - [GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0")] - internal sealed partial class Settings : ApplicationSettingsBase - { - // Token: 0x1700000C RID: 12 - // (get) Token: 0x06000052 RID: 82 RVA: 0x000044A8 File Offset: 0x000026A8 - public static Settings Default - { - get - { - return Settings.defaultInstance; - } - } - - // Token: 0x04000035 RID: 53 - private static Settings defaultInstance = (Settings)SettingsBase.Synchronized(new Settings()); - } -} diff --git a/README.md b/README.md index 5793940..e715fe0 100644 --- a/README.md +++ b/README.md @@ -1 +1,51 @@ # KsDumper-11 +# KsDumper +![Demo](https://i.imgur.com/6XyMDxa.gif) +^New Demo gif comming soon + +## Features +- Auto dumping of selected exe. +- Auto Refresh (every 100ms) +- Suspend, resume, kill process +- Dump any process main module using a kernel driver (both x86 and x64) +- Rebuild PE32/PE64 header and sections +- Works on protected system processes & processes with stripped handles (anti-cheats) +- Works on WINDOWS 11, it doesnt crash anymore! +![Dev Channel Insider Build Win 11 Ksdumper](https://cdn.discordapp.com/attachments/1022996250037076047/1066526468831723590/image.png) + +**Note**: Import table isn't rebuilt. + +## Usage +The old way of loading the unsigned ksDumper.sys kernel driver was to use the capcom exploit to map it, this got patched in windows 11. +This one loads the driver with Kernel Driver Utility, or KDU for short. +I could not get the main fork of the program to work when being built from source. + +This one does though. +https://github.com/morelli690/KDU_kernel_bypass_/blob/master/Bin/kdu.exe + +All driver loading is now automated, i plan on putting in a splash screen till the driver loads. +For now, the client wont open until the driver has been loaded, if it fails, it exits. +I tried to build a logger to output kdu's console output to a file, however it writes black always. Known issue + +**Note**: The driver stays loaded until you reboot, so if you close KsDumperClient.exe, you can just reopen it ! +**Note2**: Even though it can dump both x86 & x64 processes, this has to run on x64 Windows. + +## Disclaimer +This project has been made available for informational and educational purposes only. +The driver source is not included because i couldnt ever get it to compile on my system. The source can be found on the original reop. +Considering the nature of this project, it is highly recommended to run it in a `Virtual Environment`. I am not responsible for any crash or damage that could happen to your system. + +**Important**: This tool makes no attempt at hiding itself. If you target protected games, the anti-cheat might flag this as a cheat and ban you after a while. Use a `Virtual Environment` ! + +## References +- https://github.com/hfiref0x/KDU +- https://github.com/morelli690/KDU_kernel_bypass_/blob/master/Bin/kdu.exe +- https://github.com/not-wlan/drvmap +- https://github.com/Zer0Mem0ry/KernelBhop +- https://github.com/NtQuery/Scylla/ +- http://terminus.rewolf.pl/terminus/ +- https://www.unknowncheats.me/ + +## Compile Yourself +- Requires Visual Studio 2022 +- Requires .NET 4.8 \ No newline at end of file