diff --git a/Config/AppColors.cs b/Config/AppColors.cs index 146cd75..9ffdaf8 100644 --- a/Config/AppColors.cs +++ b/Config/AppColors.cs @@ -88,10 +88,6 @@ namespace SystemTrayMenu public static Bitmap BitmapSearch { get; set; } - public static Bitmap BitmapFoldersCount { get; set; } - - public static Bitmap BitmapFilesCount { get; set; } - public static Color Icons { get; set; } public static Color DarkModeIcons { get; set; } diff --git a/Config/Config.cs b/Config/Config.cs index b1acbc6..a433446 100644 --- a/Config/Config.cs +++ b/Config/Config.cs @@ -46,8 +46,6 @@ namespace SystemTrayMenu AppColors.BitmapSettings.Dispose(); AppColors.BitmapRestart.Dispose(); AppColors.BitmapSearch.Dispose(); - AppColors.BitmapFoldersCount.Dispose(); - AppColors.BitmapFilesCount.Dispose(); } public static Icon GetAppIcon() @@ -242,8 +240,6 @@ namespace SystemTrayMenu AppColors.BitmapRestart = ReadSvg(Properties.Resources.ic_fluent_arrow_sync_24_regular, htmlColorCodeIcons); AppColors.BitmapPinActive = ReadSvg(Properties.Resources.ic_fluent_pin_48_filled, htmlColorCodeIcons); AppColors.BitmapSearch = ReadSvg(Properties.Resources.ic_fluent_search_48_regular, htmlColorCodeIcons); - AppColors.BitmapFoldersCount = ReadSvg(Properties.Resources.ic_fluent_folder_48_regular, htmlColorCodeIcons); - AppColors.BitmapFilesCount = ReadSvg(Properties.Resources.ic_fluent_document_48_regular, htmlColorCodeIcons); colorAndCode.HtmlColorCode = Settings.Default.ColorSearchField; colorAndCode.Color = Color.FromArgb(255, 255, 255); diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 4afadc4..d9ff304 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -39,5 +39,5 @@ using System.Runtime.InteropServices; // 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.1.2.2")] -[assembly: AssemblyFileVersion("1.1.2.2")] +[assembly: AssemblyVersion("1.1.2.3")] +[assembly: AssemblyFileVersion("1.1.2.3")] diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index 28bfba8..3059eaf 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.42000 +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -13,12 +13,12 @@ namespace SystemTrayMenu.Properties { /// - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// A strongly-typed resource class, for looking up localized strings, etc. /// - // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert - // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. - // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen - // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + // 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()] @@ -33,7 +33,7 @@ namespace SystemTrayMenu.Properties { } /// - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Resources.ResourceManager ResourceManager { @@ -47,8 +47,8 @@ namespace SystemTrayMenu.Properties { } /// - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// 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)] public static global::System.Globalization.CultureInfo Culture { @@ -61,7 +61,7 @@ namespace SystemTrayMenu.Properties { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + /// Looks up a localized resource of type System.Byte[]. /// public static byte[] ic_fluent_arrow_sync_24_regular { get { @@ -71,27 +71,7 @@ namespace SystemTrayMenu.Properties { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. - /// - public static byte[] ic_fluent_document_48_regular { - get { - object obj = ResourceManager.GetObject("ic_fluent_document_48_regular", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. - /// - public static byte[] ic_fluent_folder_48_regular { - get { - object obj = ResourceManager.GetObject("ic_fluent_folder_48_regular", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + /// Looks up a localized resource of type System.Byte[]. /// public static byte[] ic_fluent_folder_arrow_right_48_regular { get { @@ -101,7 +81,7 @@ namespace SystemTrayMenu.Properties { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + /// Looks up a localized resource of type System.Byte[]. /// public static byte[] ic_fluent_pin_48_filled { get { @@ -111,7 +91,7 @@ namespace SystemTrayMenu.Properties { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + /// Looks up a localized resource of type System.Byte[]. /// public static byte[] ic_fluent_pin_48_regular { get { @@ -121,7 +101,7 @@ namespace SystemTrayMenu.Properties { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + /// Looks up a localized resource of type System.Byte[]. /// public static byte[] ic_fluent_search_48_regular { get { @@ -131,7 +111,7 @@ namespace SystemTrayMenu.Properties { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + /// Looks up a localized resource of type System.Byte[]. /// public static byte[] ic_fluent_settings_28_regular { get { @@ -141,7 +121,7 @@ namespace SystemTrayMenu.Properties { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol). + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// public static System.Drawing.Icon Loading { get { @@ -151,7 +131,7 @@ namespace SystemTrayMenu.Properties { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol). + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// public static System.Drawing.Icon NotFound { get { @@ -161,7 +141,7 @@ namespace SystemTrayMenu.Properties { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol). + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// public static System.Drawing.Icon SystemTrayMenu { get { @@ -171,7 +151,7 @@ namespace SystemTrayMenu.Properties { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol). + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// public static System.Drawing.Icon White50Percentage { get { diff --git a/Properties/Resources.resx b/Properties/Resources.resx index 2e6c21c..f576e12 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -130,15 +130,9 @@ ..\Resources\ic_fluent_pin_48_regular.svg;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Resources\ic_fluent_folder_48_regular.svg;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ..\Resources\ic_fluent_search_48_regular.svg;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Resources\ic_fluent_document_48_regular.svg;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ..\Resources\ic_fluent_folder_arrow_right_48_regular.svg;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 diff --git a/Resources/ic_fluent_document_48_regular.svg b/Resources/ic_fluent_document_48_regular.svg deleted file mode 100644 index 0d336c0..0000000 --- a/Resources/ic_fluent_document_48_regular.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/Resources/ic_fluent_folder_48_regular.svg b/Resources/ic_fluent_folder_48_regular.svg deleted file mode 100644 index f25055f..0000000 --- a/Resources/ic_fluent_folder_48_regular.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/Resources/lang.Designer.cs b/Resources/lang.Designer.cs index 957a408..9a6a629 100644 --- a/Resources/lang.Designer.cs +++ b/Resources/lang.Designer.cs @@ -366,6 +366,24 @@ namespace SystemTrayMenu.Resources { } } + /// + /// Looks up a localized string similar to item. + /// + internal static string element { + get { + return ResourceManager.GetString("element", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to items. + /// + internal static string elements { + get { + return ResourceManager.GetString("elements", resourceCulture); + } + } + /// /// Looks up a localized string similar to Exit. /// @@ -492,24 +510,6 @@ namespace SystemTrayMenu.Resources { } } - /// - /// Looks up a localized string similar to Item. - /// - internal static string Item { - get { - return ResourceManager.GetString("Item", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Items. - /// - internal static string Items { - get { - return ResourceManager.GetString("Items", resourceCulture); - } - } - /// /// Looks up a localized string similar to Language. /// @@ -944,15 +944,6 @@ namespace SystemTrayMenu.Resources { } } - /// - /// Looks up a localized string similar to Title. - /// - internal static string Title { - get { - return ResourceManager.GetString("Title", resourceCulture); - } - } - /// /// Looks up a localized string similar to USB. /// @@ -970,14 +961,5 @@ namespace SystemTrayMenu.Resources { return ResourceManager.GetString("Use icon from folder", resourceCulture); } } - - /// - /// Looks up a localized string similar to Warning. - /// - internal static string Warning { - get { - return ResourceManager.GetString("Warning", resourceCulture); - } - } } } diff --git a/Resources/lang.cs-CZ.resx b/Resources/lang.cs-CZ.resx index 9debecc..f9e63bb 100644 --- a/Resources/lang.cs-CZ.resx +++ b/Resources/lang.cs-CZ.resx @@ -180,9 +180,6 @@ Přečtěte si časté dotazy a poté vyberte kořenový adresář pro SystemTrayMenu. - - Varování - Vybrat složku @@ -255,9 +252,6 @@ Okraj vybrané položky - - Titul - Změnit na relativní složku @@ -417,4 +411,10 @@ Vlastní (přetáhněte jej na příslušné místo) + + živel + + + elementy + \ No newline at end of file diff --git a/Resources/lang.de-DE.resx b/Resources/lang.de-DE.resx index 64cf744..e54a51f 100644 --- a/Resources/lang.de-DE.resx +++ b/Resources/lang.de-DE.resx @@ -180,9 +180,6 @@ Lese das FAQ und wähle anschließend ein root Verzeichniss für die SystemTrayMenu. - - Warnung - Ordner auswählen @@ -255,9 +252,6 @@ Rand des ausgewählten Elements - - Titel - Zum relativen Ordner ändern @@ -417,4 +411,10 @@ Benutzerdefiniert (an die entsprechende Stelle ziehen) + + Element + + + Elemente + \ No newline at end of file diff --git a/Resources/lang.es-ES.resx b/Resources/lang.es-ES.resx index 5a49736..dafb98f 100644 --- a/Resources/lang.es-ES.resx +++ b/Resources/lang.es-ES.resx @@ -180,9 +180,6 @@ Lea las preguntas frecuentes y luego elija un directorio raíz para SystemTrayMenu. - - Advertencia - Seleccione la carpeta @@ -255,9 +252,6 @@ Borde del elemento seleccionado - - Título - Cambiar a carpeta relativa @@ -417,4 +411,10 @@ Personalizado (arrástrelo al lugar apropiado) + + elemento + + + elementos + \ No newline at end of file diff --git a/Resources/lang.fa-IR.resx b/Resources/lang.fa-IR.resx index 8536402..4f15d23 100644 --- a/Resources/lang.fa-IR.resx +++ b/Resources/lang.fa-IR.resx @@ -180,9 +180,6 @@ سوالات متداول را بخوانید و سپس یک دایرکتوری ریشه برای SystemTrayMenu انتخاب کنید. - - هشدار - پوشه را انتخاب کنید @@ -255,9 +252,6 @@ حاشیه مورد انتخاب شده - - عنوان - به پوشه نسبی تغییر دهید @@ -417,4 +411,10 @@ سفارشی (آن را به مکان مناسب بکشید) + + عنصر + + + عناصر + \ No newline at end of file diff --git a/Resources/lang.fr-FR.resx b/Resources/lang.fr-FR.resx index adadb55..016a149 100644 --- a/Resources/lang.fr-FR.resx +++ b/Resources/lang.fr-FR.resx @@ -180,9 +180,6 @@ Lire la FAQ pour choisir le répertoire des raccourcis pour SystemTrayMenu. - - Attention - Choisir le répertoire @@ -255,9 +252,6 @@ Bordure de l'élément sélectionné - - Titre - Passer au dossier relatif @@ -417,4 +411,10 @@ Personnalisé (faites-le glisser à l'endroit approprié) + + élément + + + éléments + \ No newline at end of file diff --git a/Resources/lang.it-IT.resx b/Resources/lang.it-IT.resx index 48def64..af8d3c2 100644 --- a/Resources/lang.it-IT.resx +++ b/Resources/lang.it-IT.resx @@ -180,9 +180,6 @@ Leggere le domande frequenti e quindi scegliere una directory principale per SystemTrayMenu. - - Avvertimento - Seleziona cartella @@ -255,9 +252,6 @@ Bordo dell'elemento selezionato - - Titolo - Passa alla cartella relativa @@ -417,4 +411,10 @@ Personalizzato (trascinalo nella posizione appropriata) + + elemento + + + elementi + \ No newline at end of file diff --git a/Resources/lang.ja-JP.resx b/Resources/lang.ja-JP.resx index a3d8810..b6aae48 100644 --- a/Resources/lang.ja-JP.resx +++ b/Resources/lang.ja-JP.resx @@ -180,9 +180,6 @@ よくある質問を読み、SystemTrayMenu のルート ディレクトリを選択します。 - - 警告 - フォルダーを選択 @@ -255,9 +252,6 @@ 選択したアイテムの境界 - - 題名 - 相対フォルダに変更 @@ -417,4 +411,10 @@ カスタム(適切な場所にドラッグ) + + エレメント + + + 要素 + \ No newline at end of file diff --git a/Resources/lang.ko-KR.resx b/Resources/lang.ko-KR.resx index 4bd95f5..0e011d4 100644 --- a/Resources/lang.ko-KR.resx +++ b/Resources/lang.ko-KR.resx @@ -180,9 +180,6 @@ FAQ를 읽고 SystemTrayMenu의 루트 디렉토리를 선택하십시오. - - 경고 - 폴더 선택 @@ -255,9 +252,6 @@ 선택한 항목의 테두리 - - 표제 - 상대 폴더로 변경 @@ -417,4 +411,10 @@ 사용자 지정(적절한 위치로 드래그) + + 요소 + + + 집단 + \ No newline at end of file diff --git a/Resources/lang.nl-NL.resx b/Resources/lang.nl-NL.resx index 816565c..6576a72 100644 --- a/Resources/lang.nl-NL.resx +++ b/Resources/lang.nl-NL.resx @@ -180,9 +180,6 @@ Lees de FAQ en kies dan een hoofdmap voor het SystemTrayMenu. - - Waarschuwing - Selecteer Map @@ -255,9 +252,6 @@ Rand van geselecteerde item - - Titel - Verander naar de relatieve map @@ -417,4 +411,10 @@ Aangepast (sleep het naar de juiste plaats) + + element + + + elementen + \ No newline at end of file diff --git a/Resources/lang.pt-BR.resx b/Resources/lang.pt-BR.resx index 7a76e5e..61d50a1 100644 --- a/Resources/lang.pt-BR.resx +++ b/Resources/lang.pt-BR.resx @@ -180,9 +180,6 @@ Leia as Perguntas Frequentes e então escolha uma pasta raiz para o SystemTrayMenu. - - Aviso - Selecionar Pasta @@ -255,9 +252,6 @@ Borda do item selecionado - - Título - Mudar para a pasta relativa @@ -417,4 +411,10 @@ Personalizado (arraste-o para o local apropriado) + + elemento + + + elementos + \ No newline at end of file diff --git a/Resources/lang.resx b/Resources/lang.resx index 9830e56..abe6a41 100644 --- a/Resources/lang.resx +++ b/Resources/lang.resx @@ -180,9 +180,6 @@ Read the FAQ and then choose a root directory for the SystemTrayMenu. - - Warning - Select Folder @@ -255,9 +252,6 @@ Border of selected item - - Title - Change to relative folder @@ -417,10 +411,10 @@ Custom (drag it to the appropriate place) - - Item + + item - - Items + + items \ No newline at end of file diff --git a/Resources/lang.ru-RU.resx b/Resources/lang.ru-RU.resx index f184057..b300f2e 100644 --- a/Resources/lang.ru-RU.resx +++ b/Resources/lang.ru-RU.resx @@ -180,9 +180,6 @@ Прочтите FAQ, а затем выберите корневой каталог для SystemTrayMenu. - - Предупреждение - Выберите папку @@ -255,9 +252,6 @@ Граница выбранного объекта - - Заголовок - Перейти в относительную папку @@ -417,4 +411,10 @@ Пользовательский (перетащите в соответствующее место) + + элемент + + + элементы + \ No newline at end of file diff --git a/Resources/lang.tr-TR.resx b/Resources/lang.tr-TR.resx index 943c0bf..f8cc7fd 100644 --- a/Resources/lang.tr-TR.resx +++ b/Resources/lang.tr-TR.resx @@ -180,9 +180,6 @@ SSS bölümünü okuyun ve ardından SystemTrayMenu için bir kök dizin seçin. - - Uyarı - Klasör Seç @@ -255,9 +252,6 @@ Seçili öğenin kenarlığı - - Başlık - Göreli klasöre geç @@ -417,4 +411,10 @@ Özel (uygun yere sürükleyin) + + eleman + + + elementler + \ No newline at end of file diff --git a/Resources/lang.vi-VN.resx b/Resources/lang.vi-VN.resx index 1fc8373..59220ce 100644 --- a/Resources/lang.vi-VN.resx +++ b/Resources/lang.vi-VN.resx @@ -180,9 +180,6 @@ Đọc Câu hỏi thường gặp và sau đó chọn một thư mục gốc cho SystemTrayMenu. - - Cảnh báo - Chọn thư mục @@ -255,9 +252,6 @@ Đường viền của mục đã chọn - - Tiêu đề - Thay đổi thành thư mục tương đối @@ -417,4 +411,10 @@ Tùy chỉnh (kéo nó đến vị trí thích hợp) + + thành phần + + + các yếu tố + \ No newline at end of file diff --git a/Resources/lang.zh-CN.resx b/Resources/lang.zh-CN.resx index 905dc2e..6586b96 100644 --- a/Resources/lang.zh-CN.resx +++ b/Resources/lang.zh-CN.resx @@ -180,9 +180,6 @@ 阅读常见问题,然后为 SystemTrayMenu 选择一个根目录。 - - 警告 - 选择文件夹 @@ -255,9 +252,6 @@ 所选项目的边框 - - 标题 - 切换到相对文件夹 @@ -417,4 +411,10 @@ 自定义(拖动到合适的地方) + + 元素 + + + 元素 + \ No newline at end of file diff --git a/UserInterface/Menu.cs b/UserInterface/Menu.cs index 7367d6e..8242633 100644 --- a/UserInterface/Menu.cs +++ b/UserInterface/Menu.cs @@ -557,11 +557,11 @@ namespace SystemTrayMenu.UserInterface labelFilesCount.Text = filesAndFoldersCount.ToString(); if (filesAndFoldersCount == 1) { - labelItems.Text = Translator.GetText("Item"); + labelItems.Text = Translator.GetText("element"); } else { - labelItems.Text = Translator.GetText("Items"); + labelItems.Text = Translator.GetText("elements"); } } @@ -936,18 +936,6 @@ namespace SystemTrayMenu.UserInterface e.Graphics.DrawImage(AppColors.BitmapSearch, new Rectangle(Point.Empty, pictureBox.ClientSize)); } - private void PictureBoxFoldersCount_Paint(object sender, PaintEventArgs e) - { - PictureBox pictureBox = (PictureBox)sender; - e.Graphics.DrawImage(AppColors.BitmapFoldersCount, new Rectangle(Point.Empty, pictureBox.ClientSize)); - } - - private void PictureBoxFilesCount_Paint(object sender, PaintEventArgs e) - { - PictureBox pictureBox = (PictureBox)sender; - e.Graphics.DrawImage(AppColors.BitmapFilesCount, new Rectangle(Point.Empty, pictureBox.ClientSize)); - } - private void LoadingMenu_Paint(object sender, PaintEventArgs e) { PictureBox pictureBox = (PictureBox)sender; diff --git a/UserInterface/PerPixelAlphaBlend.cs b/UserInterface/PerPixelAlphaBlend.cs deleted file mode 100644 index a6ce4f1..0000000 --- a/UserInterface/PerPixelAlphaBlend.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) PlaceholderCompany. All rights reserved. -// - -namespace SystemTrayMenu.UserInterface -{ - using System; - using System.Drawing; - using System.Drawing.Imaging; - - internal static class PerPixelAlphaBlend - { - public static void SetBitmap(Bitmap bitmap, int left, int top, IntPtr handle, double opacityInPercentage) - { - int opacity = (int)(opacityInPercentage * 255); - SetBitmap(bitmap, (byte)opacity, left, top, handle); - } - - public static void SetBitmap(Bitmap bitmap, byte opacity, int left, int top, IntPtr handle) - { - if (bitmap.PixelFormat != PixelFormat.Format32bppArgb) - { - throw new ApplicationException("The bitmap must be 32ppp with alpha-channel."); - } - - IntPtr screenDc = Win32.GetDC(IntPtr.Zero); - IntPtr memDc = Win32.CreateCompatibleDC(screenDc); - IntPtr hBitmap = IntPtr.Zero; - IntPtr oldBitmap = IntPtr.Zero; - - try - { - hBitmap = bitmap.GetHbitmap(Color.FromArgb(0)); - oldBitmap = Win32.SelectObject(memDc, hBitmap); - - Win32.Size size = new(bitmap.Width, bitmap.Height); - Win32.Point pointSource = new(0, 0); - Win32.Point topPos = new(left, top); - Win32.BLENDFUNCTION blend = new(); - blend.BlendOp = Win32.AC_SRC_OVER; - blend.BlendFlags = 0; - blend.SourceConstantAlpha = opacity; - blend.AlphaFormat = Win32.AC_SRC_ALPHA; - - Win32.UpdateLayeredWindow(handle, screenDc, ref topPos, ref size, memDc, ref pointSource, 0, ref blend, Win32.ULW_ALPHA); - } - finally - { - Win32.ReleaseDC(IntPtr.Zero, screenDc); - if (hBitmap != IntPtr.Zero) - { - Win32.SelectObject(memDc, oldBitmap); - Win32.DeleteObject(hBitmap); - } - - Win32.DeleteDC(memDc); - } - } - } -} diff --git a/UserInterface/RoundedRectangle.cs b/UserInterface/RoundedRectangle.cs deleted file mode 100644 index 10f557a..0000000 --- a/UserInterface/RoundedRectangle.cs +++ /dev/null @@ -1,73 +0,0 @@ -// -// Copyright (c) PlaceholderCompany. All rights reserved. -// - -namespace SystemTrayMenu.UserInterface -{ - using System; - using System.Data; - using System.Drawing; - using System.Drawing.Drawing2D; - using System.Drawing.Imaging; - using System.Globalization; - using System.Reflection; - using System.Runtime.InteropServices; - using System.Windows.Forms; - using SystemTrayMenu.DataClasses; - using SystemTrayMenu.DllImports; - using SystemTrayMenu.Helper; - using SystemTrayMenu.Utilities; - - public static class RoundedRectangle - { - public static GraphicsPath RoundedRect(Rectangle bounds, int radius) - { - int diameter = radius * 2; - Size size = new(diameter, diameter); - Rectangle arc = new(bounds.Location, size); - GraphicsPath path = new(); - - 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; - } - - public static void FillRoundedRectangle(Graphics graphics, Brush brush, Rectangle bounds, int cornerRadius) - { - if (graphics == null) - { - throw new ArgumentNullException("graphics"); - } - - if (brush == null) - { - throw new ArgumentNullException("brush"); - } - - using (GraphicsPath path = RoundedRect(bounds, cornerRadius)) - { - graphics.FillPath(brush, path); - } - } - } -} diff --git a/UserInterface/Win32.cs b/UserInterface/Win32.cs deleted file mode 100644 index 2f65c77..0000000 --- a/UserInterface/Win32.cs +++ /dev/null @@ -1,99 +0,0 @@ -// -// Copyright (c) PlaceholderCompany. All rights reserved. -// - -namespace SystemTrayMenu.UserInterface -{ - using System; - using System.Data; - using System.Drawing; - using System.Drawing.Drawing2D; - using System.Drawing.Imaging; - using System.Globalization; - using System.Reflection; - using System.Runtime.InteropServices; - using System.Windows.Forms; - using SystemTrayMenu.DataClasses; - using SystemTrayMenu.DllImports; - using SystemTrayMenu.Helper; - using SystemTrayMenu.Utilities; - - internal class Win32 - { - public enum Bool - { - False = 0, - True - }; - - - [StructLayout(LayoutKind.Sequential)] - public struct Point - { - public Int32 x; - public Int32 y; - - public Point(Int32 x, Int32 y) { this.x = x; this.y = y; } - } - - - [StructLayout(LayoutKind.Sequential)] - public struct Size - { - public Int32 cx; - public Int32 cy; - - public Size(Int32 cx, Int32 cy) { this.cx = cx; this.cy = cy; } - } - - - [StructLayout(LayoutKind.Sequential, Pack = 1)] - struct ARGB - { - public byte Blue; - public byte Green; - public byte Red; - public byte Alpha; - } - - - [StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct BLENDFUNCTION - { - public byte BlendOp; - public byte BlendFlags; - public byte SourceConstantAlpha; - public byte AlphaFormat; - } - - - public const Int32 ULW_COLORKEY = 0x00000001; - public const Int32 ULW_ALPHA = 0x00000002; - public const Int32 ULW_OPAQUE = 0x00000004; - - public const byte AC_SRC_OVER = 0x00; - public const byte AC_SRC_ALPHA = 0x01; - - - [DllImport("user32.dll", ExactSpelling = true, SetLastError = true)] - public static extern Bool UpdateLayeredWindow(IntPtr hwnd, IntPtr hdcDst, ref Point pptDst, ref Size psize, IntPtr hdcSrc, ref Point pprSrc, Int32 crKey, ref BLENDFUNCTION pblend, Int32 dwFlags); - - [DllImport("user32.dll", ExactSpelling = true, SetLastError = true)] - public static extern IntPtr GetDC(IntPtr hWnd); - - [DllImport("user32.dll", ExactSpelling = true)] - public static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC); - - [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)] - public static extern IntPtr CreateCompatibleDC(IntPtr hDC); - - [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)] - public static extern Bool DeleteDC(IntPtr hdc); - - [DllImport("gdi32.dll", ExactSpelling = true)] - public static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObject); - - [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)] - public static extern Bool DeleteObject(IntPtr hObject); - } -}