mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Get context menu string by id instead of index
This commit is contained in:
parent
922cbbe92c
commit
e97964b95c
1 changed files with 5 additions and 11 deletions
|
|
@ -315,16 +315,6 @@ public static class ShellContextMenuDisplayHelper
|
|||
|
||||
for (uint i = 0; i < menuCount; i++)
|
||||
{
|
||||
var menuText = new StringBuilder(256);
|
||||
uint result = GetMenuString(hMenu, i, menuText, menuText.Capacity, 0x400);
|
||||
|
||||
if (result == 0 || string.IsNullOrWhiteSpace(menuText.ToString()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
menuText.Replace("&", "");
|
||||
|
||||
var mii = new MENUITEMINFO
|
||||
{
|
||||
cbSize = (uint)Marshal.SizeOf(typeof(MENUITEMINFO)),
|
||||
|
|
@ -333,12 +323,16 @@ public static class ShellContextMenuDisplayHelper
|
|||
};
|
||||
|
||||
GetMenuItemInfo(hMenu, i, true, ref mii);
|
||||
var menuText = new StringBuilder(256);
|
||||
uint result = GetMenuString(hMenu, mii.wID, menuText, menuText.Capacity, 0);
|
||||
|
||||
if ((mii.fType & (uint)MenuItemFtype.Separator) != 0)
|
||||
if (result == 0 || string.IsNullOrWhiteSpace(menuText.ToString()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
menuText.Replace("&", "");
|
||||
|
||||
IntPtr hSubMenu = GetSubMenu(hMenu, (int)i);
|
||||
if (hSubMenu != IntPtr.Zero)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue