[Feature] Microsoft Store x64 (#130), version 1.0.17.0

This commit is contained in:
Markus Hofknecht 2020-10-19 13:11:41 +02:00
parent 5bb592c066
commit 4ab7755ca7
26 changed files with 68 additions and 34 deletions

View file

@ -41,22 +41,28 @@ namespace SystemTrayMenu.DllImports
}
}
[DllImport("user32.dll")]
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern bool IsIconic(IntPtr hWnd);
[DllImport("user32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll")]
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern uint GetWindowThreadProcessId(IntPtr hWnd, IntPtr ProcessId);
[DllImport("kernel32.dll")]
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern uint GetCurrentThreadId();
[DllImport("user32.dll")]
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern bool AttachThreadInput(uint idAttach, uint idAttachTo, bool fAttach);
[DllImport("user32.dll", SetLastError = true)]
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern bool BringWindowToTop(IntPtr hWnd);
}
}

View file

@ -19,6 +19,7 @@ namespace SystemTrayMenu.DllImports
// 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.Unicode)]
private static extern IntPtr CreatePopupMenu();
}
}

View file

@ -17,7 +17,8 @@ namespace SystemTrayMenu.DllImports
_ = DestroyIcon(hIcon);
}
[DllImport("User32.dll")]
[DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern int DestroyIcon(IntPtr hIcon);
}
}

View file

@ -19,6 +19,7 @@ namespace SystemTrayMenu.DllImports
// The DestroyMenu function destroys the specified menu and frees any memory that the menu occupies.
[DllImport("user32", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern bool DestroyMenu(IntPtr hMenu);
}
}

View file

@ -17,7 +17,8 @@ namespace SystemTrayMenu.DllImports
_ = FindExecutable(lpFile, lpDirectory, lpResult);
}
[DllImport("shell32.dll", CharSet = CharSet.Unicode)]
[DllImport("shell32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern int FindExecutable(string lpFile, string lpDirectory, [Out] StringBuilder lpResult);
}
}

View file

@ -18,6 +18,7 @@ namespace SystemTrayMenu.DllImports
}
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
}
}

View file

@ -17,7 +17,8 @@ namespace SystemTrayMenu.DllImports
return GetDeviceCaps(hdc, nIndex);
}
[DllImport("gdi32.dll")]
[DllImport("gdi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern int GetDeviceCaps(IntPtr hdc, int nIndex);
}
}

View file

@ -40,7 +40,8 @@ namespace SystemTrayMenu.DllImports
/// <param name="i">i.</param>
/// <param name="flags">flags.</param>
/// <returns>IntPtr.</returns>
[DllImport("comctl32")]
[DllImport("comctl32", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern IntPtr ImageList_GetIcon(
IntPtr himl,
int i,

View file

@ -19,6 +19,7 @@ namespace SystemTrayMenu.DllImports
// Determines the default menu item on the specified menu
[DllImport("user32", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern int GetMenuDefaultItem(IntPtr hMenu, bool fByPos, uint gmdiFlags);
}
}

View file

@ -19,7 +19,8 @@ namespace SystemTrayMenu.DllImports
return maxTouches > 0;
}
[DllImport("user32.dll")]
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern int GetSystemMetrics(int nIndex);
}
}

View file

@ -33,18 +33,22 @@ namespace SystemTrayMenu.DllImports
return GetKeyNameText(lParam, lpString, nSize);
}
[DllImport("user32.dll", SetLastError = true)]
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint virtualKeyCode);
[DllImport("user32.dll", SetLastError = true)]
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool UnregisterHotKey(IntPtr hWnd, int id);
[DllImport("user32.dll", SetLastError = true)]
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern uint MapVirtualKey(uint uCode, uint uMapType);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern int GetKeyNameText(uint lParam, [Out] StringBuilder lpString, int nSize);
}
}

View file

@ -40,10 +40,11 @@ namespace SystemTrayMenu.DllImports
return SHAppBarMessage(dwMessage, ref pData);
}
[DllImport("shell32.dll", SetLastError = true)]
[DllImport("shell32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern IntPtr SHAppBarMessage(ABM dwMessage, [In] ref APPBARDATA pData);
[StructLayout(LayoutKind.Sequential)]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
internal struct APPBARDATA
{
public uint cbSize;
@ -54,7 +55,7 @@ namespace SystemTrayMenu.DllImports
public int lParam;
}
[StructLayout(LayoutKind.Sequential)]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
internal struct RECT
{
public int left;

View file

@ -18,7 +18,8 @@ namespace SystemTrayMenu.DllImports
}
// Retrieves the IShellFolder interface for the desktop folder, which is the root of the Shell's namespace.
[DllImport("shell32.dll")]
[DllImport("shell32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern int SHGetDesktopFolder(out IntPtr ppshf);
}
}

View file

@ -29,7 +29,8 @@ namespace SystemTrayMenu.DllImports
uFlags);
}
[DllImport("Shell32.dll", CharSet = CharSet.Unicode)]
[DllImport("Shell32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern IntPtr SHGetFileInfo(
string pszPath,
uint dwFileAttributes,
@ -38,6 +39,7 @@ namespace SystemTrayMenu.DllImports
uint uFlags);
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
internal struct SHFILEINFO
{
public const int NAMESIZE = 80;

View file

@ -18,7 +18,8 @@ namespace SystemTrayMenu.DllImports
return SHGetFolderPath(hwndOwner, nFolder, hToken, dwFlags, lpszPath);
}
[DllImport("shfolder.dll", CharSet = CharSet.Unicode)]
[DllImport("shfolder.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern int SHGetFolderPath(IntPtr hwndOwner, int nFolder, IntPtr hToken, int dwFlags, StringBuilder lpszPath);
}
}

View file

@ -16,7 +16,8 @@ namespace SystemTrayMenu.DllImports
_ = SetProcessDPIAware();
}
[DllImport("user32.dll")]
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern bool SetProcessDPIAware();
}
}

View file

@ -32,7 +32,8 @@ namespace SystemTrayMenu.DllImports
}
}
[DllImport("user32.dll", EntryPoint = "SetWindowPos")]
[DllImport("user32.dll", EntryPoint = "SetWindowPos", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern bool SetWindowPos(
int hWnd, // Window handle
int hWndInsertAfter, // Placement-order handle

View file

@ -12,7 +12,8 @@ namespace SystemTrayMenu.DllImports
/// </summary>
public static partial class NativeMethods
{
[DllImport("user32.dll")]
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
}
}

View file

@ -16,7 +16,8 @@ namespace SystemTrayMenu.DllImports
return StrCmpLogicalW(x, y);
}
[DllImport("shlwapi.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
[DllImport("shlwapi.dll", ExactSpelling = true, SetLastError = true, CharSet = CharSet.Unicode)]
private static extern int StrCmpLogicalW(string x, string y);
}
}

View file

@ -19,7 +19,8 @@ namespace SystemTrayMenu.DllImports
}
// Takes a STRRET structure returned by IShellFolder::GetDisplayNameOf, converts it to a string, and places the result in a buffer.
[DllImport("shlwapi.dll", EntryPoint = "StrRetToBuf", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
[DllImport("shlwapi.dll", EntryPoint = "StrRetToBuf", ExactSpelling = false, SetLastError = true, CharSet = CharSet.Unicode)]
private static extern int StrRetToBuf(IntPtr pstr, IntPtr pidl, StringBuilder pszBuf, int cchBuf);
}
}

View file

@ -54,7 +54,8 @@ namespace SystemTrayMenu.DllImports
}
// 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.Unicode)]
[DllImport("user32.dll", ExactSpelling = true, SetLastError = true, CharSet = CharSet.Unicode)]
private static extern uint TrackPopupMenuEx(IntPtr hmenu, TPM flags, int x, int y, IntPtr hwnd, IntPtr lptpm);
}
}

View file

@ -9,7 +9,7 @@
<Identity
Name="49543SystemTrayMenu.SystemTrayMenu"
Publisher="CN=5884501C-92ED-45DE-9508-9D987C314243"
Version="1.0.16.0" />
Version="1.0.17.0" />
<Properties>
<DisplayName>SystemTrayMenu</DisplayName>

View file

@ -55,7 +55,7 @@
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundlePlatforms>x86</AppxBundlePlatforms>
<AppxBundlePlatforms>x86|x64</AppxBundlePlatforms>
<AppInstallerUri>https://github.com/Hofknecht/SystemTrayMenu/releases</AppInstallerUri>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
</PropertyGroup>

View file

@ -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.0.16.3")]
[assembly: AssemblyFileVersion("1.0.16.3")]
[assembly: AssemblyVersion("1.0.17.0")]
[assembly: AssemblyFileVersion("1.0.17.0")]

View file

@ -127,7 +127,8 @@ namespace SystemTrayMenu.UserInterface.FolderBrowseDialog
uint Compare([In, MarshalAs(UnmanagedType.Interface)] IShellItem psi, [In] uint hint, out int piOrder);
}
[DllImport("shell32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
[DllImport("shell32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern int SHCreateItemFromParsingName(
[MarshalAs(UnmanagedType.LPWStr)] string pszPath,
IntPtr pbc,

View file

@ -1122,7 +1122,7 @@ namespace SystemTrayMenu.Utilities
return oParentFolder;
}
[StructLayout(LayoutKind.Sequential)]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
private struct CWPSTRUCT
{
public IntPtr Lparam;
@ -1133,6 +1133,7 @@ namespace SystemTrayMenu.Utilities
// Contains extended information about a shortcut menu command
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
private struct CMINVOKECOMMANDINFOEX
{
public int CbSize;
@ -1160,6 +1161,7 @@ namespace SystemTrayMenu.Utilities
// Contains information about a menu item
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
private struct MENUITEMINFO
{
private readonly int cbSize;
@ -1195,7 +1197,7 @@ namespace SystemTrayMenu.Utilities
// A generalized global memory handle used for data transfer operations by the
// IAdviseSink, IDataObject, and IOleCache interfaces
[StructLayout(LayoutKind.Sequential)]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
private struct STGMEDIUM
{
public TYMED Tymed;
@ -1211,6 +1213,7 @@ namespace SystemTrayMenu.Utilities
// Defines the x- and y-coordinates of a point
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
private struct POINT
{
public int X;