From 61196e507f627fa02fbd0e5df1a2b0c26ccec341 Mon Sep 17 00:00:00 2001 From: Markus Hofknecht Date: Sat, 11 Apr 2020 19:32:52 +0200 Subject: [PATCH] #10, #80, version 0.9.2.20 --- NativeDllImport/BringWindowToTop.cs | 2 +- NativeDllImport/CreatePopupMenu.cs | 2 +- NativeDllImport/DestroyMenu.cs | 2 +- NativeDllImport/GetMenuDefaultItem.cs | 2 +- NativeDllImport/TrackPopupMenuEx.cs | 2 +- UserInterface/ShellContextMenu/ShellContextMenu.cs | 4 ++-- Utilities/File/FileLnk.cs | 2 +- Utilities/FolderOptions.cs | 1 - 8 files changed, 8 insertions(+), 9 deletions(-) diff --git a/NativeDllImport/BringWindowToTop.cs b/NativeDllImport/BringWindowToTop.cs index 9e37730..32afeb0 100644 --- a/NativeDllImport/BringWindowToTop.cs +++ b/NativeDllImport/BringWindowToTop.cs @@ -8,7 +8,7 @@ namespace SystemTrayMenu.DllImports [DllImport("user32.dll")] private static extern bool IsIconic(IntPtr hWnd); - [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [DllImport("user32.dll", CharSet = CharSet.Unicode, SetLastError = true)] private static extern IntPtr GetForegroundWindow(); [DllImport("user32.dll")] diff --git a/NativeDllImport/CreatePopupMenu.cs b/NativeDllImport/CreatePopupMenu.cs index 0df9623..476455d 100644 --- a/NativeDllImport/CreatePopupMenu.cs +++ b/NativeDllImport/CreatePopupMenu.cs @@ -6,7 +6,7 @@ namespace SystemTrayMenu.DllImports public static partial class NativeMethods { // The CreatePopupMenu function creates a drop-down menu, submenu, or shortcut menu. The menu is initially empty. You can insert or append menu items by using the InsertMenuItem function. You can also use the InsertMenu function to insert menu items and the AppendMenu function to append menu items. - [DllImport("user32", SetLastError = true, CharSet = CharSet.Auto)] + [DllImport("user32", SetLastError = true, CharSet = CharSet.Unicode)] private static extern IntPtr CreatePopupMenu(); public static IntPtr User32CreatePopupMenu() diff --git a/NativeDllImport/DestroyMenu.cs b/NativeDllImport/DestroyMenu.cs index d908d23..d8a3d90 100644 --- a/NativeDllImport/DestroyMenu.cs +++ b/NativeDllImport/DestroyMenu.cs @@ -6,7 +6,7 @@ namespace SystemTrayMenu.DllImports public static partial class NativeMethods { // The DestroyMenu function destroys the specified menu and frees any memory that the menu occupies. - [DllImport("user32", SetLastError = true, CharSet = CharSet.Auto)] + [DllImport("user32", SetLastError = true, CharSet = CharSet.Unicode)] private static extern bool DestroyMenu(IntPtr hMenu); public static bool User32DestroyMenu(IntPtr hMenu) diff --git a/NativeDllImport/GetMenuDefaultItem.cs b/NativeDllImport/GetMenuDefaultItem.cs index f9fd5d1..268f9ea 100644 --- a/NativeDllImport/GetMenuDefaultItem.cs +++ b/NativeDllImport/GetMenuDefaultItem.cs @@ -6,7 +6,7 @@ namespace SystemTrayMenu.DllImports public static partial class NativeMethods { // Determines the default menu item on the specified menu - [DllImport("user32", SetLastError = true, CharSet = CharSet.Auto)] + [DllImport("user32", SetLastError = true, CharSet = CharSet.Unicode)] private static extern int GetMenuDefaultItem(IntPtr hMenu, bool fByPos, uint gmdiFlags); public static int User32GetMenuDefaultItem(IntPtr hMenu, bool fByPos, uint gmdiFlags) diff --git a/NativeDllImport/TrackPopupMenuEx.cs b/NativeDllImport/TrackPopupMenuEx.cs index 2e39eab..3a0416d 100644 --- a/NativeDllImport/TrackPopupMenuEx.cs +++ b/NativeDllImport/TrackPopupMenuEx.cs @@ -6,7 +6,7 @@ namespace SystemTrayMenu.DllImports public static partial class NativeMethods { // The TrackPopupMenuEx function displays a shortcut menu at the specified location and tracks the selection of items on the shortcut menu. The shortcut menu can appear anywhere on the screen. - [DllImport("user32.dll", ExactSpelling = true, CharSet = CharSet.Auto)] + [DllImport("user32.dll", ExactSpelling = true, CharSet = CharSet.Unicode)] private static extern uint TrackPopupMenuEx(IntPtr hmenu, TPM flags, int x, int y, IntPtr hwnd, IntPtr lptpm); internal static uint User32TrackPopupMenuEx(IntPtr hmenu, TPM flags, int x, int y, IntPtr hwnd, IntPtr lptpm) diff --git a/UserInterface/ShellContextMenu/ShellContextMenu.cs b/UserInterface/ShellContextMenu/ShellContextMenu.cs index 3356687..ab97e32 100644 --- a/UserInterface/ShellContextMenu/ShellContextMenu.cs +++ b/UserInterface/ShellContextMenu/ShellContextMenu.cs @@ -656,7 +656,7 @@ namespace SystemTrayMenu.Utilities } // Contains information about a menu item - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] private struct MENUITEMINFO { public MENUITEMINFO(string text) @@ -707,7 +707,7 @@ namespace SystemTrayMenu.Utilities } // Defines the x- and y-coordinates of a point - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] private struct POINT { public POINT(int x, int y) diff --git a/Utilities/File/FileLnk.cs b/Utilities/File/FileLnk.cs index a1bc1df..3c80f13 100644 --- a/Utilities/File/FileLnk.cs +++ b/Utilities/File/FileLnk.cs @@ -18,7 +18,7 @@ namespace SystemTrayMenu.Utilities SLGP_RAWPATH = 0x4 } - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] private struct WIN32_FIND_DATAW { public uint dwFileAttributes; diff --git a/Utilities/FolderOptions.cs b/Utilities/FolderOptions.cs index 5872ee1..6d3dd11 100644 --- a/Utilities/FolderOptions.cs +++ b/Utilities/FolderOptions.cs @@ -56,7 +56,6 @@ namespace SystemTrayMenu.Utilities internal static bool IsHidden(string path, ref bool hiddenEntry) { bool isDirectoryToHide = false; -#warning #80 if (path.Length < 260) { FileAttributes attributes = File.GetAttributes(path);